Files
grimmory/frontend/.oxlintrc.json
T

262 lines
9.3 KiB
JSON

{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": [
"typescript",
"unicorn",
"vitest",
"oxc"
],
"jsPlugins": [
{
"name": "anti-slop",
"specifier": "./tools/oxlint/anti-slop/index.ts"
}
],
"categories": {
"correctness": "off"
},
"options": {
"typeAware": true
},
"ignorePatterns": [
"src/assets/**"
],
"rules": {
"anti-slop/no-chained-type-assertions": "error",
"anti-slop/no-known-value-widening": "error",
"anti-slop/no-module-mocking": "error",
"anti-slop/no-object-parameters": "error",
"anti-slop/no-reduce-accumulator-copy": "error",
"anti-slop/no-reflect-apply": "error",
"anti-slop/no-reflect-get": "error",
"anti-slop/no-unknown-parameters": "error",
"anti-slop/no-unknown-returns": "error",
"anti-slop/no-unknown-type-aliases": "error",
"anti-slop/no-unsafe-dictionary-type": "error",
"anti-slop/no-widen-then-assert": "error",
"anti-slop/require-safety-comment-for-lint-disable": "error",
"anti-slop/require-safety-comment-for-type-assertion": "error",
"typescript/no-misused-spread": "error",
"typescript/no-unnecessary-condition": "error",
"typescript/no-useless-default-assignment": "error",
"typescript/require-array-sort-compare": "error",
"unicorn/no-new-array": "error",
"unicorn/no-useless-spread": "error",
"typescript/await-thenable": "error",
"typescript/no-array-delete": "error",
"typescript/no-base-to-string": "error",
"typescript/no-deprecated": "error",
"typescript/no-duplicate-type-constituents": "error",
"typescript/no-floating-promises": [
"error",
{
"allowForKnownSafeCalls": [
{
"from": "package",
"package": "@angular/router",
"name": [
"navigate",
"navigateByUrl"
]
}
]
}
],
"typescript/no-for-in-array": "error",
"typescript/no-implied-eval": "error",
"typescript/no-misused-promises": "error",
"typescript/no-redundant-type-constituents": "error",
"typescript/no-unnecessary-type-assertion": "error",
"typescript/no-unnecessary-type-parameters": "error",
"typescript/no-unsafe-argument": "error",
"typescript/no-unsafe-assignment": "error",
"typescript/no-unsafe-call": "error",
"typescript/no-unsafe-enum-comparison": "error",
"typescript/no-unsafe-member-access": "error",
"typescript/no-unsafe-return": "error",
"typescript/no-unsafe-unary-minus": "error",
"typescript/only-throw-error": "error",
"typescript/prefer-promise-reject-errors": "error",
"typescript/require-await": "error",
"typescript/restrict-plus-operands": "error",
"typescript/restrict-template-expressions": "error",
"typescript/use-unknown-in-catch-callback-variable": "error",
"typescript/consistent-type-exports": "error",
"typescript/dot-notation": [
"error",
{
"allowPrivateClassPropertyAccess": true,
"allowProtectedClassPropertyAccess": true
}
],
"typescript/no-generated-empty-object-type": "error",
"typescript/no-meaningless-void-operator": "error",
"typescript/no-mixed-enums": "error",
"typescript/no-unnecessary-qualifier": "error",
"typescript/no-unnecessary-template-expression": "error",
"typescript/prefer-find": "error",
"typescript/prefer-includes": "error",
"typescript/prefer-nullish-coalescing": [
"error",
{
"ignorePrimitives": true
}
],
"typescript/prefer-optional-chain": "error",
"typescript/prefer-readonly": "error",
"typescript/prefer-reduce-type-parameter": "error",
"typescript/prefer-return-this-type": "error",
"typescript/prefer-string-starts-ends-with": "error",
"typescript/related-getter-setter-pairs": "error",
"typescript/return-await": "error",
"typescript/switch-exhaustiveness-check": [
"error",
{
"considerDefaultExhaustiveForUnions": true
}
],
"vitest/no-conditional-tests": "error",
"vitest/no-focused-tests": "error",
"vitest/no-identical-title": "error",
"vitest/no-standalone-expect": "error",
"vitest/valid-expect": "error",
"vitest/valid-expect-in-promise": "error",
"oxc/no-accumulating-spread": "error"
},
"overrides": [
{
"files": [
"**/*.ts"
],
"rules": {
"for-direction": "error",
"no-async-promise-executor": "error",
"no-case-declarations": "error",
"no-compare-neg-zero": "error",
"no-cond-assign": "error",
"no-constant-binary-expression": "error",
"no-constant-condition": "error",
"no-control-regex": "error",
"no-debugger": "error",
"no-delete-var": "error",
"no-dupe-else-if": "error",
"no-duplicate-case": "error",
"no-empty": "error",
"no-empty-character-class": "error",
"no-empty-pattern": "error",
"no-empty-static-block": "error",
"no-ex-assign": "error",
"no-extra-boolean-cast": "error",
"no-fallthrough": "error",
"no-global-assign": "error",
"no-invalid-regexp": "error",
"no-irregular-whitespace": "error",
"no-loss-of-precision": "error",
"no-misleading-character-class": "error",
"no-nonoctal-decimal-escape": "error",
"no-prototype-builtins": "error",
"no-regex-spaces": "error",
"no-self-assign": "error",
"no-shadow-restricted-names": "error",
"no-sparse-arrays": "error",
"no-unassigned-vars": "error",
"no-unexpected-multiline": "error",
"no-unsafe-finally": "error",
"no-unsafe-optional-chaining": "error",
"no-unused-labels": "error",
"no-unused-private-class-members": "error",
"no-unused-vars": "error",
"no-useless-backreference": "error",
"no-useless-catch": "error",
"no-useless-escape": "error",
"preserve-caught-error": "error",
"require-yield": "error",
"use-isnan": "error",
"valid-typeof": "error",
"no-var": "error",
"prefer-const": "error",
"prefer-rest-params": "error",
"prefer-spread": "error",
"no-array-constructor": "error",
"no-unused-expressions": "error",
"typescript/ban-ts-comment": [
"error",
{
"ts-expect-error": {
"descriptionFormat": "^(?: --)? SAFETY: \\S"
}
}
],
"typescript/no-duplicate-enum-values": "error",
"typescript/no-empty-object-type": "error",
"typescript/no-explicit-any": "error",
"typescript/no-extra-non-null-assertion": "error",
"typescript/no-misused-new": "error",
"typescript/no-namespace": "error",
"typescript/no-non-null-asserted-optional-chain": "error",
"typescript/no-require-imports": "error",
"typescript/no-this-alias": "error",
"typescript/no-unnecessary-type-constraint": "error",
"typescript/no-unsafe-declaration-merging": "error",
"typescript/no-unsafe-function-type": "error",
"typescript/no-wrapper-object-types": "error",
"typescript/prefer-as-const": "error",
"typescript/prefer-namespace-keyword": "error",
"typescript/triple-slash-reference": "error",
"no-empty-function": "error",
"typescript/adjacent-overload-signatures": "error",
"typescript/array-type": "error",
"typescript/ban-tslint-comment": "error",
"typescript/class-literal-property-style": "error",
"typescript/consistent-generic-constructors": "error",
"typescript/consistent-indexed-object-style": "error",
"typescript/consistent-type-assertions": [
"error",
{
"assertionStyle": "as",
"objectLiteralTypeAssertions": "never",
"arrayLiteralTypeAssertions": "never"
}
],
"typescript/consistent-type-definitions": "error",
"typescript/no-confusing-non-null-assertion": "error",
"typescript/prefer-for-of": "error",
"typescript/prefer-function-type": "error"
}
},
{
"files": [
"**/*.spec.ts"
],
"rules": {
"typescript/no-unnecessary-type-assertion": "off",
"typescript/require-await": "off",
"anti-slop/no-chained-type-assertions": "off",
"anti-slop/no-known-value-widening": "off",
"anti-slop/no-unknown-parameters": "off",
"anti-slop/no-unknown-returns": "off",
"anti-slop/no-unsafe-dictionary-type": "off",
"anti-slop/require-safety-comment-for-type-assertion": "off",
"typescript/no-unnecessary-condition": "off",
"typescript/no-unnecessary-type-parameters": "off",
"typescript/no-unsafe-argument": "off",
"typescript/no-unsafe-assignment": "off",
"typescript/no-unsafe-call": "off",
"typescript/no-unsafe-enum-comparison": "off",
"typescript/no-unsafe-member-access": "off",
"typescript/no-unsafe-return": "off",
"typescript/no-deprecated": "off",
"typescript/consistent-type-assertions": "error"
}
},
{
"files": [
"src/app/core/testing/**/*.ts"
],
"rules": {
"typescript/no-unnecessary-type-parameters": "off"
}
}
]
}