2023-12-14 14:28:02 +08:00
|
|
|
// eslint.config.js
|
|
|
|
import antfu from '@antfu/eslint-config';
|
|
|
|
|
|
|
|
export default await antfu({
|
2024-01-12 12:43:57 +08:00
|
|
|
files: ['**/*.js', '**/*.jsx', '**/*.vue', '**/*.ts'],
|
|
|
|
// TODO: 使用 ignore 代替 cli 命令中的配置
|
2023-12-14 14:28:02 +08:00
|
|
|
stylistic: {
|
2024-01-12 12:43:57 +08:00
|
|
|
indent: 4,
|
|
|
|
quotes: 'single',
|
2023-12-14 14:28:02 +08:00
|
|
|
semi: 'always',
|
|
|
|
},
|
|
|
|
typescript: true,
|
|
|
|
vue: true,
|
|
|
|
rules: {
|
2024-01-12 12:43:57 +08:00
|
|
|
'curly': ['error', 'multi-line'],
|
2023-12-14 14:28:02 +08:00
|
|
|
'vue/block-order': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
order: ['template', 'script', 'style'],
|
|
|
|
},
|
|
|
|
],
|
2024-01-12 12:43:57 +08:00
|
|
|
'style/member-delimiter-style': [
|
|
|
|
'error',
|
|
|
|
{
|
|
|
|
multiline: {
|
|
|
|
delimiter: 'semi',
|
|
|
|
requireLast: true,
|
|
|
|
},
|
|
|
|
singleline: {
|
|
|
|
delimiter: 'semi',
|
|
|
|
requireLast: false,
|
|
|
|
},
|
|
|
|
multilineDetection: 'brackets',
|
|
|
|
},
|
|
|
|
],
|
2023-12-14 14:28:02 +08:00
|
|
|
},
|
|
|
|
});
|