-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy path.eslintrc.js
99 lines (78 loc) · 2.82 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
98
99
module.exports = {
env: {
browser: true,
es2021: true,
node: true,
'vue/setup-compiler-macros': true,
},
extends: [
'airbnb-base',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:vue/vue3-recommended',
'eslint:recommended',
'plugin:prettier/recommended',
'plugin:tailwindcss/recommended',
],
parser: 'vue-eslint-parser',
parserOptions: {
ecmaVersion: 'latest',
parser: '@typescript-eslint/parser',
sourceType: 'module',
},
plugins: ['vue', '@typescript-eslint', 'prettier'],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
// var is forbidden
'no-var': 'error',
// Use interface first
'@typescript-eslint/consistent-type-definitions': ['error', 'interface'],
// prettier error
'prettier/prettier': ['warn', { endOfLine: 'auto' }],
// Remove unnecessary class newlines
'lines-between-class-members': 'off',
// https://eslint.org/docs/rules/default-case
'default-case': 'off',
// https://eslint.org/docs/rules/no-use-before-define
'no-use-before-define': 'off',
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-shadow.md
'no-shadow': 'off',
// TODO: enable this rule
'@typescript-eslint/no-shadow': 'off',
// https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/no-redeclare.md
'no-redeclare': 'off',
'@typescript-eslint/no-redeclare': ['error'],
// use bit (|, &)
'no-bitwise': 'off',
// import
'import/extensions': 'off',
'import/no-unresolved': 'off',
'import/prefer-default-export': 'off',
// no-unused-vars
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'off',
// in vue no-unused-vars white list `_`
'vue/no-unused-vars': ['error', { ignorePattern: '^_' }],
// use void
'no-void': 'off',
// https://eslint.org/docs/rules/no-return-assign
'no-return-assign': ['error', 'except-parens'],
// https://eslint.org/docs/rules/no-restricted-globals
'no-restricted-globals': ['error', 'event'],
// https://eslint.org/docs/rules/no-unused-expressions
'no-unused-expressions': 'off',
// https://eslint.vuejs.org/rules/no-template-shadow.html
'vue/no-template-shadow': 'off',
// allow underscore-dangle
'no-underscore-dangle': 'off',
// allow any syntax
'no-restricted-syntax': 'off',
// allow await in loop
'no-await-in-loop': 'off',
// allow use ++ and --
'no-plusplus': 'off',
// Because we have custom CSS classes, turn off the no-custom-classname rule of TailwindCSS.
'tailwindcss/no-custom-classname': 'off',
},
};