-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc.js
97 lines (94 loc) · 2.53 KB
/
.eslintrc.js
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
const jsonRules = {
'indent': [
'error',
4,
{
SwitchCase: 1,
ignoredNodes: ['VariableDeclaration[declarations.length=0]']
}
],
'@typescript-eslint/consistent-type-assertions': 'off'
};
const javascriptRules = {
...jsonRules,
'react/style-prop-object': 'off',
'quotes': ['error', 'single'],
'quote-props': ['error', 'consistent-as-needed'],
'comma-dangle': ['error', 'never'],
'no-trailing-spaces': 'error',
'no-extra-semi': 'error',
'no-unused-vars': [
'error',
{ args: 'after-used', varsIgnorePattern: '^__unused' }
],
'semi': ['error', 'always']
};
const typescriptRules = {
...javascriptRules,
'no-unused-vars': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{ args: 'after-used', varsIgnorePattern: '^__unused' }
]
};
module.exports = {
root: true,
env: {
node: true,
es2021: true
},
parserOptions: {
ecmaVersion: 2022,
tsconfigRootDir: __dirname,
project: [
'./tsconfig.eslint.json'
// './{packages,apps,libs}/*-e2e/tsconfig.json',
// './{packages,apps,libs}/*/tsconfig.e2e.json',
// './{packages,apps,libs}/*/tsconfig.lib.json',
// './{packages,apps,libs}/*/tsconfig.app.json',
// './{packages,apps,libs}/*/tsconfig.spec.json',
// './{packages,apps,libs}/*/tsconfig.server.json'
],
EXPERIMENTAL_useProjectService: true
},
ignorePatterns: [
// '**/*',
'!**/*.json',
'!**/*.js',
'!**/*.mjs',
'!**/*.ts',
'dist/**',
'tmp/**',
'tools/**/_msr*',
'node_modules/**'
],
plugins: ['@nx'],
overrides: [
{
files: ['*.ts', '*.tsx'],
extends: ['plugin:@nx/typescript'],
rules: typescriptRules
},
{
files: ['*.js', '*.jsx'],
extends: ['plugin:@nx/javascript'],
rules: javascriptRules
},
{
files: ['*.mjs'],
extends: ['plugin:@nx/javascript'],
rules: javascriptRules,
parserOptions: {
sourceType: 'module',
ecmaVersion: 2021
}
},
{
files: ['*.json'],
parser: 'jsonc-eslint-parser',
extends: ['plugin:jsonc/recommended-with-json'],
rules: jsonRules
}
]
};