import { defineConfig, type OxlintConfig } from "oxlint"; export const typescriptConfig: OxlintConfig = defineConfig({ plugins: ["typescript"], rules: { "typescript/adjacent-overload-signatures": "error", "typescript/array-type": ["error", { default: "array-simple" }], "typescript/await-thenable": "error", "typescript/ban-ts-comment": [ "error", { "ts-expect-error": "allow-with-description", "ts-ignore": true, "ts-nocheck": "allow-with-description", "ts-check": false, "minimumDescriptionLength": 3, }, ], // The shared config does not use TSLint. "typescript/ban-tslint-comment": "off", // Deprecated. "typescript/ban-types": "off", "typescript/class-literal-property-style": ["error", "fields"], "typescript/consistent-generic-constructors": "error", "typescript/consistent-indexed-object-style": ["error", "record"], "typescript/consistent-return": "error", "typescript/consistent-type-assertions": ["error", { assertionStyle: "never" }], "typescript/consistent-type-definitions": ["error", "interface"], "typescript/consistent-type-exports": "error", "typescript/consistent-type-imports": "error", "typescript/dot-notation": "error", // This is too broad without an exported-functions-only option. "typescript/explicit-function-return-type": "off", // Native private fields are preferred over explicit accessibility modifiers. "typescript/explicit-member-accessibility": "off", "typescript/explicit-module-boundary-types": "error", "typescript/method-signature-style": ["error", "property"], "typescript/no-array-delete": "error", "typescript/no-base-to-string": "error", "typescript/no-confusing-non-null-assertion": "error", "typescript/no-confusing-void-expression": "error", "typescript/no-deprecated": "error", "typescript/no-duplicate-enum-values": "error", "typescript/no-duplicate-type-constituents": "error", "typescript/no-dynamic-delete": "error", "typescript/no-empty-interface": "error", "typescript/no-empty-object-type": "error", "typescript/no-explicit-any": "error", "typescript/no-extra-non-null-assertion": "error", "typescript/no-extraneous-class": "error", "typescript/no-floating-promises": "error", "typescript/no-for-in-array": "error", "typescript/no-implied-eval": "error", "typescript/no-import-type-side-effects": "error", "typescript/no-inferrable-types": "error", "typescript/no-invalid-void-type": "error", "typescript/no-meaningless-void-operator": "error", "typescript/no-misused-new": "error", "typescript/no-misused-promises": [ "error", { checksVoidReturn: { attributes: false, }, }, ], "typescript/no-misused-spread": "error", "typescript/no-mixed-enums": "error", "typescript/no-namespace": "error", "typescript/no-non-null-asserted-nullish-coalescing": "error", "typescript/no-non-null-asserted-optional-chain": "error", "typescript/no-non-null-assertion": "error", "typescript/no-redundant-type-constituents": "error", "typescript/no-require-imports": "error", // Project-specific. "typescript/no-restricted-types": "off", "typescript/no-this-alias": "error", "typescript/no-unnecessary-boolean-literal-compare": "error", "typescript/no-unnecessary-condition": "error", // Removing these assignments can make constructors less readable. "typescript/no-unnecessary-parameter-property-assignment": "off", "typescript/no-unnecessary-qualifier": "error", "typescript/no-unnecessary-template-expression": "error", "typescript/no-unnecessary-type-arguments": "error", "typescript/no-unnecessary-type-assertion": "error", "typescript/no-unnecessary-type-constraint": "error", "typescript/no-unnecessary-type-conversion": "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-declaration-merging": "error", "typescript/no-unsafe-enum-comparison": "error", "typescript/no-unsafe-function-type": "error", "typescript/no-unsafe-member-access": "error", "typescript/no-unsafe-return": "error", "typescript/no-unsafe-type-assertion": "error", "typescript/no-unsafe-unary-minus": "error", "typescript/no-useless-default-assignment": "error", "typescript/no-useless-empty-export": "error", // Deprecated. "typescript/no-var-requires": "off", "typescript/no-wrapper-object-types": "error", "typescript/non-nullable-type-assertion-style": "error", "typescript/only-throw-error": "error", "typescript/parameter-properties": "error", "typescript/prefer-as-const": "error", "typescript/prefer-enum-initializers": "error", "typescript/prefer-find": "error", "typescript/prefer-for-of": "error", "typescript/prefer-function-type": "error", "typescript/prefer-includes": "error", "typescript/prefer-literal-enum-member": ["error", { allowBitwiseExpressions: true }], // Deprecated. "typescript/prefer-namespace-keyword": "off", "typescript/prefer-nullish-coalescing": "error", "typescript/prefer-optional-chain": "error", "typescript/prefer-promise-reject-errors": "error", // Trust the developer. "typescript/prefer-readonly": "off", // Trust the developer. "typescript/prefer-readonly-parameter-types": "off", "typescript/prefer-reduce-type-parameter": "error", "typescript/prefer-regexp-exec": "error", "typescript/prefer-return-this-type": "error", "typescript/prefer-string-starts-ends-with": "error", "typescript/prefer-ts-expect-error": "error", "typescript/promise-function-async": "error", // Trust the developer. "typescript/related-getter-setter-pairs": "off", "typescript/require-array-sort-compare": "error", "typescript/require-await": "error", "typescript/restrict-plus-operands": "error", "typescript/restrict-template-expressions": "error", "typescript/return-await": ["error", "always"], "typescript/strict-boolean-expressions": "error", // Superseded by `typescript/no-misused-promises`. "typescript/strict-void-return": "off", "typescript/switch-exhaustiveness-check": [ "error", { considerDefaultExhaustiveForUnions: true }, ], "typescript/triple-slash-reference": "error", "typescript/unbound-method": "error", "typescript/unified-signatures": "error", "typescript/use-unknown-in-catch-callback-variable": "error", }, });