dev: replace eslint with biome
This commit is contained in:
parent
e656ee880d
commit
93d225d4d8
7 changed files with 400 additions and 2784 deletions
396
biome.json
396
biome.json
|
@ -1,28 +1,400 @@
|
|||
{
|
||||
"$schema": "https://biomejs.dev/schemas/1.8.2/schema.json",
|
||||
"organizeImports": {
|
||||
"enabled": false
|
||||
},
|
||||
"organizeImports": { "enabled": false },
|
||||
"linter": {
|
||||
"enabled": true,
|
||||
"rules": {
|
||||
"recommended": true,
|
||||
"recommended": false,
|
||||
"complexity": {
|
||||
"noBannedTypes": "error",
|
||||
"noExtraBooleanCast": "error",
|
||||
"noMultipleSpacesInRegularExpressionLiterals": "error",
|
||||
"noUselessCatch": "error",
|
||||
"noUselessConstructor": "off",
|
||||
"noUselessLoneBlockStatements": "error",
|
||||
"noUselessRename": "error",
|
||||
"noUselessTernary": "error",
|
||||
"noUselessThisAlias": "error",
|
||||
"noUselessTypeConstraint": "error",
|
||||
"noVoid": "error",
|
||||
"noWith": "error",
|
||||
"useLiteralKeys": "error",
|
||||
"useRegexLiterals": "error"
|
||||
},
|
||||
"correctness": {
|
||||
"noConstAssign": "error",
|
||||
"noConstantCondition": "error",
|
||||
"noEmptyCharacterClassInRegex": "error",
|
||||
"noEmptyPattern": "error",
|
||||
"noGlobalObjectCalls": "error",
|
||||
"noInvalidConstructorSuper": "error",
|
||||
"noInvalidUseBeforeDeclaration": "error",
|
||||
"noNewSymbol": "error",
|
||||
"noPrecisionLoss": "error",
|
||||
"noSelfAssign": "error",
|
||||
"noSwitchDeclarations": "error",
|
||||
"noUndeclaredVariables": "error",
|
||||
"noUnreachable": "error",
|
||||
"noUnreachableSuper": "error",
|
||||
"noUnsafeFinally": "error",
|
||||
"noUnusedVariables": "off",
|
||||
"useArrayLiterals": "off",
|
||||
"useIsNan": "error"
|
||||
},
|
||||
"security": { "noGlobalEval": "error" },
|
||||
"style": {
|
||||
"noUselessElse": "off"
|
||||
"noCommaOperator": "error",
|
||||
"noInferrableTypes": "error",
|
||||
"noNamespace": "error",
|
||||
"noNonNullAssertion": "warn",
|
||||
"noUselessElse": "off",
|
||||
"noVar": "error",
|
||||
"useAsConstAssertion": "error",
|
||||
"useBlockStatements": "off",
|
||||
"useConst": "error",
|
||||
"useImportType": "error",
|
||||
"useSingleVarDeclarator": "warn"
|
||||
},
|
||||
"suspicious": {
|
||||
"noAssignInExpressions": "error",
|
||||
"noAsyncPromiseExecutor": "error",
|
||||
"noCatchAssign": "error",
|
||||
"noClassAssign": "error",
|
||||
"noCompareNegZero": "error",
|
||||
"noConfusingLabels": "off",
|
||||
"noConsoleLog": "warn",
|
||||
"noControlCharactersInRegex": "error",
|
||||
"noDebugger": "warn",
|
||||
"noDoubleEquals": "error",
|
||||
"noDuplicateCase": "error",
|
||||
"noDuplicateClassMembers": "error",
|
||||
"noDuplicateObjectKeys": "error",
|
||||
"noDuplicateParameters": "error",
|
||||
"noEmptyBlockStatements": "error",
|
||||
"noEmptyInterface": "error",
|
||||
"noExplicitAny": "warn",
|
||||
"noExtraNonNullAssertion": "error",
|
||||
"noFallthroughSwitchClause": "error",
|
||||
"noFunctionAssign": "error",
|
||||
"noGlobalAssign": "error",
|
||||
"noImportAssign": "error",
|
||||
"noMisleadingCharacterClass": "error",
|
||||
"noMisleadingInstantiator": "error",
|
||||
"noPrototypeBuiltins": "off",
|
||||
"noRedeclare": "error",
|
||||
"noSelfCompare": "error",
|
||||
"noShadowRestrictedNames": "error",
|
||||
"noUnsafeNegation": "error",
|
||||
"useAwait": "off",
|
||||
"useDefaultSwitchClauseLast": "error",
|
||||
"useNamespaceKeyword": "error",
|
||||
"useValidTypeof": "error"
|
||||
}
|
||||
}
|
||||
},
|
||||
"ignore": [
|
||||
"**/*.json5",
|
||||
"**/*.min.*",
|
||||
"**/dist",
|
||||
"**/LICENSE*",
|
||||
"**/output",
|
||||
"**/coverage",
|
||||
"**/public",
|
||||
"**/temp",
|
||||
"**/packages-lock.json",
|
||||
"**/pnpm-lock.yaml",
|
||||
"**/yarn.lock",
|
||||
"**/__snapshots__"
|
||||
]
|
||||
},
|
||||
"javascript": {
|
||||
"globals": [
|
||||
"jest",
|
||||
"withDefaults",
|
||||
"$computed",
|
||||
"$shallowRef",
|
||||
"defineExpose",
|
||||
"$toRef",
|
||||
"h",
|
||||
"$customRef",
|
||||
"navigator",
|
||||
"window",
|
||||
"defineEmits",
|
||||
"$ref",
|
||||
"defineProps",
|
||||
"document"
|
||||
]
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"include": ["*.vue", "packages/client/*.ts"],
|
||||
"include": ["**/__tests__/*.{j,t}s?(x)", "**/*.spec.{j,t}s?(x)"],
|
||||
"linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } }
|
||||
},
|
||||
{
|
||||
"include": ["*.vue"],
|
||||
"linter": { "rules": { "correctness": { "noUnusedVariables": "off" } } }
|
||||
},
|
||||
{
|
||||
"include": ["**/__tests__/*.{j,t}s?(x)", "**/*.spec.{j,t}s?(x)"],
|
||||
"linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } }
|
||||
},
|
||||
{ "include": ["*.vue"], "linter": { "rules": {} } },
|
||||
{ "include": ["*.json", "*.json5"], "linter": { "rules": {} } },
|
||||
{ "include": ["*.yaml", "*.yml"], "linter": { "rules": {} } },
|
||||
{ "include": ["package.json"], "linter": { "rules": {} } },
|
||||
{ "include": ["*.d.ts"], "linter": { "rules": {} } },
|
||||
{ "include": ["*.js"] },
|
||||
{
|
||||
"include": ["scripts/**/*.*", "cli.*"],
|
||||
"linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } }
|
||||
},
|
||||
{
|
||||
"include": ["*.test.ts", "*.test.js", "*.spec.ts", "*.spec.js"],
|
||||
"linter": { "rules": {} }
|
||||
},
|
||||
{
|
||||
"include": ["**/*.md/*.*"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"correctness": {
|
||||
"noUndeclaredVariables": "off",
|
||||
"noUnusedVariables": "off"
|
||||
},
|
||||
"suspicious": { "noConsoleLog": "off" }
|
||||
}
|
||||
}
|
||||
},
|
||||
{ "include": ["*.js"], "linter": { "rules": {} } },
|
||||
{
|
||||
"include": ["**/*.md/*.*"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"correctness": {
|
||||
"noInvalidUseBeforeDeclaration": "off",
|
||||
"noUnusedVariables": "off"
|
||||
},
|
||||
"suspicious": { "noRedeclare": "off" }
|
||||
}
|
||||
}
|
||||
},
|
||||
{ "include": ["*.json", "*.json5"], "linter": { "rules": {} } },
|
||||
{ "include": ["*.yaml", "*.yml"], "linter": { "rules": {} } },
|
||||
{ "include": ["package.json"], "linter": { "rules": {} } },
|
||||
{ "include": ["*.d.ts"], "linter": { "rules": {} } },
|
||||
{ "include": ["*.js"] },
|
||||
{
|
||||
"include": ["scripts/**/*.*", "cli.*"],
|
||||
"linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } }
|
||||
},
|
||||
{
|
||||
"include": ["*.test.ts", "*.test.js", "*.spec.ts", "*.spec.js"],
|
||||
"linter": { "rules": {} }
|
||||
},
|
||||
{
|
||||
"include": ["**/*.md/*.*"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"correctness": {
|
||||
"noUndeclaredVariables": "off",
|
||||
"noUnusedVariables": "off"
|
||||
},
|
||||
"suspicious": { "noConsoleLog": "off" }
|
||||
}
|
||||
}
|
||||
},
|
||||
{ "include": ["*.js"], "linter": { "rules": {} } },
|
||||
{
|
||||
"include": ["**/*.md/*.*"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"correctness": {
|
||||
"noInvalidUseBeforeDeclaration": "off",
|
||||
"noUnusedVariables": "off"
|
||||
},
|
||||
"suspicious": { "noRedeclare": "off" }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"correctness": {
|
||||
"noConstAssign": "off",
|
||||
"noGlobalObjectCalls": "off",
|
||||
"noInvalidConstructorSuper": "off",
|
||||
"noNewSymbol": "off",
|
||||
"noSetterReturn": "off",
|
||||
"noUndeclaredVariables": "off",
|
||||
"noUnreachable": "off",
|
||||
"noUnreachableSuper": "off"
|
||||
},
|
||||
"style": {
|
||||
"useImportType": "warn",
|
||||
"useShorthandFunctionType": "warn",
|
||||
"useTemplate": "warn",
|
||||
"noNonNullAssertion": "off",
|
||||
"useNodejsImportProtocol": "off"
|
||||
"noArguments": "error",
|
||||
"noVar": "error",
|
||||
"useConst": "error"
|
||||
},
|
||||
"suspicious": {
|
||||
"noDuplicateClassMembers": "off",
|
||||
"noDuplicateObjectKeys": "off",
|
||||
"noDuplicateParameters": "off",
|
||||
"noFunctionAssign": "off",
|
||||
"noImportAssign": "off",
|
||||
"noRedeclare": "off",
|
||||
"noUnsafeNegation": "off",
|
||||
"useGetterReturn": "off",
|
||||
"useValidTypeof": "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{ "include": ["*.json", "*.json5"], "linter": { "rules": {} } },
|
||||
{ "include": ["*.yaml", "*.yml"], "linter": { "rules": {} } },
|
||||
{ "include": ["package.json"], "linter": { "rules": {} } },
|
||||
{ "include": ["*.d.ts"], "linter": { "rules": {} } },
|
||||
{ "include": ["*.js"], "linter": { "rules": {} } },
|
||||
{
|
||||
"include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
|
||||
"linter": { "rules": { "complexity": { "noVoid": "error" } } }
|
||||
},
|
||||
{
|
||||
"include": ["script/**/*.*", "scripts/**/*.*", "cli.*"],
|
||||
"linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } }
|
||||
},
|
||||
{
|
||||
"include": ["*.test.ts", "*.test.js", "*.spec.ts", "*.spec.js"],
|
||||
"linter": { "rules": {} }
|
||||
},
|
||||
{
|
||||
"include": ["**/*.md/*.*"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"correctness": {
|
||||
"noInvalidUseBeforeDeclaration": "off",
|
||||
"noUndeclaredVariables": "off",
|
||||
"noUnusedVariables": "off"
|
||||
},
|
||||
"style": { "useImportType": "off" },
|
||||
"suspicious": { "noConsoleLog": "off", "noRedeclare": "off" }
|
||||
}
|
||||
}
|
||||
},
|
||||
{ "include": ["*.json", "*.json5"], "linter": { "rules": {} } },
|
||||
{ "include": ["*.yaml", "*.yml"], "linter": { "rules": {} } },
|
||||
{ "include": ["package.json"], "linter": { "rules": {} } },
|
||||
{ "include": ["*.d.ts"], "linter": { "rules": {} } },
|
||||
{ "include": ["*.js"], "linter": { "rules": {} } },
|
||||
{
|
||||
"include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
|
||||
"linter": { "rules": { "complexity": { "noVoid": "error" } } }
|
||||
},
|
||||
{
|
||||
"include": ["script/**/*.*", "scripts/**/*.*", "cli.*"],
|
||||
"linter": { "rules": { "suspicious": { "noConsoleLog": "off" } } }
|
||||
},
|
||||
{
|
||||
"include": ["*.test.ts", "*.test.js", "*.spec.ts", "*.spec.js"],
|
||||
"linter": { "rules": {} }
|
||||
},
|
||||
{
|
||||
"include": ["**/*.md/*.*"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"correctness": {
|
||||
"noInvalidUseBeforeDeclaration": "off",
|
||||
"noUndeclaredVariables": "off",
|
||||
"noUnusedVariables": "off"
|
||||
},
|
||||
"style": { "useImportType": "off" },
|
||||
"suspicious": { "noConsoleLog": "off", "noRedeclare": "off" }
|
||||
}
|
||||
}
|
||||
},
|
||||
{ "include": ["*.md"] },
|
||||
{
|
||||
"include": ["**/*.md/**"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"correctness": {
|
||||
"noUndeclaredVariables": "off",
|
||||
"noUnusedVariables": "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"correctness": {
|
||||
"noConstAssign": "off",
|
||||
"noGlobalObjectCalls": "off",
|
||||
"noInvalidConstructorSuper": "off",
|
||||
"noNewSymbol": "off",
|
||||
"noSetterReturn": "off",
|
||||
"noUndeclaredVariables": "off",
|
||||
"noUnreachable": "off",
|
||||
"noUnreachableSuper": "off"
|
||||
},
|
||||
"style": {
|
||||
"noArguments": "error",
|
||||
"noVar": "error",
|
||||
"useConst": "error"
|
||||
},
|
||||
"suspicious": {
|
||||
"noDuplicateClassMembers": "off",
|
||||
"noDuplicateObjectKeys": "off",
|
||||
"noDuplicateParameters": "off",
|
||||
"noFunctionAssign": "off",
|
||||
"noImportAssign": "off",
|
||||
"noRedeclare": "off",
|
||||
"noUnsafeNegation": "off",
|
||||
"useGetterReturn": "off",
|
||||
"useValidTypeof": "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{ "include": ["*.md"] },
|
||||
{
|
||||
"include": ["**/*.md/**"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"correctness": {
|
||||
"noUndeclaredVariables": "off",
|
||||
"noUnusedVariables": "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
|
||||
"linter": {
|
||||
"rules": {
|
||||
"correctness": {
|
||||
"noConstAssign": "off",
|
||||
"noGlobalObjectCalls": "off",
|
||||
"noInvalidConstructorSuper": "off",
|
||||
"noNewSymbol": "off",
|
||||
"noSetterReturn": "off",
|
||||
"noUndeclaredVariables": "off",
|
||||
"noUnreachable": "off",
|
||||
"noUnreachableSuper": "off"
|
||||
},
|
||||
"style": {
|
||||
"noArguments": "error",
|
||||
"noVar": "error",
|
||||
"useConst": "error"
|
||||
},
|
||||
"suspicious": {
|
||||
"noDuplicateClassMembers": "off",
|
||||
"noDuplicateObjectKeys": "off",
|
||||
"noDuplicateParameters": "off",
|
||||
"noFunctionAssign": "off",
|
||||
"noImportAssign": "off",
|
||||
"noRedeclare": "off",
|
||||
"noUnsafeNegation": "off",
|
||||
"useGetterReturn": "off",
|
||||
"useValidTypeof": "off"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
"dev": "pnpm node ./scripts/dev.mjs",
|
||||
"dev:staging": "NODE_OPTIONS=--max_old_space_size=3072 NODE_ENV=development pnpm run build && pnpm run start",
|
||||
"lint": "pnpm run lint:ts; pnpm run lint:rs",
|
||||
"lint:ts": "pnpm --filter !firefish-js -r --parallel run lint",
|
||||
"lint:ts": "pnpm --filter !firefish-js --recursive run lint ; pnpm run format:ts",
|
||||
"lint:rs": "cargo clippy --fix --allow-dirty --allow-staged && cargo fmt --all --",
|
||||
"debug": "pnpm run build:debug && pnpm run start",
|
||||
"mocha": "pnpm --filter backend run mocha",
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"build": "pnpm tsc --project tsconfig.json ; pnpm tsc-alias --project tsconfig.json",
|
||||
"build:debug": "pnpm tsc --sourceMap --project tsconfig.json ; pnpm tsc-alias --project tsconfig.json",
|
||||
"watch": "pnpm tsc --project tsconfig.json --watch ; pnpm tsc-alias --project tsconfig.json --watch",
|
||||
"lint": "pnpm biome check --apply **/*.ts ; pnpm run format",
|
||||
"lint": "pnpm biome check --write **/*.ts",
|
||||
"mocha": "cross-env NODE_ENV=test TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha",
|
||||
"test": "pnpm run mocha",
|
||||
"format": "pnpm biome format * --write"
|
||||
|
@ -161,7 +161,6 @@
|
|||
"@types/websocket": "1.0.10",
|
||||
"@types/ws": "8.5.10",
|
||||
"cross-env": "7.0.3",
|
||||
"eslint": "9.6.0",
|
||||
"mocha": "10.5.2",
|
||||
"pug": "3.0.3",
|
||||
"strict-event-emitter-types": "2.0.0",
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
{
|
||||
"extends": ["@eslint-sets/vue3", "@eslint-sets/vue3-ts"],
|
||||
"plugins": ["file-progress"],
|
||||
"ignorePatterns": ["**/*.json5"],
|
||||
"rules": {
|
||||
"file-progress/activate": 1,
|
||||
"prettier/prettier": "off",
|
||||
"one-var": ["warn", "never"],
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
"warn",
|
||||
{
|
||||
"argsIgnorePattern": "^_",
|
||||
"varsIgnorePattern": "^_",
|
||||
"caughtErrorsIgnorePattern": "^_",
|
||||
"destructuredArrayIgnorePattern": "^_"
|
||||
}
|
||||
],
|
||||
"vue/no-setup-props-destructure": "off"
|
||||
}
|
||||
}
|
|
@ -6,14 +6,13 @@
|
|||
"watch": "pnpm vite build --watch --mode development",
|
||||
"build": "pnpm vite build",
|
||||
"build:debug": "pnpm run build",
|
||||
"lint": "pnpm biome check **/*.ts --write ; pnpm run lint:vue",
|
||||
"lint:vue": "pnpm eslint src --fix '**/*.vue' --cache ; pnpm run format",
|
||||
"lint": "pnpm run lint:ts ; pnpm run lint:vue",
|
||||
"lint:ts": "pnpm biome check **/*.ts --write",
|
||||
"lint:vue": "pnpm biome check **/*.vue --write",
|
||||
"types:check": "pnpm vue-tsc --noEmit",
|
||||
"format": "pnpm biome format * --write"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint-sets/eslint-config-vue3": "5.13.0",
|
||||
"@eslint-sets/eslint-config-vue3-ts": "3.3.0",
|
||||
"@phosphor-icons/web": "2.1.1",
|
||||
"@rollup/plugin-alias": "5.1.0",
|
||||
"@rollup/plugin-json": "6.1.0",
|
||||
|
@ -49,7 +48,6 @@
|
|||
"cropperjs": "2.0.0-rc.0",
|
||||
"date-fns": "3.6.0",
|
||||
"emojilib": "3.0.12",
|
||||
"eslint-plugin-file-progress": "1.4.0",
|
||||
"eventemitter3": "5.0.1",
|
||||
"fast-blurhash": "1.1.2",
|
||||
"firefish-js": "workspace:*",
|
||||
|
|
|
@ -56,15 +56,7 @@
|
|||
"@types/parse-link-header": "^2.0.0",
|
||||
"@types/uuid": "^9.0.0",
|
||||
"@types/node": "18.11.18",
|
||||
"@typescript-eslint/eslint-plugin": "^5.49.0",
|
||||
"@typescript-eslint/parser": "^5.49.0",
|
||||
"@types/async-lock": "1.4.0",
|
||||
"eslint": "^8.32.0",
|
||||
"eslint-config-standard": "^16.0.3",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-node": "^11.0.0",
|
||||
"eslint-plugin-promise": "^6.1.1",
|
||||
"eslint-plugin-standard": "^5.0.0",
|
||||
"jest": "^29.4.0",
|
||||
"jest-worker": "^29.4.0",
|
||||
"lodash": "^4.17.14",
|
||||
|
|
2747
pnpm-lock.yaml
2747
pnpm-lock.yaml
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue