-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
60 lines (59 loc) · 1.45 KB
/
eslint.config.mjs
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
import pluginJs from '@eslint/js';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import pluginVue from 'eslint-plugin-vue';
import globals from 'globals';
import tseslint from 'typescript-eslint';
export default [
{ files: ['**/*.{js,mjs,cjs,ts}'] },
{ languageOptions: { globals: globals.browser } },
{
files: ['**/*.vue'],
languageOptions: {
parserOptions: {
parser: tseslint.parser,
},
},
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
...pluginVue.configs['flat/essential'],
eslintPluginPrettierRecommended,
{
rules: {
'max-len': ['error', 140, 2, {
ignoreUrls: true,
ignoreComments: false,
ignoreRegExpLiterals: true,
ignoreStrings: true,
ignoreTemplateLiterals: true,
}],
'no-console': 'warn',
'no-param-reassign': ['error', {
props: true,
ignorePropertyModificationsForRegex: ['(E|e)lement$'],
}],
quotes: ['error', 'single', { avoidEscape: true }],
'vue/multi-word-component-names': 'off',
'prettier/prettier': [
'error',
{
singleQuote: true,
},
],
}
},
// Override rules for test files
{
files: ['**/*.test.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
// Override rules for test files
{
files: ['**/*.vue'],
rules: {
'max-len': 'off',
},
},
];