forked from vueuse/vueuse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.js
119 lines (117 loc) · 2.58 KB
/
eslint.config.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
import { resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import antfu from '@antfu/eslint-config'
const dir = fileURLToPath(new URL('.', import.meta.url))
const restricted = [
'vue',
'@vue/reactivity',
'@vue/runtime-core',
'@vue/runtime-dom',
'@vue/composition-api',
'..',
'../..',
resolve(dir, 'packages/core/index.ts'),
resolve(dir, 'packages/shared/index.ts'),
{
name: 'vue-demi',
importNames: ['onMounted', 'onUnmounted', 'unref', 'toRef'],
},
]
export default antfu(
{
formatters: true,
ignores: [
'patches',
'playgrounds',
'**/types',
'**/cache',
'**/dist',
'**/.temp',
'**/*.svg',
],
},
{
rules: {
'vue/no-deprecated-functional-template': 'off',
'vue/one-component-per-file': 'off',
'vue/no-template-shadow': 'off',
'vue/require-prop-types': 'off',
'spaced-comment': ['error', 'always', { exceptions: ['#__PURE__'] }],
'no-restricted-imports': [
'error',
{
paths: restricted,
},
],
'ts/ban-types': 'off',
'node/no-callback-literal': 'off',
'import/namespace': 'off',
'import/default': 'off',
'import/no-named-as-default': 'off',
'import/no-named-as-default-member': 'off',
'node/prefer-global/process': 'off',
'ts/unified-signatures': 'off',
'ts/no-unsafe-function-type': 'off',
'ts/no-dynamic-delete': 'off',
},
},
{
files: [
'packages/shared/**/*.ts',
],
rules: {
'no-restricted-imports': ['error', {
paths: [
...restricted,
'@vueuse/shared',
],
}],
},
},
{
files: [
'packages/core/**/index.ts',
],
rules: {
'no-restricted-imports': ['error', {
paths: [
...restricted,
'@vueuse/core',
],
}],
},
},
{
files: [
'**/*.md',
'**/*.md/*.[jt]s',
'**/*.md/*.vue',
'**/demo.vue',
'**/demo.client.vue',
'**/*.test.ts',
'scripts/*.ts',
],
rules: {
'no-alert': 'off',
'no-console': 'off',
'no-undef': 'off',
'no-unused-vars': 'off',
'no-restricted-imports': 'off',
'vue/no-unused-vars': 'off',
'vue/no-unused-refs': 'off',
'vue/require-v-for-key': 'off',
'ts/no-unused-vars': 'off',
'ts/no-redeclare': 'off',
'unused-imports/no-unused-vars': 'off',
},
},
{
files: [
'packages/.vitepress/**/*.vue',
'playgrounds/**/*.vue',
],
rules: {
'no-restricted-imports': 'off',
},
},
)