-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
78 lines (74 loc) · 1.93 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
import typescriptEslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
import prettier from 'eslint-plugin-prettier';
import vueParser from 'vue-eslint-parser';
import vuePlugin from 'eslint-plugin-vue';
import globals from 'globals';
export default [
{
ignores: ['**/node_modules', '**/dist', '**/.nuxt', '**/.output', '.eslintrc.js']
},
{
languageOptions: {
parser: vueParser,
parserOptions: {
parser: tsParser,
sourceType: 'module',
ecmaVersion: 2022,
extraFileExtensions: ['.vue'],
},
globals: {
...globals.browser,
...globals.node,
...globals.es2021
},
},
plugins: {
'@typescript-eslint': typescriptEslint,
'vue': vuePlugin,
'prettier': prettier,
},
rules: {
// TypeScript
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-unused-vars': ['warn', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_'
}],
// Vue
'vue/multi-word-component-names': 'off',
'vue/require-default-prop': 'off',
'vue/no-v-html': 'off',
// General
'no-console': 'error',
'no-debugger': 'error',
'prettier/prettier': 'error',
'padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: ['block', 'block-like', 'cjs-export', 'class', 'export', 'import'], next: '*' },
{ blankLine: 'always', prev: ['const', 'let'], next: ['block', 'block-like', 'cjs-export', 'class', 'export', 'import'] },
{ blankLine: 'any', prev: ['export', 'import'], next: ['export', 'import'] }
]
}
},
{
files: ['**/*.vue'],
rules: {
...vuePlugin.configs['vue3-recommended'].rules
}
},
{
files: ['**/*.ts', '**/*.tsx'],
languageOptions: {
parser: tsParser,
parserOptions: {
project: './tsconfig.json'
}
},
rules: {
...typescriptEslint.configs['recommended'].rules
}
}
];