All checks were successful
Build Server / Compile DLL (push) Successful in 1m25s
- 在 VSCode 配置中禁用默认格式化工具并使用 ESLint 进行自动修复和代码验证。 - 添加和更新包依赖以增强代码格式化功能。 - 添加新的eslint配置文件以启用antfu规则集并自定义特定代码规范。 - 新增eslint修复脚本和格式化插件,并调整typescript为peer依赖。 - 通过优化导入语法和字符串处理方式,增强代码可读性和性能。
30 lines
894 B
TypeScript
30 lines
894 B
TypeScript
import antfu from '@antfu/eslint-config'
|
|
|
|
export default antfu({
|
|
lessOpinionated: true,
|
|
stylistic: true,
|
|
typescript: true,
|
|
formatters: true,
|
|
ignores: [
|
|
'**/node_modules',
|
|
'**/dist',
|
|
],
|
|
}, {
|
|
rules: {
|
|
'eslint-comments/no-unlimited-disable': ['off'],
|
|
'no-console': ['warn'],
|
|
'no-restricted-syntax': ['error', {
|
|
selector: 'CallExpression[callee.property.name=\'forEach\'] > :matches(ArrowFunctionExpression, FunctionExpression)[async=true].arguments',
|
|
message: 'Do not use async functions in .forEach()',
|
|
}],
|
|
'perfectionist/sort-imports': ['error', {
|
|
tsconfigRootDir: '.',
|
|
}],
|
|
'ts/consistent-type-definitions': ['off'],
|
|
'ts/no-empty-object-type': ['off'],
|
|
'style/max-statements-per-line': ['error', { max: 2 }],
|
|
'style/brace-style': ['error', '1tbs', { allowSingleLine: true }],
|
|
'antfu/if-newline': 'off',
|
|
},
|
|
})
|