-
Notifications
You must be signed in to change notification settings - Fork 23
/
eslint.config.mjs
74 lines (72 loc) · 1.8 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
import path from 'path'
import pluginVue from 'eslint-plugin-vue'
import vueTsEslintConfig from '@vue/eslint-config-typescript'
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'
import eslintPluginImport from 'eslint-plugin-import'
export default [
{
name: 'app/files-to-lint',
files: ['**/*.{js,cjs,mjs,ts,mts,vue}'],
},
{
name: 'app/files-to-ignore',
ignores: [
'**/.witnet-rust-testnet-*-wallet',
'**/auto-imports.d.ts',
'**/build/**',
'**/coverage/**',
'**/dist-electron/',
'**/dist-ssr/**',
'**/dist/**',
'**/src/components.d.ts',
'**/src/locales/**',
'/dist_electron/',
],
},
...pluginVue.configs['flat/essential'],
...vueTsEslintConfig(),
skipFormatting,
{
plugins: {
import: eslintPluginImport,
},
rules: {
// Override import/extensions rule
'import/extensions': [
'error',
{
vue: 'always',
js: 'ignorePackages',
scss: 'always',
svg: 'always',
},
],
// Disable specific Vue rules
'vue/multi-word-component-names': 'off',
'vue/no-reserved-component-names': 'off',
'vue/require-explicit-emits': 'off',
'vue/block-lang': 'off',
// TODO: remove this rule
'@typescript-eslint/no-explicit-any': 'off',
'import/extensions': 'off',
},
settings: {
'import/resolver': {
alias: {
map: [['@', path.resolve('src')]],
extensions: ['.vue', '.js', '.ts', '.d.ts'],
},
},
'vue-i18n': {
localeDir: path.resolve('src', 'locales') + '/*.{json}',
messageSyntaxVersion: '^9.0.0',
},
},
},
{
files: ['**/*.cjs'],
rules: {
'@typescript-eslint/no-require-imports': 'off',
},
},
]