-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
129 lines (118 loc) · 3.7 KB
/
eslint.config.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
import js from '@eslint/js'
import globals from 'globals'
import pluginVue from 'eslint-plugin-vue'
import vueTsEslintConfig from '@vue/eslint-config-typescript'
import prettierSkipFormatting from '@vue/eslint-config-prettier/skip-formatting'
import vitest from '@vitest/eslint-plugin'
import stylisticJs from '@stylistic/eslint-plugin-js'
export default [
{
/**
* Ignore the following files.
* Please note that pluginQuasar.configs.recommended already ignores
* the "node_modules" folder for you (and all other Quasar project
* relevant folders and files).
*
* ESLint requires "ignores" key to be the only one in this object
*/
// ignores: []
files: ['**/*.js', '**/*.ts', '**/*.vue']
},
js.configs.recommended,
/**
* https://eslint.vuejs.org
*
* pluginVue.configs.base
* -> Settings and rules to enable correct ESLint parsing.
* pluginVue.configs[ 'flat/essential']
* -> base, plus rules to prevent errors or unintended behavior.
* pluginVue.configs["flat/strongly-recommended"]
* -> Above, plus rules to considerably improve code readability and/or dev experience.
* pluginVue.configs["flat/recommended"]
* -> Above, plus rules to enforce subjective community defaults to ensure consistency.
*/
...pluginVue.configs[ 'flat/recommended' ],
// https://github.com/vuejs/eslint-config-typescript
...vueTsEslintConfig({
// Optional: extend additional configurations from typescript-eslint'.
// Supports all the configurations in
// https://typescript-eslint.io/users/configs#recommended-configurations
extends: [
// By default, only the recommended rules are enabled.
'recommended',
// You can also manually enable the stylistic rules.
"stylistic",
// Other utility configurations, such as 'eslintRecommended', (note that it's in camelCase)
// are also extendable here. But we don't recommend using them directly.
]
}),
{
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
globals: {
...globals.browser,
...globals.node, // SSR, Electron, config files
process: 'readonly', // process.env.*
ga: 'readonly', // Google Analytics
cordova: 'readonly',
Capacitor: 'readonly',
chrome: 'readonly', // BEX related
browser: 'readonly' // BEX related
}
},
// add your custom rules here
rules: {
// TO BE ADDED TO PREVIOUS VERSION
'vue/block-lang': 'off',
'no-constant-binary-expression': 'warn',
'no-async-promise-executor': 'warn',
'@typescript-eslint/consistent-type-imports': [
'error',
{ prefer: 'type-imports' }
],
'prefer-promise-reject-errors': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': [
'warn',
{
'vars': 'all',
'varsIgnorePattern': '^_',
'args': 'after-used',
'argsIgnorePattern': '^_'
}
],
'vue/no-v-html': 'off',
// '@typescript-eslint/consistent-type-imports': [
// 'error',
// { prefer: 'type-imports' }
// ],
// allow debugger during development only
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'
}
},
{
plugins: {
'@stylistic/js': stylisticJs
}
},
{
files: ['**/*.vitest.test.js', '**/*.vitest.test.ts'],
plugins: {
vitest,
},
rules: {
...vitest.configs.recommended.rules,
'@typescript-eslint/no-unused-expressions': 'off',
'no-undef': 'warn'
},
},
{
ignores: [
'dist/*',
'node_modules/*',
'.eslintrc.js',
],
},
prettierSkipFormatting
]