-
Notifications
You must be signed in to change notification settings - Fork 57
/
.eslintrc.cjs
80 lines (75 loc) · 2.24 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
68
69
70
71
72
73
74
75
76
77
78
79
80
/** @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/*/benchmarks/**/fixtures*/**',
'packages/framework-info/test/fixtures/**',
'packages/framework-info/dist/**',
'packages/*/lib/**',
'packages/*/dist/**',
'packages/edge-bundler/deno/**/*',
'packages/edge-bundler/node/vendor/**',
'packages/edge-bundler/test/deno/**/*',
'packages/edge-bundler/test/fixtures/**/*',
],
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',
},
},
{
files: ['packages/zip-it-and-ship-it/tests/**'],
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
},
},
],
}
module.exports = config