@ttsc/lint

A linter and formatter. Co-protagonist of the ttsc toolchain, paired with ttsc, it replaces eslint and prettier.
720+ rules across 21 families. Lint violations surface as error TSxxxxx from a single compile pass; the formatter applies via ttsc format.
Demonstration
Given this file:
// src/index.ts
var x: number = 3;
let y: number = 4;
const z: string = 5;
console.log(x + y + z);Run ttsc with @ttsc/lint enabled (see Setup):
$ pnpm ttsc
src/index.ts:3:7 - error TS2322: Type 'number' is not assignable to type 'string'.
3 const z: string = 5;
~
src/index.ts:2:5 - error TS17397: [prefer-const] Use const instead of let.
2 let y: number = 4;
~~~~~~~~~~~~~
src/index.ts:1:1 - error TS11966: [no-var] Unexpected var, use let or const instead.
1 var x: number = 3;
~~~~~~~~~~~~~~~~~~
Found 3 errors in the same file, starting at: src/index.ts:3Type errors (TS2322) and lint violations (TS17397, TS11966) come out together. No second tool, no second CI step.
Setup
npm install -D ttsc @ttsc/lint typescript@rcDrop a lint.config.ts next to your tsconfig.json:
// lint.config.ts
import type { ITtscLintConfig } from "@ttsc/lint";
export default {
format: {
printWidth: 100,
singleQuote: true,
trailingComma: "all",
},
rules: {
"no-var": "error",
"prefer-const": "error",
"typescript/no-explicit-any": "error",
"typescript/no-floating-promises": "error",
},
} satisfies ITtscLintConfig;Run your normal ttsc or ttsx:
npx ttsc
npx ttsx src/index.tsErrors fail the command; warnings print without affecting the exit code. Under ttsx, errors stop the program before your entrypoint runs.
ttsc fix applies every autofix the enabled rules offer, lint and format together. Writes results back to disk, then re-runs type-check + lint. ttsc format runs the format rule set through the same dataflow.
npx ttsc fix
npx ttsc formatttsc fix is a one-shot project pass and rejects --watch, single-file mode, and --emit. Fixes are written to disk before the recheck runs, so source stays modified even when the command exits non-zero on remaining errors. Recommended flow: run ttsc fix locally, commit, then have CI run ttsc --noEmit to gate on zero remaining errors.
Format
Configure the formatter through the format block in lint.config.ts. Keys mirror .prettierrc; the presence of the block, even empty format: {}, enables the always-on format rules at Prettier defaults so ttsc format rewrites your source to match.
// lint.config.ts
import type { ITtscLintConfig } from "@ttsc/lint";
export default {
format: {
printWidth: 100,
singleQuote: true,
trailingComma: "all",
sortImports: {
order: ["<BUILTIN_MODULES>", "", "<THIRD_PARTY_MODULES>", "", "^[./]"],
},
jsDoc: true,
},
rules: { "no-var": "error" },
} satisfies ITtscLintConfig;ttsc check does not fail on formatting by default. It surfaces format diagnostics only when you opt in with format.severity. ttsc format runs the active format rules across the project and writes results to disk regardless of severity.
Each format key controls one behavior:
| Config key | Effect |
|---|---|
severity (default "off") |
Check-time diagnostic level for formatting. Does not gate ttsc format. |
semi |
Insert trailing semicolons on ASI-terminated statements. |
singleQuote |
Convert quoted strings to the preferred quote style. |
arrowParens |
Add or remove parens around a single arrow parameter. |
bracketSpacing |
Spaces inside object and named-import/export braces. |
quoteProps |
Quote or unquote object property keys. |
trailingComma |
Add trailing commas to multi-line lists. |
printWidth, tabWidth, useTabs, endOfLine |
Column-aware line reflow. Object/array literals, call/new arguments, and named import/export clauses break across lines when their flat form overflows the budget. |
sortImports (opt-in) |
Group imports by order, alphabetize each group + its specifiers, and merge duplicate modules. |
jsDoc (on by default) |
Normalize JSDoc blocks toward prettier-plugin-jsdoc. |
sortImports is opt-in — it takes effect only when you set it. Every other key takes effect as soon as the format block is present (JSDoc normalization included; set jsDoc: false to opt out), which also applies several keyless layout behaviors (statement splitting, indentation, whitespace normalization, clause joining, declaration-header reflow, ternary-nullish parens, leading-semicolon merging, and parameter-property breaking).
Formatting is configured only through the format block. The rules map is for lint rules; a format/* id placed there is ignored. To turn a format behavior off, set its format key (for example trailingComma: "none"), not a rules entry.
Rules
Lint rules are off until you enable them in lint.config.ts. Severity values: "error" fails the build, "warning" prints without affecting the exit code, "off" disables the rule.
// lint.config.ts
export default {
rules: {
"no-var": "error",
"eqeqeq": "error",
"prefer-template": "warning",
"typescript/no-non-null-assertion": "off",
},
} satisfies ITtscLintConfig;Rule IDs use ESLint-style kebab-case and slash namespaces, no-var, react/jsx-key, testing-library/prefer-screen-queries. The exported ITtscLintRules type is the intersection of family-specific interfaces such as ITtscLintCoreRules, ITtscLintTypeScriptRules, ITtscLintReactRules, and ITtscLintVitestRules, so users can type a whole config or a narrower family-shaped object.
Each rule below links to its TypeScript fixture under tests/test-lint/src/cases/.
ESLint core
Generic ESLint-compatible rules that apply to both JavaScript and TypeScript source. Every rule listed here corresponds 1-to-1 with an ESLint core rule of the same kebab-case id, so projects migrating from ESLint can paste their rule severities into lint.config.ts without renaming anything. TypeScript-only rules and @typescript-eslint extensions live under typescript/* in TypeScript, @ttsc/lint does not accept legacy bare names or @typescript-eslint/* aliases for those.
Source: ESLint core rules.
camelcase: reject identifier declarations that aren't camelCase or PascalCase, snake_case bindings are flagged.complexity: reject function bodies whose cyclomatic complexity exceeds twenty (default ESLint threshold).consistent-return: reject functions where somereturnstatements return a value and others fall through without one.curly: require block statements for everyif,else,while,for, anddobody. Reject the single-statement shorthand.default-case: requireswitchstatements to include adefaultclause.default-case-last: require thedefaultclause of aswitchstatement to appear last.default-param-last: keeps parameters with default values at the end of the list.dot-notation: prefers dot property access when a string-literal key is a valid identifier.eqeqeq: requires strict equality operators.for-direction: catches loop counters updated in the wrong direction.getter-return: require agetaccessor's body to return a value on every reachable exit.grouped-accessor-pairs: require thegetandsetaccessors of a property to be declared adjacent in the class body.guard-for-in: requirefor...inbodies to guard against inherited keys withObject.hasOwnorObject.prototype.hasOwnProperty.call.id-length: reject identifier names shorter than two characters.init-declarations: require everyvar/letdeclaration to be initialized at its declaration site.max-classes-per-file: reject a source file that declares more than one class.max-depth: reject block-statement nesting deeper than four levels inside a function.max-lines: reject a source file whose total line count exceeds three hundred.max-lines-per-function: reject a function whose body spans more than fifty lines.max-nested-callbacks: reject callback nesting deeper than ten inside a single function.max-params: reject function declarations with more than three parameters.max-statements: reject function bodies whose statement count exceeds ten.no-alert: rejectsalert,confirm, andprompt.no-array-constructor: rejectsArrayconstructor calls.no-async-promise-executor: rejects async Promise executors.no-await-in-loop: rejectawaitexpressions evaluated inside a loop body.no-bitwise: rejects bitwise operators.no-caller: rejectsarguments.callerandarguments.callee.no-case-declarations: rejects lexical declarations directly insidecaseclauses.no-class-assign: rejects reassignment of class declarations.no-compare-neg-zero: rejects comparisons against-0.no-cond-assign: rejects assignments inside conditions.no-console: rejectsconsolecalls.no-constant-condition: rejects constant conditions.no-constructor-return: rejectreturn X;(with a value) inside a class constructor.no-continue: rejectscontinuestatements.no-control-regex: rejects control characters in regular expressions.no-debugger: rejectsdebuggerstatements.no-delete-var: rejects deleting variables.no-dupe-args: rejects duplicate function parameters.no-dupe-class-members: reject two declarations of the same member on a single class.no-dupe-else-if: rejects repeatedelse ifconditions.no-dupe-keys: rejects duplicate object keys.no-duplicate-case: rejects duplicateswitchcase labels.no-duplicate-imports: reject two import declarations that resolve to the same module specifier.no-else-return: reject anelseblock whose precedingifbranch already terminates withreturn,throw,break, orcontinue.no-empty: rejects empty blocks.no-empty-character-class: rejects empty regex character classes.no-empty-function: rejects empty functions.no-empty-named-blocks: rejects empty named import/export clauses (import {} from "x",export {}).no-empty-pattern: rejects empty destructuring patterns.no-empty-static-block: rejects empty class static blocks.no-eq-null: rejects loose null comparisons.no-eval: rejectseval.no-ex-assign: rejects reassignment of caught exceptions.no-extend-native: reject assignments to a built-in prototype such asArray.prototype.foo = bar.no-extra-bind: rejects unnecessary.bind()calls.no-extra-boolean-cast: rejects redundant boolean casts.no-fallthrough: rejects unmarkedswitchfallthrough.no-func-assign: rejects reassignment of function declarations.no-implicit-coercion: reject common implicit-coercion idioms (!!x,+x,"" + x) in favor of the explicitBoolean(x)/Number(x)/String(x)conversions.no-import-assign: rejects writes to imported bindings (includingns.x = ...for namespace imports).no-inner-declarations: rejects function declarations nested in blocks.no-invalid-this: rejectthisreferences outside any function-like, class method, or class-static-block context.no-irregular-whitespace: rejects irregular whitespace.no-iterator: rejects__iterator__.no-labels: rejects labels.no-lone-blocks: rejects unnecessary standalone blocks.no-lonely-if: rejectsifas the only statement in anelse.no-loop-func: reject function declarations defined inside the body of a loop.no-loss-of-precision: rejects number literals that lose precision.no-magic-numbers: reject inline numeric literals outsideconstinitializer position.0,1,-1, array indices, and enum values are exempt.no-misleading-character-class: rejects misleading regex character classes.no-mixed-operators: reject mixing operators of different precedence families in the same expression without explicit parentheses around the inner sub-expression.no-multi-assign: rejects chained assignments.no-multi-str: rejects multiline string escapes.no-negated-condition: rejects negated conditions with anelse.no-nested-ternary: rejects nested ternary expressions.no-new: rejectsnewexpressions used only for side effects.no-new-func: rejectsFunctionconstructors.no-new-symbol: rejectnew Symbol(...).no-new-wrappers: rejects primitive wrapper constructors.no-obj-calls: rejects calling global objects as functions.no-object-constructor: rejectsnew Object().no-octal: rejects legacy octal literals.no-octal-escape: rejects octal escape sequences.no-param-reassign: reject reassigning a function parameter inside the body of the function it belongs to.no-plusplus: rejects++and--.no-promise-executor-return: rejects returned values from Promise executors.no-proto: rejects__proto__.no-prototype-builtins: rejects directObject.prototypemethod calls.no-redeclare: rejects redeclaring a binding in the same scope.no-regex-spaces: rejects repeated literal spaces in regexes.no-restricted-imports: rejectimportdeclarations targeting any module specifier in the project denylist.no-restricted-syntax: reject AST node kinds listed in the project denylist.no-return-assign: rejects assignments inreturn.no-script-url: rejectsjavascript:URLs.no-self-assign: rejects assignments to the same value.no-self-compare: rejects comparing a value to itself.no-sequences: rejects comma expressions.no-setter-return: rejects returned values from setters.no-shadow: reject a nested-scope binding that shadows a same-name binding from an outer scope.no-shadow-restricted-names: rejects shadowing restricted globals.no-sparse-arrays: rejects sparse arrays.no-template-curly-in-string: rejects${...}text inside normal strings.no-this-before-super: rejectthis(orsuper.x) references that precede the firstsuper()call in a derived constructor.no-throw-literal: rejects throwing literals.no-undef-init: rejects initializing toundefined.no-undefined: rejects the globalundefinedidentifier.no-unneeded-ternary: rejects redundant ternary expressions.no-unreachable: reject statements that follow an unconditionalreturn,throw,break, orcontinuein the same block, control flow has already left the block, so any later statement is dead code.no-unsafe-finally: rejects control flow fromfinally.no-unsafe-negation: rejects unsafe negation before relational checks.no-unsafe-optional-chaining: reject member access or call expressions that chain off an optional chain without continuing the chain.no-unused-expressions: rejects expression statements with no effect.no-unused-labels: rejects labels that nobreakorcontinuetargets.no-useless-assignment: reject an assignment whose value is immediately overwritten by the very next statement without an intervening read of the same identifier.no-useless-call: rejects unnecessary.call()and.apply().no-useless-catch: rejects catch blocks that only rethrow.no-useless-computed-key: rejects unnecessary computed property keys.no-useless-concat: rejects unnecessary string concatenation.no-useless-constructor: rejects empty constructors with no parameters.no-useless-escape: rejects backslash escapes that have no effect inside strings or regexes.no-useless-rename: rejects import/export/destructure renames to the same name.no-useless-return: reject a barereturn;whose only effect is to end a function body that would have returned anyway.no-var: rejectsvar.no-with: rejectswithstatements.object-shorthand: requires object property shorthand where possible.operator-assignment: prefers compound assignment operators.prefer-arrow-callback: rejectfunction() { ... }expressions passed as callback arguments. Prefer the arrow form.prefer-const: prefersconstforletbindings that are never reassigned.prefer-destructuring: reject single-property and single-index variable declarations (const a = obj.a,const x = arr[0]) that destructuring would replace verbatim.prefer-exponentiation-operator: prefers**overMath.pow.prefer-for-of: prefersfor...offor simple array iteration.prefer-named-capture-group: reject regex literals with unnamed capturing groups(...). Prefer named groups(?<name>...).prefer-numeric-literals: prefer ES2015+ numeric literal forms (0b…,0o…,0x…) overparseInt(string, 2 | 8 | 16).prefer-object-has-own: preferObject.hasOwn(obj, key)overObject.prototype.hasOwnProperty.call(obj, key).prefer-object-spread: prefer object-spread{ ...a, ...b }overObject.assign({}, a, b).prefer-rest-params: reject reading fromargumentsin a non-arrow function body. Prefer the ES2015 rest-parameter form(...args).prefer-spread: prefers spread arguments over.apply.prefer-template: prefers template literals over string concatenation.radix: requires a radix argument forparseInt.require-yield: requires generator functions to containyield.sort-imports: reject import specifiers within a singleimportdeclaration that aren't alphabetically sorted.sort-keys: reject object-literal property keys that aren't alphabetically sorted.use-isnan: requiresNumber.isNaN/isNaNforNaNchecks.valid-typeof: restrictstypeofcomparisons to valid strings.vars-on-top: requiresvardeclarations at the top of their scope.yoda: rejects literal-first comparisons.
TypeScript
TypeScript-only rules and @typescript-eslint plugin equivalents, exposed under the typescript/* namespace. Each rule either requires TypeScript syntax (interface, enum, namespace, as, !, import type, type parameters, declaration merging, parameter properties, triple-slash references) or originates from @typescript-eslint as a TS-aware extension that has no counterpart in plain ESLint.
Source: typescript-eslint.
typescript/adjacent-overload-signatures: keeps overload declarations for the same member adjacent.typescript/array-type: prefersT[]andreadonly T[]over array helper types.typescript/await-thenable: rejectsawaiton a value that is neither a Promise nor a thenable (type-aware).typescript/ban-ts-comment: rejects TypeScript suppression comments such as@ts-ignore.typescript/ban-tslint-comment: rejects obsoletetslint:comments.typescript/class-literal-property-style: prefer astatic readonlyfield over agetaccessor whose body is a singlereturn <literal>;.typescript/consistent-generic-constructors: reject the redundant pattern where a variable is annotated with a generic type AND the same generic arguments are repeated on the constructor:const m: Map<K, V> = new Map<K, V>().typescript/consistent-indexed-object-style: prefersRecordfor single index-signature object types.typescript/consistent-type-assertions: prefersastype assertions over angle-bracket assertions.typescript/consistent-type-definitions: prefers interfaces for object-shaped type definitions.typescript/consistent-type-exports: require type-only re-exports to useexport type { ... }instead of mixing them with value-level re-exports.typescript/consistent-type-imports: usesimport typewhen imported names are type-only.typescript/explicit-function-return-type: require every exported function and method declaration to carry an explicit return-type annotation.typescript/explicit-member-accessibility: require an explicit accessibility modifier (public,private, orprotected) on every class member declaration.typescript/method-signature-style: prefers function-property signatures over method shorthand signatures.typescript/no-array-delete: rejectsdeleteon array elements.typescript/no-array-for-each: preferfor ... ofoverArray.prototype.forEach().typescript/no-base-to-string: rejects string coercion of values whosetoStringresolves to the defaultObject.prototype.toString(type-aware).typescript/no-confusing-non-null-assertion: rejects confusing non-null assertions next to equality checks.typescript/no-confusing-void-expression: rejectvoid Xexpressions used in any position where the surrounding context expects a value, initializer, call argument,returnoperand, conditional, binary, or ternary subexpression.typescript/no-deprecated: reject references to declarations annotated@deprecatedin their JSDoc, with the deprecation comment surfaced at the reference site (type-aware).typescript/no-duplicate-enum-values: rejects duplicate enum member values.typescript/no-dynamic-delete: rejectsdeleteon dynamically computed property keys.typescript/no-empty-interface: rejects empty interfaces.typescript/no-empty-object-type: rejects empty object type literals.typescript/no-explicit-any: rejects explicitany.typescript/no-extra-non-null-assertion: rejects repeated non-null assertions.typescript/no-extraneous-class: reject classes that exist purely as a namespace for static members or that are entirely empty.typescript/no-floating-promises: reject Promise-typed expressions whose result is discarded, most often a baregetPromise();expression statement.typescript/no-for-in-array: rejectfor (const k in arr)wherearris statically typed as an array or tuple.typescript/no-import-type-side-effects: hoists inlinetypemodifiers into a singleimport typedeclaration.typescript/no-inferrable-types: rejects type annotations TypeScript can infer.typescript/no-invalid-void-type: rejectvoidused as anything other than a function return type.typescript/no-magic-numbers: typeScript-aware extension ofno-magic-numbersthat additionally ignores enum member values.typescript/no-meaningless-void-operator: rejectvoid XwhereXis already statically typedvoid, the operator adds nothing because the operand already evaluates toundefined(type-aware).typescript/no-misused-new: rejects constructor-like signatures in interfaces.typescript/no-misused-promises: reject Promise values supplied where a non-Promise was expected.typescript/no-misused-spread: reject spread expressions whose operand is syntactically wrong for the surrounding context.typescript/no-mixed-enums: rejects enums that mix numeric and string members.typescript/no-namespace: rejects non-ambient namespaces.typescript/no-non-null-asserted-nullish-coalescing: rejects non-null assertions next to??.typescript/no-non-null-asserted-optional-chain: rejects non-null assertions on optional chains.typescript/no-non-null-assertion: rejects postfix non-null assertions.typescript/no-redundant-type-constituents: reject union and intersection type constituents that the type system absorbs anyway,string | anycollapses toany,T & nevercollapses tonever,T & unknowncollapses toT, and repeated constituents add nothing.typescript/no-require-imports: rejects CommonJSrequireimports.typescript/no-restricted-types: reject specific type-reference names that are almost always a mistake, by default the global wrapper typesObject,Function,Number,String, andBoolean.typescript/no-this-alias: rejects aliasingthisto locals.typescript/no-unnecessary-boolean-literal-compare: reject direct comparison of a boolean-typed value withtrue/falseliterals,x === trueis justx,x !== falseis justx.typescript/no-unnecessary-condition: reject conditions whose static type proves the runtime truthiness is fixed,if ({}),if (null),while (""),0 && f()(type-aware).typescript/no-unnecessary-parameter-property-assignment: rejects constructor assignments already handled by parameter properties.typescript/no-unnecessary-qualifier: reject namespace/enum qualifiers that the surrounding scope makes unnecessary (type-aware).typescript/no-unnecessary-template-expression: reject template literals that collapse to a regular string,`${"abc"}`,`${name}`around a string-typed value, or a plain`abc`with no escaped backticks (type-aware).typescript/no-unnecessary-type-arguments: rejectFoo<DefaultT>calls where the supplied generic argument is the same as the parameter's default, the argument adds nothing (type-aware).typescript/no-unnecessary-type-assertion: rejectx as T,<T>x, andx!assertions whose target type is the same asx's already-known static type, the assertion adds nothing (type-aware).typescript/no-unnecessary-type-constraint: rejects redundantextends anyandextends unknownconstraints.typescript/no-unsafe-argument: reject passing anany-typed value to a parameter whose declared type is concrete (type-aware).typescript/no-unsafe-assignment: reject assigning anany-typed value to a variable, parameter, or property whose declared type is concrete (type-aware).typescript/no-unsafe-call: reject calling a value whose static type isany(type-aware).typescript/no-unsafe-declaration-merging: rejects unsafe class/interface declaration merging.typescript/no-unsafe-enum-comparison: reject==/===/!=/!==comparisons between an enum-typed value and a plainnumberorstringof the same widened primitive, the comparison silently accepts unrelated enums and raw literals that happen to share the underlying primitive (type-aware).typescript/no-unsafe-function-type: rejects the unsafeFunctiontype.typescript/no-unsafe-member-access: reject member access on a value whose static type isany(type-aware).typescript/no-unsafe-return: reject areturnexpression whose static type isanyfrom a function whose declared return type is a concrete (non-any/ non-unknown/ non-void) shape, theanyleaks past the type boundary and disables every downstream check on the returned value (type-aware).typescript/no-unsafe-unary-minus: reject the unary-operator applied to an operand whose static type is not number-like or bigint-like,-xsilently coerces strings, objects, and other shapes viaNumber(x)and almost always indicates a bug (type-aware).typescript/no-useless-constructor: typeScript-aware extension ofno-useless-constructorthat tolerates a constructor existing solely to expose parameter properties.typescript/no-useless-empty-export: rejects redundant emptyexport {}declarations in module files.typescript/no-wrapper-object-types: rejects boxed object type names such asStringandBoolean.typescript/non-nullable-type-assertion-style: rejectx as Fooassertions whose target type is the non-nullable version ofx's static type. Replace with the shorterx!non-null assertion.typescript/only-throw-error: rejectthrow XwhereXis statically known not to derive fromError, string literals, numbers, plain object literals, and the like.typescript/parameter-properties: reject TypeScript parameter-property constructors (constructor(public foo: T)). Prefer plain field declarations so the class shape is visible from the member list instead of buried inside the constructor parameter list.typescript/prefer-as-const: prefersas constfor literal assertions.typescript/prefer-enum-initializers: requires explicit enum member initializers.typescript/prefer-find: preferarray.find(predicate)overarray.filter(predicate)[0]/.shift()when only the first match is needed.typescript/prefer-function-type: prefers function type aliases over single-call interfaces.typescript/prefer-includes: preferarray.includes(x)overarray.indexOf(x) !== -1(and the matching=== -1,>= 0,< 0,> -1shapes) on array, tuple, and string receivers (type-aware).typescript/prefer-literal-enum-member: prefers literal enum member initializers over computed expressions.typescript/prefer-namespace-keyword: prefersnamespaceover TypeScript's legacymodulekeyword.typescript/prefer-nullish-coalescing: prefer??over||(and??=over||=, and??over the ternaryx ? x : y) when the intent is to defaultnull/undefined.typescript/prefer-optional-chain: prefer an optional chain (a?.b?.c) over chained boolean guards such asa && a.b && a.b.cora != null && a.b.typescript/prefer-promise-reject-errors: rejectPromise.reject(value)wherevalueis statically known not to derive fromError, type-aware analog ofonly-throw-errorfor the rejection side of the promise contract.typescript/prefer-readonly: reject private class fields that could carryreadonly.typescript/prefer-reduce-type-parameter: preferarr.reduce<T>(..., initial)overarr.reduce(..., initial as T)so the accumulator type is set on the call site instead of widened away inside the assertion (type-aware).typescript/prefer-regexp-exec: preferregex.exec(str)overstr.match(regex)when the regex carries thegflag,.matchreturns only the matched substrings and discards capture groups.typescript/prefer-return-this-type: prefer the explicitthisreturn type for chainable methods so fluent subclasses preserve their concretethisinstead of widening to the base.typescript/prefer-string-starts-ends-with: preferstr.startsWith(p)/str.endsWith(p)overstr.indexOf(p) === 0,str.indexOf(p, str.length - p.length) !== -1,str.lastIndexOf(p) === str.length - p.length, and the anchored-regex/^p/.test(str)//p$/.test(str)idioms (type-aware).typescript/promise-function-async: require functions whose return type isPromise<T>to be declared with theasynckeyword so synchronous throws surface as a rejected Promise (type-aware).typescript/related-getter-setter-pairs: reject agetaccessor whose declared return type does not match the parameter type of its companionsetaccessor on the same class, readers should not observe a type the writer cannot accept (type-aware).typescript/require-array-sort-compare: requirearr.sort()andarr.toSorted()calls to pass an explicitcompareFunction.typescript/require-await: rejectasyncfunctions whose body contains noawaitexpression.typescript/restrict-plus-operands: rejects+expressions whose operands are not bothnumber, bothstring, or bothbigint(type-aware).typescript/restrict-template-expressions: reject template-literal interpolations whose expression carries a type that does not stringify cleanly,${obj}prints"[object Object]",${null}prints"null", and so on.typescript/return-await: rejectreturn promiseinsidetry,catch, orfinally; requirereturn await promise.typescript/sort-type-constituents: sort the members of union (A | B | C) and intersection (A & B & C) types into a canonical order so reorderings don't show up as diffs.typescript/strict-boolean-expressions: rejects non-boolean values used in a boolean context such asif,&&,||, or!(type-aware).typescript/switch-exhaustiveness-check: requires every member of a union orenumdiscriminant to be covered by acase, or adefaultclause to be present (type-aware).typescript/triple-slash-reference: rejects triple-slash reference directives.typescript/unbound-method: reject referencing a class instance method as a value instead of calling it (obj.methodpassed as a callback, aliased to a variable, or stored on another object).typescript/use-unknown-in-catch-callback-variable: require the callback parameter of.catch(...)and the second argument of.then(...)to be typedunknown.
React
React TSX rules, Hooks correctness, JSX safety, the React Compiler subset, and Fast Refresh export shape. Bundles rules from three upstream plugins under one react/* namespace, matching Oxlint's layout. Performance-only rules live in React performance because they are opt-in toggles rather than correctness checks.
Source: eslint-plugin-react, eslint-plugin-react-hooks, eslint-plugin-react-refresh.
react/button-has-type: requires explicit validtypevalues on JSXbuttonelements.react/component-hook-factories: rejects nested component or Hook factories that call Hooks.react/display-name: require components wrapped inReact.memo(...)orReact.forwardRef(...)to be named, either by passing a named function, assigning the call to a named binding, or setting an explicitdisplayName.react/exhaustive-deps: reports high-confidence missing identifier dependencies inuseEffect,useLayoutEffect,useInsertionEffect,useMemo, anduseCallback.react/iframe-missing-sandbox: requires JSXiframeelements to include a sandbox attribute.react/immutability: rejects local prop mutation inside components and Hooks.react/jsx-key: requireskeyprops for JSX elements produced by arrays or.map().react/jsx-no-duplicate-props: rejects duplicate JSX prop names on the same element.react/jsx-no-script-url: rejectsjavascript:URLs in JSX URL-like props.react/jsx-no-target-blank: reject<a target="_blank">(or any JSX element withtarget="_blank") that does not also carryrel="noreferrer"(orrel="noopener noreferrer").react/jsx-no-undef: reject JSX elements whose tag is an uppercase identifier with no value-level declaration anywhere in the source file.react/jsx-no-useless-fragment: reject JSX fragments that wrap exactly one element child or have no meaningful content. The child (or nothing) can be returned directly.react/no-array-index-key: rejects array map index parameters as JSX keys.react/no-children-prop: rejects passing children through a JSXchildrenprop.react/no-danger: rejectsdangerouslySetInnerHTML.react/no-danger-with-children: rejects combiningdangerouslySetInnerHTMLwith children.react/no-direct-mutation-state: rejects direct writes tothis.stateoutside constructor initialization.react/no-find-dom-node: rejectsfindDOMNodecalls.react/no-is-mounted: rejectsisMountedcalls.react/no-string-refs: rejects string JSX refs.react/no-unescaped-entities: rejects unescaped>,",', and}in JSX text.react/only-export-components: keeps React Fast Refresh component modules from exporting non-components.react/refs: rejects reading or writingref.currentduring render.react/rules-of-hooks: rejects Hooks called outside components or custom Hooks, in nested callbacks, or in conditional/loop control flow.react/set-state-in-effect: rejects synchronous setter calls insideuseEffect.react/set-state-in-render: rejectsuseState/useReducersetters called during render.react/style-prop-object: rejects string literal JSXstyleprop values.react/use-memo: rejects block-b