TypeScript
95 rules oxlint@1.91.0
Complete effective rule inventory.
Rules
No enabled TypeScript rules match this search.
-
typescript/no-useless-empty-exportDisallow empty exports that don't change anything in a module file
: error in All TypeScript contexts -
typescript/no-wrapper-object-typesDisallow using confusing built-in primitive class wrappers
: error in All TypeScript contexts -
typescript/non-nullable-type-assertion-styleEnforce non-null assertions over explicit type assertions
: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/only-throw-errorDisallow throwing non-
Errorvalues as exceptions: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/prefer-as-constEnforce the use of
as constover literal type: error in All TypeScript contexts -
typescript/prefer-findEnforce the use of Array.prototype.find() over Array.prototype.filter() followed by [0] when looking for a single result
: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/prefer-for-ofEnforce the use of
for-ofloop over the standardforloop where possible: error in All TypeScript contexts -
typescript/prefer-function-typeEnforce using function types instead of interfaces with call signatures
: error in All TypeScript contexts -
typescript/prefer-includesEnforce
includesmethod overindexOfmethod: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/prefer-literal-enum-memberRequire all enum members to be literal values
: error in All TypeScript contexts -
typescript/prefer-namespace-keywordRequire using
namespacekeyword overmodulekeyword to declare custom TypeScript modules: error in All TypeScript contexts -
typescript/prefer-nullish-coalescingEnforce using the nullish coalescing operator instead of logical assignments or chaining
: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/prefer-optional-chainEnforce using concise optional chain expressions instead of chained logical ands, negated logical ors, or empty objects
: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/prefer-promise-reject-errorsRequire using Error objects as Promise rejection reasons
: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/prefer-readonlyRequire private members to be marked as
readonlyif they're never modified outside of the constructor: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/prefer-reduce-type-parameterEnforce using type parameter when calling
Array#reduceinstead of using a type assertion: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/prefer-regexp-execEnforce
RegExp#execoverString#matchif no global flag is provided: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/prefer-return-this-typeEnforce that
thisis used when onlythistype is returned: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/prefer-string-starts-ends-withEnforce using
String#startsWithandString#endsWithover other equivalent methods of checking substrings: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/related-getter-setter-pairsEnforce that
get()types should be assignable to their equivalentset()type: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/require-array-sort-compareRequire
Array#sortandArray#toSortedcalls to always provide acompareFunction: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/require-awaitDisallow async functions which do not return promises and have no
awaitexpression: error in TypeScript source, React source, JavaScript source, React JavaScript source, Design-system React source -
typescript/restrict-plus-operandsRequire both operands of addition to be the same type and be
bigint,number, orstring: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/restrict-template-expressionsEnforce template literal expressions to be of
stringtype: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/return-awaitEnforce consistent awaiting of returned promises
: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/strict-void-returnDisallow passing a value-returning function in a position accepting a void function
: warning in TypeScript source, JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests -
typescript/switch-exhaustiveness-checkRequire switch-case statements to be exhaustive
: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/triple-slash-referenceDisallow certain triple slash directives in favor of ES6-style import declarations
: error in All TypeScript contexts -
typescript/unbound-methodEnforce unbound methods are called with their expected scope
: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source -
typescript/unified-signaturesDisallow two overloads that could be unified into one with a union or an optional/rest parameter
: error in All TypeScript contexts -
typescript/use-unknown-in-catch-callback-variableEnforce typing arguments in Promise rejection callbacks as
unknown: error in TypeScript source, React source, JavaScript source, React JavaScript source, TypeScript tests, Bun tests, Playwright end-to-end tests, Design-system React source