Merge branch 'fork/LayHuts/fix/lint-format'

This commit is contained in:
金毛88
2026-08-07 05:09:58 +08:00
3 changed files with 7 additions and 4 deletions

View File

@@ -28,6 +28,8 @@ const javascript: OxlintConfig = {
'default-case-last': 'error',
eqeqeq: ['error', 'always'],
'eslint/no-unreachable': 'error',
// 抛出嵌套三元运算格式错误,禁止使用嵌套三元运算。
'no-nested-ternary': 'error',
'new-cap': [
'error',
{

View File

@@ -43,7 +43,8 @@ const unicorn: OxlintConfig = {
'unicorn/no-magic-array-flat-depth': 'error',
'unicorn/no-negated-condition': 'error',
'unicorn/no-negation-in-equality-check': 'error',
'unicorn/no-nested-ternary': 'error',
// 禁止通过“添加括号”自动修复嵌套三元运算
'unicorn/no-nested-ternary': 'off',
'unicorn/no-new-array': 'error',
'unicorn/no-new-buffer': 'error',
'unicorn/no-object-as-default-parameter': 'error',

View File

@@ -112,17 +112,17 @@ async function runLint({ format, threads }: LintCommandOptions) {
if (format) {
await runSerial([
['stylelint', ['**/*.{vue,css,less,scss}', '--cache', '--fix']],
['oxfmt', [threadsArg]],
['oxlint', ['--fix', '--type-aware', threadsArg]],
['oxfmt', [threadsArg]],
['eslint', ['.', '--cache', '--fix']],
['stylelint', ['**/*.{vue,css,less,scss}', '--cache', '--fix']],
]);
return;
}
const commands: Command[] = [
['oxfmt', ['--check', threadsArg]],
['oxlint', ['--type-aware', threadsArg]],
['oxfmt', ['--check', threadsArg]],
['eslint', ['.', '--cache']],
['stylelint', ['**/*.{vue,css,less,scss}', '--cache']],
];