-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
191 lines (190 loc) · 9.38 KB
/
index.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
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
import globals from 'globals'
import tseslint from 'typescript-eslint'
import pluginVue from 'eslint-plugin-vue'
import stylistic from '@stylistic/eslint-plugin'
/** @type {import('eslint').Linter.Config[]} */
export default [
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
stylistic.configs['recommended-flat'],
{
files: [
'**/*.{ts,vue}',
],
languageOptions: {
globals: globals.browser,
parserOptions: {
parser: tseslint.parser,
projectService: true,
tsconfigRootDir: import.meta.dirname,
extraFileExtensions: ['.vue'],
},
},
rules: {
'no-duplicate-imports': ['warn'],
'no-extra-parens': ['warn'],
'@typescript-eslint/array-type': ['warn'],
'@typescript-eslint/consistent-type-definitions': ['off'],
'@typescript-eslint/explicit-function-return-type': ['warn', { allowExpressions: true }],
'@typescript-eslint/explicit-member-accessibility': ['warn'],
'@typescript-eslint/method-signature-style': ['warn', 'property'],
'@typescript-eslint/no-empty-function': ['off'],
'@typescript-eslint/no-empty-object-type': ['off'],
'@typescript-eslint/no-floating-promises': ['off'],
'@typescript-eslint/no-inferrable-types': ['off'],
'@typescript-eslint/no-unsafe-argument': ['off'],
'@typescript-eslint/no-unsafe-assignment': ['off'],
'@typescript-eslint/no-unsafe-call': ['off'],
'@typescript-eslint/no-unsafe-member-access': ['off'],
'@typescript-eslint/no-unsafe-return': ['off'],
'@typescript-eslint/no-unused-vars': ['warn', { ignoreRestSiblings: true }],
'@typescript-eslint/non-nullable-type-assertion-style': ['warn'],
'@typescript-eslint/parameter-properties': ['warn'],
'@typescript-eslint/prefer-enum-initializers': ['warn'],
'@typescript-eslint/prefer-nullish-coalescing': ['warn', { ignoreConditionalTests: true }],
'@typescript-eslint/prefer-readonly': ['warn'],
'@typescript-eslint/require-array-sort-compare': ['warn'],
'@typescript-eslint/require-await': ['off'],
'@typescript-eslint/restrict-template-expressions': ['off'],
'@typescript-eslint/switch-exhaustiveness-check': ['warn'],
'@typescript-eslint/unbound-method': ['off'],
'@typescript-eslint/unified-signatures': ['off'],
'@stylistic/arrow-parens': ['warn', 'always'],
'@stylistic/array-bracket-newline': ['warn', 'consistent'],
'@stylistic/array-element-newline': ['warn', { consistent: true, multiline: true }],
'@stylistic/brace-style': ['warn', '1tbs'],
'@stylistic/comma-dangle': ['warn', { arrays: 'always-multiline', objects: 'always-multiline', imports: 'never', exports: 'never', functions: 'always-multiline' }],
'@stylistic/comma-spacing': ['warn'],
'@stylistic/curly-newline': ['warn', { multiline: true, consistent: true }],
'@stylistic/dot-location': ['warn', 'property'],
'@stylistic/func-call-spacing': ['warn'],
'@stylistic/function-call-spacing': ['warn'],
'@stylistic/implicit-arrow-linebreak': ['warn'],
'@stylistic/key-spacing': ['warn', { afterColon: true }],
'@stylistic/keyword-spacing': ['warn', { before: true, after: true }],
'@stylistic/member-delimiter-style': ['warn', { multiline: { delimiter: 'comma', requireLast: true }, singleline: { delimiter: 'comma', requireLast: false } }],
'@stylistic/newline-per-chained-call': ['warn', { ignoreChainWithDepth: 2 }],
'@stylistic/no-confusing-arrow': ['warn'],
'@stylistic/object-curly-newline': ['warn', { multiline: true, consistent: true }],
'@stylistic/object-curly-spacing': ['warn', 'always'],
'@stylistic/operator-linebreak': ['warn', 'none', { overrides: { '||': 'before', '&&': 'before' } }],
'@stylistic/object-property-newline': ['warn', { allowAllPropertiesOnSameLine: true }],
'@stylistic/one-var-declaration-per-line': ['warn'],
'@stylistic/quotes': ['warn', 'single', { avoidEscape: true }],
'@stylistic/space-before-function-paren': ['warn', { anonymous: 'never', named: 'never', asyncArrow: 'always' }],
'@stylistic/spaced-comment': ['warn', 'always', { markers: ['/'] }],
'@stylistic/switch-colon-spacing': ['warn'],
},
},
...pluginVue.configs['flat/recommended'],
{
files: [
'**/*.vue',
],
rules: {
'@stylistic/indent': ['off'],
'vue/script-indent': [
'warn', 2, { baseIndent: 1 },
],
'vue/array-bracket-newline': ['warn', 'consistent'],
'vue/array-element-newline': ['warn', { consistent: true, multiline: true }],
'vue/brace-style': ['warn', '1tbs'],
'vue/comma-dangle': ['warn', { arrays: 'always-multiline', objects: 'always-multiline', imports: 'never', exports: 'never', functions: 'always-multiline' }],
'vue/comma-spacing': ['warn', { before: true, after: false }],
'vue/dot-location': ['warn', 'property'],
'vue/key-spacing': ['warn', { afterColon: true }],
'vue/keyword-spacing': ['warn', { before: true, after: true }],
'vue/object-curly-newline': ['warn', { multiline: true, consistent: true }],
'vue/object-curly-spacing': ['warn', 'always'],
'vue/operator-linebreak': ['warn', 'none'],
'vue/object-property-newline': ['warn', { allowAllPropertiesOnSameLine: true }],
'vue/block-tag-newline': ['warn'],
'vue/brace-style': ['warn', '1tbs'],
'vue/camelcase': ['warn'],
'vue/comma-dangle': ['warn', { arrays: 'always-multiline', objects: 'always-multiline', imports: 'never', exports: 'never', functions: 'never' }],
'vue/comma-spacing': ['warn'],
'vue/component-definition-name-casing': ['warn'],
'vue/component-name-in-template-casing': ['off'],
'vue/component-options-name-casing': ['warn'],
'vue/component-tags-order': ['warn', { order: ['template', 'script', 'style'] }],
'vue/custom-event-name-casing': ['warn'],
'vue/dot-location': ['warn', 'property'],
'vue/dot-notation': ['warn'],
'vue/first-attribute-linebreak': ['warn'],
'vue/func-call-spacing': ['warn'],
'vue/html-button-has-type': ['warn'],
'vue/html-closing-bracket-newline': ['warn'],
'vue/html-closing-bracket-spacing': ['warn'],
'vue/html-comment-content-newline': ['warn'],
'vue/html-comment-content-spacing': ['warn'],
'vue/html-comment-indent': ['warn'],
'vue/html-end-tags': ['warn'],
'vue/html-indent': ['warn'],
'vue/html-quotes': ['warn'],
'vue/html-self-closing': ['warn'],
'vue/key-spacing': ['warn', { afterColon: true }],
'vue/keyword-spacing': ['warn', { before: true, after: true }],
'vue/match-component-file-name': ['warn'],
'vue/max-attributes-per-line': ['warn', { singleline: { max: 5 }, multiline: { max: 1 } }],
'vue/multi-word-component-names': ['warn'],
'vue/multiline-html-element-content-newline': ['warn'],
'vue/mustache-interpolation-spacing': ['warn'],
'vue/new-line-between-multi-line-property': ['warn'],
'vue/next-tick-style': ['warn'],
'vue/no-boolean-default': ['warn'],
'vue/no-child-content': ['warn'],
'vue/no-duplicate-attr-inheritance': ['warn'],
'vue/no-empty-component-block': ['warn'],
'vue/no-expose-after-await': ['warn'],
'vue/no-extra-parens': ['warn'],
'vue/no-invalid-model-keys': ['warn'],
'vue/no-lone-template': ['warn'],
'vue/no-multi-spaces': ['warn'],
'vue/no-multiple-objects-in-class': ['warn'],
'vue/no-multiple-slot-args': ['warn'],
'vue/no-potential-component-option-typo': ['warn'],
'vue/no-reserved-component-names': ['warn'],
'vue/no-spaces-around-equal-signs-in-attribute': ['warn'],
'vue/no-static-inline-styles': ['warn'],
'vue/no-template-shadow': ['warn'],
'vue/no-this-in-before-route-enter': ['warn'],
'vue/no-undef-properties': ['warn'],
'vue/no-unused-properties': ['warn'],
'vue/no-unused-refs': ['warn'],
'vue/no-use-computed-property-like-method': ['warn'],
'vue/no-useless-concat': ['warn'],
'vue/no-useless-mustaches': ['warn'],
'vue/no-useless-v-bind': ['warn'],
'vue/no-v-html': ['warn'],
'vue/no-v-text': ['warn'],
'vue/object-curly-newline': ['warn', { multiline: true, consistent: true }],
'vue/object-curly-spacing': ['warn', 'always'],
'vue/object-property-newline': ['warn', { allowAllPropertiesOnSameLine: true }],
'vue/one-component-per-file': ['warn'],
'vue/order-in-components': ['warn'],
'vue/padding-line-between-blocks': ['warn'],
'vue/prefer-separate-static-class': ['warn'],
'vue/prefer-template': ['warn'],
'vue/prop-name-casing': ['warn'],
'vue/require-default-prop': ['warn'],
'vue/require-direct-export': ['warn'],
'vue/require-explicit-emits': ['warn'],
'vue/require-expose': ['warn'],
'vue/require-name-property': ['warn'],
'vue/require-prop-types': ['warn'],
'vue/script-indent': ['warn', 2, { baseIndent: 1, switchCase: 1 }],
'vue/singleline-html-element-content-newline': ['warn'],
'vue/space-in-parens': ['warn'],
'vue/this-in-template': ['warn'],
'vue/v-bind-style': ['warn'],
'vue/v-on-event-hyphenation': ['warn'],
'vue/v-on-function-call': ['warn'],
'vue/v-on-style': ['warn'],
'vue/v-slot-style': ['warn'],
},
},
{
files: ['**/*.js'],
...tseslint.configs.disableTypeChecked,
},
]