-
-
Notifications
You must be signed in to change notification settings - Fork 107
/
eslint.config.mjs
104 lines (101 loc) · 2.54 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
/* eslint perfectionist/sort-objects: "error" */
// @ts-check
import antfu from '@antfu/eslint-config'
import stylistic from './stub.mjs'
const stylisticConfig = stylistic.configs.customize()
export default antfu(
{
formatters: true,
ignores: [
'**/fixtures/**',
'**/playground/**',
'packages/metadata/src/metadata.ts',
],
jsx: true,
markdown: false,
typescript: true,
},
{
rules: {
'eslint-comments/no-unused-enable': 'off',
'jsdoc/check-param-names': 'off',
'jsdoc/no-types': 'off',
'jsdoc/require-returns-description': 'off',
'no-cond-assign': 'off',
'no-template-curly-in-string': 'off',
'no-void': 'off',
'style/max-statements-per-line': 'off',
'style/multiline-ternary': 'off',
'style/no-mixed-operators': 'off',
'ts/no-require-import': 'off',
'ts/no-require-imports': 'off',
'ts/no-var-requires': 'off',
'unicorn/consistent-function-scoping': 'off',
'unicorn/no-new-array': 'off',
'unicorn/prefer-number-properties': 'off',
},
},
{
files: [
'**/*.test.{js,ts}',
],
name: 'local/test',
rules: {
'antfu/indent-unindent': 'error',
'node/prefer-global/process': 'off',
},
},
{
files: [
'**/*.md',
],
name: 'local/markdown',
rules: {
'style/no-tabs': 'off',
},
},
{
files: [
'packages/eslint-plugin-{js,jsx,ts,plus}/{rules,utils}/**/*.ts',
'packages/shared/utils/**/*.ts',
],
ignores: ['**/*.test.ts'],
name: 'local/restricted-imports',
rules: {
'no-restricted-imports': ['error', {
patterns: [
{
group: ['@typescript-eslint/utils', '@typescript-eslint/utils/*'],
importNames: [
'TSESTree',
'RuleFunction',
'RuleListener',
'SourceCode',
'RuleFixer',
'ReportFixFunction',
'RuleContext',
'EcmaVersion',
'ReportDescriptor',
'Scope',
],
message: 'Import from "#types" instead',
},
{
group: ['#test', '#test/*'],
message: 'Should not import test utilities',
},
],
}],
},
},
)
.override('antfu/stylistic/rules', {
...stylisticConfig,
rules: {
...stylisticConfig.rules,
'antfu/consistent-list-newline': 'error',
'antfu/curly': 'error',
'antfu/if-newline': 'error',
'antfu/top-level-function': 'error',
},
})