chore: configure oxlint with strict rule set

This commit is contained in:
2026-06-21 01:41:39 +02:00
committed by Milas Holsting
parent 4c5d52dfee
commit 8219e83135

View File

@@ -1,15 +1,121 @@
{ {
"$schema": "./node_modules/oxlint/configuration_schema.json", "$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["typescript", "unicorn", "oxc"], "plugins": ["eslint", "import", "typescript", "unicorn", "oxc", "promise", "node"],
"categories": { "categories": {
"correctness": "error" "correctness": "error",
"nursery": "error",
"pedantic": "error",
"perf": "error",
"restriction": "off",
"style": "error",
"suspicious": "error"
}, },
"options": {
"denyWarnings": true,
"maxWarnings": 0,
"reportUnusedDisableDirectives": "error",
"respectEslintDisableDirectives": true,
"typeAware": true,
"typeCheck": true
},
"ignorePatterns": ["dist/**", "node_modules/**", "static/assets/**"],
"env": { "browser": true, "builtin": true, "es2026": true, "node": true },
"rules": { "rules": {
"typescript/unbound-method": "off", "import/exports-last": "off",
"typescript/no-base-to-string": "off", "import/group-exports": "off",
"typescript/no-floating-promises": "off" "import/no-default-export": "off",
"import/no-mutable-exports": "error",
"import/no-named-export": "off",
"import/no-named-default": "error",
"import/no-self-import": "error",
"import/no-unassigned-import": "off",
"import/no-relative-parent-imports": "off",
"capitalized-comments": "off",
"curly": "error",
"id-length": "off",
"max-lines": "off",
"max-lines-per-function": "off",
"max-statements": "off",
"no-console": "error",
"no-debugger": "error",
"no-empty-function": "error",
"no-eval": "error",
"no-implicit-coercion": "error",
"no-magic-numbers": "off",
"no-negated-condition": "off",
"no-param-reassign": "error",
"no-plusplus": "off",
"no-process-exit": "error",
"no-restricted-globals": [
"error",
{ "name": "event", "message": "Use the event parameter instead of the legacy global." },
{ "name": "name", "message": "Avoid the ambiguous window.name global." }
],
"no-ternary": "off",
"no-undefined": "off",
"no-use-before-define": "off",
"no-warning-comments": "warn",
"oxc/no-async-await": "off",
"oxc/no-barrel-file": "off",
"oxc/no-optional-chaining": "off",
"oxc/no-rest-spread-properties": "off",
"sort-imports": "off",
"sort-keys": "off",
"typescript/array-type": ["error", { "default": "array-simple" }],
"typescript/consistent-type-definitions": ["error", "type"],
"typescript/consistent-type-exports": "error",
"typescript/consistent-type-imports": [
"error",
{ "disallowTypeAnnotations": false, "fixStyle": "separate-type-imports", "prefer": "type-imports" }
],
"typescript/explicit-function-return-type": "off",
"typescript/explicit-member-accessibility": "error",
"typescript/explicit-module-boundary-types": "off",
"typescript/no-base-to-string": "error",
"typescript/no-confusing-non-null-assertion": "error",
"typescript/no-explicit-any": "error",
"typescript/no-floating-promises": "error",
"typescript/no-inferrable-types": "error",
"typescript/no-invalid-void-type": "error",
"typescript/no-misused-promises": "error",
"typescript/no-non-null-assertion": "error",
"typescript/no-unsafe-type-assertion": "off",
"typescript/no-unnecessary-condition": "error",
"typescript/no-unsafe-argument": "error",
"typescript/no-unsafe-assignment": "error",
"typescript/no-unsafe-call": "error",
"typescript/no-unsafe-member-access": "error",
"typescript/no-unsafe-return": "error",
"typescript/no-var-requires": "error",
"typescript/prefer-readonly": "error",
"typescript/prefer-readonly-parameter-types": "off",
"typescript/require-await": "error",
"typescript/restrict-plus-operands": "error",
"typescript/restrict-template-expressions": "error",
"typescript/strict-boolean-expressions": "error",
"typescript/strict-void-return": "off",
"typescript/switch-exhaustiveness-check": "error",
"typescript/unbound-method": "error",
"unicorn/filename-case": "off",
"unicorn/no-array-for-each": "off",
"unicorn/no-array-reduce": "off",
"unicorn/no-null": "off",
"unicorn/no-useless-undefined": "off",
"unicorn/prefer-global-this": "off",
"unicorn/prefer-module": "error",
"unicorn/prefer-query-selector": "error",
"unicorn/prefer-string-replace-all": "error"
}, },
"env": { "overrides": [
"builtin": true {
"files": ["**/*.test.ts", "**/*.spec.ts"],
"env": { "vitest": true },
"rules": { "typescript/no-explicit-any": "off" }
},
{
"files": ["scripts/**/*.ts"],
"env": { "browser": false, "node": true },
"rules": { "no-console": "off", "no-process-exit": "off", "unicorn/prefer-top-level-await": "off" }
} }
]
} }