Repository navigation
Expand file tree
/
Copy patheslint.config.js
More file actions
213 lines (212 loc) · 7.37 KB
/
Copy patheslint.config.js
File metadata and controls
213 lines (212 loc) · 7.37 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
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
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
import vuetify from 'eslint-config-vuetify'
export default vuetify({
vue: true,
perfectionist: {
import: false,
},
autoimports: false,
test: {
runner: 'vitest',
},
},
{
rules: {
'import/first': 'off',
'curly': 'off',
'@stylistic/operator-linebreak': 'off',
// eslint-config-vuetify 4.7.2 — flood / unsafe-autofix / AST false positives.
// Keep the small correctness set (css-escape, empty lookahead, dupe
// disjunctions, unused capturing groups) and fix those in source.
'unicorn/no-this-outside-of-class': 'off',
'unicorn/no-unused-array-method-return': 'off',
'unicorn/numeric-separators-style': 'off',
'unicorn/prefer-split-limit': 'off',
'unicorn/prefer-includes-over-repeated-comparisons': 'off',
'unicorn/prefer-https': 'off',
'unicorn/prefer-string-repeat': 'off',
'unicorn/consistent-compound-words': 'off',
'unicorn/better-dom-traversing': 'off',
'regexp/use-ignore-case': 'off',
'regexp/prefer-w': 'off',
'regexp/strict': 'off',
'regexp/no-super-linear-backtracking': 'off',
'regexp/optimal-quantifier-concatenation': 'off',
'regexp/prefer-d': 'off',
'regexp/prefer-character-class': 'off',
'regexp/match-any': 'off',
'prefer-regex-literals': 'off',
},
},
{
files: ['**/*.ts', '**/*.vue'],
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-unreadable-array-destructuring': 'off',
'func-style': ['error', 'declaration'],
'one-var': ['error', 'never'],
'no-restricted-syntax': ['error',
{
selector: 'CallExpression[callee.name="withDefaults"]',
message: 'Use destructuring with defaults instead of withDefaults.',
},
],
'perfectionist/sort-exports': 'off',
'perfectionist/sort-imports': ['error', {
type: 'natural',
order: 'asc',
ignoreCase: true,
newlinesBetween: 1,
groups: [
'builtin',
'external',
{ newlinesBetween: 1 },
{ group: 'framework', commentAbove: 'Framework' },
{ newlinesBetween: 1 },
{ group: 'components', commentAbove: 'Components' },
{ newlinesBetween: 1 },
{ group: 'context', commentAbove: 'Context' },
{ newlinesBetween: 1 },
{ group: 'composables', commentAbove: 'Composables' },
{ newlinesBetween: 1 },
{ group: 'adapters', commentAbove: 'Adapters' },
{ newlinesBetween: 1 },
{ group: 'transformers', commentAbove: 'Transformers' },
{ newlinesBetween: 1 },
'internal',
'sibling',
'index',
{ newlinesBetween: 1 },
{ group: 'stores', commentAbove: 'Stores' },
{ newlinesBetween: 1 },
{ group: 'utilities', commentAbove: 'Utilities' },
{ newlinesBetween: 1 },
{ group: 'type', commentAbove: 'Types' },
],
customGroups: [
{ groupName: 'framework', modifiers: ['value'], elementNamePattern: '^@vuetify/v0' },
{ groupName: 'adapters', modifiers: ['value'], elementNamePattern: '/adapters' },
{ groupName: 'components', modifiers: ['value'], elementNamePattern: '/components/' },
{ groupName: 'context', modifiers: ['value'], elementNamePattern: String.raw`^\./.*\.vue$` },
{ groupName: 'transformers', modifiers: ['value'], elementNamePattern: '/to[A-Z]' },
{ groupName: 'composables', modifiers: ['value'], elementNamePattern: ['/composables/', '/use[A-Z]'] },
{ groupName: 'stores', modifiers: ['value'], elementNamePattern: ['/stores/', '/stores$', '^@vuetify/auth$'] },
{ groupName: 'utilities', modifiers: ['value'], elementNamePattern: ['/utilities', '/utils', '/helpers', '^vue$', '^vue-router$', '^pinia$', '^@vue/'] },
],
}],
},
},
{
files: ['**/*.test.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'vitest/prefer-lowercase-title': 'error',
'vitest/prefer-hooks-in-order': 'error',
'vitest/prefer-hooks-on-top': 'error',
'vitest/max-nested-describe': ['error', { max: 3 }],
'vitest/consistent-test-it': ['error', { fn: 'it' }],
},
},
{
files: ['**/scripts/**/*.ts', '**/build/**/*.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
},
},
{
// @paper/bulma conformance tests: conform() throws on mismatch — it IS the assertion
files: ['packages/bulma/**/*.browser.test.ts'],
rules: {
'vitest/expect-expect': ['error', { assertFunctionNames: ['expect', 'conform'] }],
},
},
{
files: ['**/*.vue'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'vue/block-order': ['error', { order: ['script', 'template', 'style'] }],
'vue/v-bind-style': ['error', 'shorthand', { sameNameShorthand: 'always' }],
},
},
{
files: ['apps/docs/src/examples/**/*.vue', 'apps/docs/src/examples/**/*.ts'],
rules: {
'perfectionist/sort-imports': 'off',
},
},
{
name: 'pnpm/pnpm-workspace-yaml',
files: ['pnpm-workspace.yaml'],
rules: {
'pnpm/yaml-no-unused-catalog-item': 'error',
'pnpm/yaml-no-duplicate-catalog-item': 'error',
},
},
{
ignores: ['**/node_modules/**', '**/dist/**'],
files: ['package.json', '**/package.json'],
rules: {
'pnpm/json-enforce-catalog': 'error',
},
},
{
// The vapor test package intentionally pins Vue 3.6 beta + the Vapor runtime.
// They can't be cataloged: a second catalog entry for `vue` would duplicate
// the default catalog's 3.5.x and trip pnpm/yaml-no-duplicate-catalog-item.
// Allow these specifiers to stay un-cataloged in this one package only.
files: ['tests/vapor/package.json'],
rules: {
'pnpm/json-enforce-catalog': ['error', {
ignores: ['vue', '@vue/runtime-vapor', '@vitejs/plugin-vue'],
}],
},
},
{
ignores: ['**/export-templates/package.json'],
},
{
// Enforce V0Error over bare Error for throw sites in the core package.
// This prevents contributors from accidentally bypassing the typed error
// registry (V0ErrorDetails) that gives consumers a stable code discriminant.
name: 'vuetify/no-bare-error-throw',
files: ['packages/0/src/**/*.ts'],
ignores: ['packages/0/src/**/*.test.ts', 'packages/0/src/**/*.bench.ts'],
rules: {
'no-restricted-syntax': ['error',
{
selector: 'ThrowStatement > NewExpression[callee.name="Error"]',
message: 'Use V0Error with a code from V0ErrorDetails instead of bare Error. See packages/0/src/utilities/errors.ts.',
},
],
},
},
{
name: 'vuetify/locale-ti-requires-fallback',
files: ['packages/0/src/components/**/*.vue'],
rules: {
'no-restricted-syntax': ['error',
{
selector: 'CallExpression[callee.name="withDefaults"]',
message: 'Use destructuring with defaults instead of withDefaults.',
},
{
selector: 'CallExpression[callee.property.name="ti"]:not(LogicalExpression[operator="??"] > CallExpression[callee.property.name="ti"])',
message: 'locale.ti() must be guarded with a `?? \'<inline English default>\'` so unconfigured apps get an accessible name. See packages/0/src/locale/messages/en for canonical strings.',
},
],
},
},
{
name: 'vuetify/no-v0-imports',
files: ['packages/paper/**/*.{ts,js,vue}', 'app/**/*.{ts,js,vue}'],
rules: {
'no-restricted-imports': ['error', {
patterns: [{
group: [String.raw`\#v0/**`],
message: 'Use @vuetify/v0 import',
}],
}],
},
},
)