@ttsc/lint
v0.19.3
Published
Reference ttsc plugin: ESLint-style lint rules over the TypeScript-Go Program used by the type-check pass.
Maintainers
Readme
@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.
Diagnostic code compatibility
Every built-in rule has a unique positive numeric code in the reserved TS9000 through TS17999 band. These assignments are kept in an append-only ledger: adding a built-in rule does not renumber existing rules, and a removed rule's code is not reused. The LSP surface continues to expose the rule ID, such as no-var, in its diagnostic code field.
The ledger introduction preserved every legacy code that was already unique. For each pre-existing collision group, the alphabetically first rule kept the shared legacy code and every other rule received an available code. Those resolved assignments are now frozen by the same append-only policy.
Rules contributed by another Go package share the same collision-free band. Their codes are deterministic for an unchanged complete set of loaded contributors and do not depend on registration order. Adding or removing a contributor recomputes assignments for that complete contributor set and can change contributor codes, but never changes a built-in assignment.
Setup
npm install -D ttsc @ttsc/lint typescriptDrop 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>", "", "^[./]"],
unsafeSortRuntimeImports: true, // accepts module evaluation reordering
},
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) | Sort named specifiers and erased type-only imports. Runtime declaration sorting requires unsafeSortRuntimeImports. |
| 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).
The safe default preserves the source order of every runtime-bearing import, including default, namespace, named, and bare imports, because each form can evaluate its dependency module. It still alphabetizes named specifiers within one declaration and can sort or merge a block made entirely of erased import type declarations. Set unsafeSortRuntimeImports: true only when every dependency in the block is order-independent. combineTypeAndValue affects a mixed type/value block only under that unsafe opt-in.
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;Rules with options use an ESLint-style tuple such as ["error", { allowElseIf: false }]. A built-in rule whose typed setting is severity-only accepts no payload, even while it is "off"; the engine reports an invalid configuration instead of silently discarding the extra value.
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: require afor...inbody to be wrapped in anifstatement (or to skip iterations with a leadingif (...) continue) so inherited keys are guarded, matching ESLint core's structural check.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: reject explicit and implicit awaits evaluated in repeated loop positions.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 duplicate or logically coveredelse ifconditions.no-dupe-keys: rejects duplicate object keys.no-duplicate-case: rejects duplicateswitchcase labels.no-duplicate-imports: reject a repeated module specifier when the import declarations could be merged into one;allowSeparateTypeImportsandincludeExportsmatch the ESLint options.no-else-return: reject anelseblock whose precedingifbranch returns on every path.no-empty: rejects uncommented empty blocks and switches;allowEmptyCatchaccepts empty catches.no-empty-character-class: rejects empty regex character classes.no-empty-function: rejects uncommented empty functions unless their category is allowed.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 uncommented 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.bind(thisArg)on arrows and regular functions that never read their ownthis, while preserving partial application.no-extra-boolean-cast: rejects redundant boolean casts.no-fallthrough: rejectsswitchcases whose end is reachable and that lack an intentional// falls throughcomment before the next label.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: resolves imported bindings through the checker and rejects assignments, destructuring and loop writes, plus direct namespace mutations such asns.x = ...andObject.assign(ns, value).no-inner-declarations: rejects block functions with legacy sloppy semantics;"both"also checks nestedvardeclarations.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 loop-created closures only when they capture bindings that can change between iterations.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: rejects writes to parameter bindings, withpropsand property-ignore options matching ESLint.no-plusplus: rejects++and--.no-promise-executor-return: rejects values returned by global Promise executors, with anallowVoidoption for explicit unaryvoidreturns.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: reject static imports and re-exports selected by user-configured exact paths, gitignore-style groups, or regular expressions.no-restricted-syntax: reject only syntax matching the project's configured TypeScript-Go AST selectors; no selectors means no restrictions.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 under ESLint's default semantics, accepting directive prologues (arbitrary text, determined by AST position) and productive expressions such asvoid promise()while rejecting tagged templates and misplaced strings; the upstream options are supported.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: prefersconstfor lexicalletbindings that are never reassigned, including declaration-only and destructured bindings with ESLint-compatible options.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, non-awaitable members passed to native Promise aggregators,for await...ofover a value that is not async iterable, andawait usingof a resource that is not async disposable (type-aware).typescript/ban-ts-comment: rejects@ts-ignoreand@ts-nocheck, and requires a description after@ts-expect-error(upstream recommended defaults; each directive configurable viaboolean,"allow-with-description", or{ descriptionFormat }).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: rejects discarded built-in Promises, invalid rejection-handler chains, and Promise-bearing arrays; structural thenables,void, async IIFEs, and known-safe calls/types follow the rule's typed options.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 thenables in boolean, spread, synchronous-disposal, and void-return contexts using resolved types.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 exact type spellings from the configuredtypesmap, with custom messages, automatic replacements, and editor suggestions; no options is a no-op.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; its fix preserves the<T,>disambiguation required by single-parameter generic arrows in TSX, MTS, and CTS files.typescript/no-unsafe-argument: reject passing anany-typed value to a parameter whose declared type is concrete (type-aware).typescript/no-unsafe-assignment: reject direct and recursively nestedanyvalues escaping through annotated or inferred variables, reassignments, defaults, class members, contextual properties, spreads, and destructuring;unknownreceivers remain allowed (type-aware, no options).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 constover literal type assertions and matching literal type annotations on variables and class properties.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 enumerable discriminant member to have an explicitcaseby default; typed options control real/comment defaults and open types (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](https://github.com/samchon/ttsc/blob/master/tests/test-lint/src/cases/react-jsx-no-duplicate-pr
