-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy path.eslintrc.js
71 lines (66 loc) · 2.06 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
module.exports = {
env: {
node: true,
browser: true,
es2021: true,
},
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'@typescript-eslint/no-non-null-assertion': 0,
'no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
},
plugins: ['@typescript-eslint'],
extends: ['eslint:recommended', 'plugin:prettier/recommended'],
// extends: ['plugin:prettier/recommended'],
overrides: [
{
files: ['**/*.vue'],
extends: ['plugin:prettier/recommended', 'plugin:vue/vue3-essential'],
},
{
files: ['**/*.ts?(x)'],
parser: '@typescript-eslint/parser',
// extends: ['plugin:@typescript-eslint/recommended', 'prettier/@typescript-eslint'],
extends: ['prettier/@typescript-eslint'],
rules: {
'no-useless-escape': 'off',
// TypeScript's `noFallthroughCasesInSwitch` option is more robust (#6906)
'default-case': 'off',
// 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/291)
'no-dupe-class-members': 'off',
// 'tsc' already handles this (https://github.com/typescript-eslint/typescript-eslint/issues/477)
'no-undef': 'off',
// Add TypeScript specific rules (and turn off ESLint equivalents)
'no-array-constructor': 'off',
'no-redeclare': 'off',
'no-use-before-define': 'off',
'no-unused-expressions': 'off',
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
args: 'none',
ignoreRestSiblings: true,
},
],
'no-useless-constructor': 'off',
'@typescript-eslint/no-useless-constructor': 'warn',
},
},
{
files: ['**/*.spec.{j,t}s'],
env: {
jest: true,
},
},
],
}