-
Notifications
You must be signed in to change notification settings - Fork 56
/
.eslintrc.js
executable file
·88 lines (81 loc) · 2.08 KB
/
.eslintrc.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
/* eslint-env node */
require('@rushstack/eslint-patch/modern-module-resolution');
const path = require('path');
module.exports = {
root: true,
extends: [
'plugin:vue/essential',
'eslint:recommended',
'@vue/eslint-config-typescript/recommended',
'@vue/eslint-config-prettier',
],
rules: {
// eslint http://eslint.cn/docs/rules/
'no-debugger': 'error',
'no-console': 'error',
eqeqeq: ['error', 'always'],
// prettier https://prettier.io/docs/en/options.html
'prettier/prettier': [
'error',
{
singleQuote: true,
arrowParens: 'always',
semi: true,
trailingComma: 'all',
},
],
// vue
'vue/multi-word-component-names': 'off',
'vue/no-mutating-props': 'off',
'vue/no-reserved-component-names': 'off',
// typescript https://typescript-eslint.io/rules/
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-types': [
'error',
{
types: {
'{}': false,
},
},
],
// import https://github.com/import-js/eslint-plugin-import#rules
'import/no-useless-path-segments': 'error',
'import/first': 'error',
'import/no-duplicates': 'error',
'import/order': [
'error',
{
groups: [
['builtin', 'external'],
['type'],
['internal', 'parent', 'sibling', 'index'],
],
pathGroups: [
{
pattern: '@/**',
group: 'internal',
},
],
'newlines-between': 'always',
alphabetize: { order: 'asc' },
},
],
'import/newline-after-import': 'error',
},
plugins: [
// https://github.com/import-js/eslint-import-resolver-typescript#configuration
'import',
],
settings: {
// https://github.com/import-js/eslint-import-resolver-typescript#configuration
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
project: path.resolve(__dirname, 'tsconfig.json'),
},
},
},
};