-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy patheslint.config.mjs
More file actions
81 lines (78 loc) · 2.09 KB
/
eslint.config.mjs
File metadata and controls
81 lines (78 loc) · 2.09 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
import { includeIgnoreFile } from '@eslint/compat';
import perfectionist from 'eslint-plugin-perfectionist';
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended';
import vitest from 'eslint-plugin-vitest';
import { dirname, resolve } from 'node:path';
import { fileURLToPath } from 'node:url';
import withNuxt from './.nuxt/eslint.config.mjs';
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const gitignorePath = resolve(__dirname, '.gitignore');
export default withNuxt(
includeIgnoreFile(gitignorePath),
eslintPluginPrettierRecommended,
perfectionist.configs['recommended-alphabetical'],
{
linterOptions: {
reportUnusedDisableDirectives: 'error',
},
rules: {
'@typescript-eslint/no-empty-object-type': [
'error',
{
allowInterfaces: 'with-single-extends',
},
],
'@typescript-eslint/no-unused-vars': 'error',
'dot-notation': 'error',
'no-undef': 'error',
'no-unused-vars': 'off',
'object-shorthand': ['error', 'always'],
'prefer-const': 'error',
'vue/attribute-hyphenation': ['error', 'never'],
'vue/attributes-order': [
'error',
{
alphabetical: true,
},
],
'vue/component-name-in-template-casing': ['error', 'PascalCase'],
'vue/define-emits-declaration': ['error', 'type-literal'],
'vue/define-props-declaration': ['error', 'type-based'],
'vue/no-multiple-template-root': 'off',
'vue/v-bind-style': [
'error',
'shorthand',
{
sameNameShorthand: 'always',
},
],
'vue/v-on-event-hyphenation': [
'error',
'never',
{
autofix: true,
},
],
},
},
{
files: ['vitest.setup.ts', '**/*.spec.ts'],
languageOptions: {
globals: {
...vitest.environments.env.globals,
},
},
plugins: {
vitest,
},
rules: {
...vitest.configs.recommended.rules,
},
settings: {
vitest: {
typecheck: true,
},
},
},
);