Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
56 lines (54 loc) · 1.65 KB
/
Copy patheslint.config.js
File metadata and controls
56 lines (54 loc) · 1.65 KB
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
import pluginVue from 'eslint-plugin-vue';
import tsParser from '@typescript-eslint/parser';
import vueParser from 'vue-eslint-parser';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import prettier from 'eslint-config-prettier';
const sharedRules = {
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-debugger': 'error',
// ignoreRestSiblings: destructuring a field out of a rest spread is the
// idiomatic "strip this property" pattern (e.g. saving a keychain entry
// without its ephemeral `show` flag) — the removed binding is intentionally
// unused.
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', ignoreRestSiblings: true }],
...prettier.rules,
};
export default [
{
ignores: ['dist/**', 'node_modules/**'],
},
{
files: ['web/src/**/*.{js,ts}'],
languageOptions: {
parser: tsParser,
parserOptions: { ecmaVersion: 'latest', sourceType: 'module' },
},
plugins: {
'@typescript-eslint': tsPlugin,
},
rules: sharedRules,
},
{
// .vue files must go through vue-eslint-parser, which delegates the
// <script> block to the TS parser; handing them to tsParser directly
// fails on the <template> block ("Parsing error: '>' expected").
files: ['web/src/**/*.vue'],
languageOptions: {
parser: vueParser,
parserOptions: {
parser: tsParser,
ecmaVersion: 'latest',
sourceType: 'module',
extraFileExtensions: ['.vue'],
},
},
plugins: {
'@typescript-eslint': tsPlugin,
vue: pluginVue,
},
rules: {
'vue/multi-word-component-names': 'off',
...sharedRules,
},
},
];