-
Notifications
You must be signed in to change notification settings - Fork 30
Expand file tree
/
Copy patheslint.config.js
More file actions
39 lines (37 loc) · 1.09 KB
/
Copy patheslint.config.js
File metadata and controls
39 lines (37 loc) · 1.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
import antfu from '@antfu/eslint-config';
import unocss from '@unocss/eslint-config/flat';
// Globals generated by unplugin-auto-import at build time.
// If this file doesn't exist yet, run `pnpm build` once first.
let autoImportGlobals = {};
try {
const mod = await import('./.eslintrc-auto-import.json', { with: { type: 'json' } });
autoImportGlobals = mod.default.globals ?? {};
}
catch {
// file not generated yet — first build will create it
}
export default antfu(
{
typescript: true,
vue: true,
},
unocss,
{
languageOptions: {
globals: autoImportGlobals,
},
rules: {
'curly': ['error', 'all'],
'style/semi': ['error', 'always'],
'@typescript-eslint/no-use-before-define': ['error', { allowNamedExports: true, functions: false }],
'vue/no-empty-component-block': ['error'],
'no-restricted-imports': ['error', {
paths: [{
name: '@vueuse/core',
importNames: ['useClipboard'],
message: 'Please use local useCopy from src/composable/copy.ts instead of useClipboard.',
}],
}],
},
},
);