-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy path.eslintrc.cjs
165 lines (163 loc) · 5.95 KB
/
.eslintrc.cjs
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
module.exports = {
root: true,
env: {
node: true
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:vue/vue3-recommended',
'@vue/typescript/recommended',
],
plugins: [
'vue',
'@stylistic/ts'
],
ignorePatterns: [
'node_modules',
'*.js'
],
parserOptions: {
ecmaVersion: 2020,
parser: '@typescript-eslint/parser',
sourceType: 'module',
project: './tsconfig.json',
tsconfigRootDir: __dirname,
extraFileExtensions: ['.vue'],
},
rules: {
// https://eslint.org/docs/rules/
'no-console': 'warn',
'no-debugger': 'warn',
'semi': 'off',
'indent': 'off',
'no-unused-expressions': 'off',
'space-before-function-paren': ['warn', {
'anonymous': 'never',
'named': 'never',
'asyncArrow': 'always'
}],
'no-trailing-spaces': 'warn',
'no-any': 'off',
'no-prototype-builtins': 'off',
'no-unused-vars': 'off',
'prefer-rest-params': 'warn',
'no-extra-parens': 'off',
'quotes': 'off',
'func-call-spacing': 'off',
'comma-spacing': 'off',
'keyword-spacing': 'off',
'object-curly-spacing': ['warn', 'always'],
'comma-dangle': ['warn', 'never'],
'max-len': ['warn', 120],
'eqeqeq': 'error',
// https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin#supported-rules
'@stylistic/ts/indent': ['warn', 4],
'@stylistic/ts/semi': 'error',
'@typescript-eslint/no-unused-expressions': ['error', {
allowTernary: true,
allowShortCircuit: true
}],
'@stylistic/ts/quotes': ['warn', 'single'],
'@stylistic/ts/no-extra-parens': 'error',
'@typescript-eslint/no-unused-vars': 'warn',
'@typescript-eslint/no-useless-constructor': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unsafe-return': 'off',
'@typescript-eslint/no-unsafe-assignment': 'off',
'@typescript-eslint/explicit-module-boundary-types': ['error', {
allowArgumentsExplicitlyTypedAsAny: true,
allowedNames: ['setup']
}],
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
'@typescript-eslint/prefer-optional-chain': 'warn',
'@typescript-eslint/prefer-ts-expect-error': 'warn',
'@typescript-eslint/promise-function-async': 'error',
'@stylistic/ts/func-call-spacing': ['error', 'never'],
'@stylistic/ts/comma-spacing': 'warn',
'@stylistic/ts/keyword-spacing': 'warn',
// '@typescript-eslint/consistent-indexed-object-style': ['error', 'record'], // waiting on dependency updates
// '@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }],
'@stylistic/ts/member-delimiter-style': 'warn',
'@stylistic/ts/type-annotation-spacing': 'warn',
'@typescript-eslint/naming-convention': ['error',
{
selector: 'default',
format: ['camelCase']
},
{
selector: 'import',
format: null
},
{
selector: 'objectLiteralProperty',
format: ['camelCase', 'PascalCase']
},
{
selector: 'typeLike',
format: ['PascalCase']
},
{
selector: 'parameter',
format: null,
filter: {
regex: '^_.*',
match: true
}
}
],
'@typescript-eslint/no-non-null-assertion': 'off',
// https://eslint.vuejs.org/rules/
// if unsure and eslint doesn't cover it please refer to https://v3.vuejs.org/style-guide/
'vue/html-indent': ['warn', 4],
'vue/component-name-in-template-casing': ['warn', 'PascalCase'],
'vue/match-component-file-name': ['off', { // until we have storybook working
extensions: ['jsx', 'vue', 'tsx']
}],
'vue/new-line-between-multi-line-property': 'warn',
'vue/max-attributes-per-line': [
'warn', {
'singleline': 3,
'multiline': 1
}
],
'vue/first-attribute-linebreak': ['warn', {
'singleline': 'ignore',
'multiline': 'beside'
}],
'vue/no-boolean-default': ['error', 'default-false'],
'vue/no-duplicate-attr-inheritance': 'error',
'vue/no-empty-component-block': 'warn',
'vue/no-multiple-objects-in-class': 'error',
'vue/no-potential-component-option-typo': ['error', {
presets: ['vue', 'vue-router']
}],
'vue/no-reserved-component-names': ['error', {
'disallowVueBuiltInComponents': true,
'disallowVue3BuiltInComponents': true
}],
'vue/no-template-target-blank': 'error',
'vue/no-unsupported-features': ['error', {
'version': '^3.0.0'
}],
'vue/no-useless-mustaches': 'warn',
'vue/no-useless-v-bind': 'error',
'vue/padding-line-between-blocks': 'warn',
'vue/require-name-property': 'error',
'vue/v-for-delimiter-style': 'error',
'vue/v-on-event-hyphenation': 'error',
'vue/v-on-function-call': ['error', 'never', {
'ignoreIncludesComment': true
}],
'vue/eqeqeq': 'error',
'vue/no-extra-parens': 'warn',
'vue/html-closing-bracket-newline': ['warn', {
'multiline': 'never'
}],
'vue/no-v-html': 'off',
'vue/require-default-prop': 'off',
'vue/no-v-text-v-html-on-component': 'off'
}
}