forked from meriyah/meriyah
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
78 lines (76 loc) · 2.15 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
import eslintJs from '@eslint/js';
import eslintPluginN from 'eslint-plugin-n';
import tseslint from 'typescript-eslint';
import eslintPluginImportX from 'eslint-plugin-import-x';
export default [
eslintJs.configs.recommended,
...tseslint.configs.recommended,
{
plugins: { 'import-x': eslintPluginImportX },
settings: eslintPluginImportX.configs.typescript.settings,
rules: {
...eslintPluginImportX.configs.errors.rules,
...eslintPluginImportX.configs.warnings.rules,
...eslintPluginImportX.configs.typescript.rules,
'@typescript-eslint/no-use-before-define': [2, { functions: false }], // https://github.com/eslint/eslint/issues/11903
'@typescript-eslint/indent': 0,
'prefer-const': ['error', { destructuring: 'all' }],
'prefer-destructuring': [
'error',
{
VariableDeclarator: {
array: false,
object: true
},
AssignmentExpression: {
array: false,
object: false
}
},
{
enforceForRenamedProperties: false
}
],
// TODO: enable it when all problems addressed
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/class-name-casing': 0,
'@typescript-eslint/camelcase': 0,
'@typescript-eslint/no-var-requires': 0,
'@typescript-eslint/no-require-imports': 0,
'no-fallthrough': 0
}
},
{
files: ['**/*.js'],
...eslintPluginN.configs['flat/recommended']
},
{
files: ['bench/**/*'],
rules: {
'import-x/no-unresolved': 0,
'import-x/namespace': 0
}
},
{
files: ['scripts/*.js'],
rules: {
'n/no-unsupported-features/es-syntax': ['error', { version: '10.0', ignores: [] }],
'n/no-extraneous-require': 0,
'n/no-unpublished-require': 0
}
},
{
files: ['eslint.config.mjs'],
rules: {
'import-x/no-unresolved': 0,
'import-x/namespace': 0,
'import-x/default': 0,
'import-x/no-named-as-default': 0,
'import-x/no-named-as-default-member': 0
}
},
{
ignores: ['dist']
}
];