-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy patheslint.config.mjs
119 lines (109 loc) · 2.72 KB
/
eslint.config.mjs
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
import globals from 'globals';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import js from '@eslint/js';
import { FlatCompat } from '@eslint/eslintrc';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
export default [
{
ignores: [
'**/dist/',
'**/node_modules',
'**/node_modules/',
'**/types/',
'**/cache/',
'!docs/.vitepress',
'!.eslintrc.js',
'!**/.test',
'**/.temp',
],
},
...compat.extends('@antfu'),
{
languageOptions: {
globals: {
...globals.browser,
...globals.node,
},
},
rules: {
'vue/no-deprecated-functional-template': 'off',
'vue/one-component-per-file': 'off',
'vue/no-template-shadow': 'off',
'vue/valid-v-for': 'off',
'@typescript-eslint/no-redeclare': 'off',
'vue/require-prop-types': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'spaced-comment': [
'error',
'always',
{
exceptions: ['#__PURE__'],
},
],
'no-restricted-imports': [
'error',
{
paths: ['..', '../..'],
},
],
'node/no-callback-literal': 'off',
'import/namespace': 'off',
'import/default': 'off',
'import/no-mutable-exports': 'off',
'import/no-named-as-default': 'off',
'import/newline-after-import': 'off',
'import/no-named-as-default-member': 'off',
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
'unused-imports/no-unused-imports': 'off',
'unused-imports/no-unused-vars': 'off',
},
},
{
files: [
'**/*.md',
'**/*.md/*.*',
'**/demo.vue',
'**/demo.client.vue',
'scripts/*.ts',
'**/*.test.ts',
'**/utils.ts',
],
rules: {
'no-alert': 'off',
'no-console': 'off',
'no-undef': 'off',
'no-unused-vars': 'off',
'no-restricted-imports': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-redeclare': 'off',
'@typescript-eslint/no-invalid-this': 'off',
'unused-imports/no-unused-vars': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-this-alias': [
'error',
{
allowedNames: ['self', 'instance'],
},
],
},
},
{
files: ['docs/.vitepress/**/*.*'],
rules: {
'no-restricted-imports': 'off',
},
},
{
files: ['docs/.vitepress/theme/plugins/**/*.*'],
rules: {
'prefer-rest-params': 'off',
},
},
];