-
-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy patheslint.config.js
More file actions
157 lines (156 loc) · 5.02 KB
/
Copy patheslint.config.js
File metadata and controls
157 lines (156 loc) · 5.02 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
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',
},
},
{
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',
},
},
{
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',
},
},
{
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/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',
}],
}],
},
},
)