forked from Kong/kongponents
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
62 lines (62 loc) · 1.94 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
module.exports = {
root: true,
parserOptions: {
parser: '@typescript-eslint/parser',
ecmaVersion: 2020,
},
env: {
node: true,
},
plugins: ['vue', 'import', '@typescript-eslint'],
extends: [
'eslint:recommended',
'plugin:vue/vue3-recommended',
'standard',
],
rules: {
quotes: ['error', 'single', { avoidEscape: true }],
'no-multi-spaces': 'error',
'no-trailing-spaces': 'error',
'no-empty': 'off',
'padded-blocks': 'off',
'comma-dangle': ['error', 'always-multiline'],
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'max-len': [process.env.NODE_ENV === 'production' ? 'warn' : 'off', {
code: 120,
ignoreTrailingComments: true,
ignoreUrls: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
ignoreRegExpLiterals: true,
}],
'space-before-function-paren': 'off',
'vue/attributes-order': ['error', {
alphabetical: true,
}],
},
overrides: [
{
files: ['*.ts', '*.vue'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
// Avoids false errors like “'NodeListOf' is not defined”.
'no-undef': 'off',
// Turns off some non-TypeScript rules in favor of their specific TypeScript rules to avoid false negatives:
indent: 'off',
'@typescript-eslint/indent': ['error', 2],
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': 'error',
'space-before-function-paren': 'off',
'@typescript-eslint/space-before-function-paren': ['error', {
anonymous: 'never',
named: 'never',
asyncArrow: 'always',
}],
// Ensures ESLint understands that `defineEmits<{ ... }>()` does _not_ fail this rule.
'func-call-spacing': 'off',
'@typescript-eslint/func-call-spacing': 'error',
},
},
],
}