-
Notifications
You must be signed in to change notification settings - Fork 53
/
.eslintrc.cjs
67 lines (63 loc) · 1.85 KB
/
.eslintrc.cjs
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
/** @type {import('eslint').Linter.Config} */
const config = {
env: {
es2021: true,
node: true,
},
settings: {
'import/extensions': ['.js'],
},
extends: ['eslint:recommended', 'plugin:@typescript-eslint/recommended', 'prettier'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
plugins: ['import', '@typescript-eslint'],
ignorePatterns: [
// TODO: remove when they are migrated to typescript
'packages/build/test-d/**',
'packages/build/types/**',
// don't lint fixtures
'packages/*/tests/**/fixtures/**',
'packages/framework-info/test/fixtures/**',
'packages/framework-info/dist/**',
'packages/*/lib/**',
],
rules: {
// -----------------------------------------------------------
// General rules
strict: 'error',
// -----------------------------------------------------------
// Typescript rules
'@typescript-eslint/no-explicit-any': ['off'],
// -----------------------------------------------------------
// Import rules
'import/extensions': ['error', 'ignorePackages'], // This requires for esm modules .js file extensions on relative paths
'import/no-absolute-path': ['error'],
'import/no-cycle': ['error', { ignoreExternal: true }],
'import/no-duplicates': ['error', { considerQueryString: true }],
'import/no-self-import': ['error'],
'import/no-mutable-exports': ['error'],
'import/no-useless-path-segments': ['error'],
'import/order': [
'error',
{
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
},
overrides: [
{
files: ['packages/*/tests/**'],
rules: {
'@typescript-eslint/no-empty-function': 'off',
},
},
],
}
module.exports = config