Skip to Content

Rules

A practical rule catalog by family. Each rule maps to an ESLint name where one exists. Severity in lint.config.ts is one of "error" (fails the build), "warning" (prints, exit code 0), "off" (skipped).

Authoritative source: rule typings live under packages/lint/src/structures/rules/.

Each family interface (ITtscLintCoreRules, ITtscLintReactRules, …) owns its own rule keys.

ITtscLintRules.ts is the union accepted by ITtscLintConfig.rules.

The per-family pages below document what each rule does and when to keep it on.

Rule families and config types

Rule IDs use ESLint-style kebab-case with slash namespaces.

The exported ITtscLintRules type is an intersection of family-specific interfaces, so a complete rules object and smaller family objects share the same checked property names and option tuples.

FamilyTypeRulesNamespace
Core (ESLint-compatible)ITtscLintCoreRules149none
TypeScriptITtscLintTypeScriptRules98typescript/*
ReactITtscLintReactRules29react/*
React performanceITtscLintReactPerfRules4react-perf/*
JSX accessibilityITtscLintJsxA11yRules37jsx-a11y/*
Next.jsITtscLintNextjsRules21nextjs/*
SolidITtscLintSolidRules21solid/*
UnicornITtscLintUnicornRules146unicorn/*
JestITtscLintJestRules19jest/*
VitestITtscLintVitestRules13vitest/*
Testing LibraryITtscLintTestingLibraryRules29testing-library/*
PlaywrightITtscLintPlaywrightRules31playwright/*
CypressITtscLintCypressRules13cypress/*
StorybookITtscLintStorybookRules16storybook/*
TanStack QueryITtscLintTanstackQueryRules8tanstack-query/*
PromiseITtscLintPromiseRules17promise/*
Regular expressionsITtscLintRegexpRules22regexp/*
SecurityITtscLintSecurityRules14security/*
JSDocITtscLintJsdocRules13jsdoc/*
FunctionalITtscLintFunctionalRules20functional/*
Architecture boundariesITtscLintBoundariesRules6boundaries/*
Contributor pluginsITtscLintContributorRulesuser-defined<namespace>/*

Claim ownership

To the maintainers of the upstream rule families behind these namespaces: the in-tree rules are Go ports for the TypeScript-Go Checker.

I implemented them first so ttsc projects can use the rules without running a separate ESLint process. That is a convenience layer, not a claim over your rule family.

If you want to develop and maintain your family inside the @ttsc/lint ecosystem yourself, publish it as a contributor plugin.

You may reuse the in-tree Go rule sources under packages/lint/linthost.

The checked fixtures live under tests/test-lint/src/cases. Use both as a starting point.

Open an issue at samchon/ttsc when the package is ready. I will retire the matching in-tree port and point this catalog at your package.

Partial ownership is fine: name the subset you want to maintain, and I will remove just those rules.

The contributor-plugin path is documented in the @ttsc/lint development guide.

import type { ITtscLintConfig, ITtscLintReactRules } from "@ttsc/lint"; const reactRules = { "react/jsx-key": "error", "react/no-danger": "warning", } satisfies ITtscLintReactRules; export default { rules: { "no-var": "error", ...reactRules, }, } satisfies ITtscLintConfig;

A common starter set

Most projects start here. Add and remove as you go.

// lint.config.ts import type { ITtscLintConfig } from "@ttsc/lint"; export default { rules: { // Variables "no-var": "error", "prefer-const": "error", // Comparison eqeqeq: "error", "no-self-compare": "error", // Suggestions "typescript/no-explicit-any": "warning", "typescript/prefer-as-const": "error", "object-shorthand": "error", "no-useless-rename": "error", // Imports "typescript/no-import-type-side-effects": "error", "typescript/consistent-type-imports": "error", // Misc safety "no-debugger": "error", "no-throw-literal": "error", "typescript/await-thenable": "error", }, } satisfies ITtscLintConfig;

Formatter behavior is configured separately through the top-level format block (typed as ITtscLintFormat). See Format rules.

Autofix coverage at a glance

ttsc fix autofixes a subset. Native fixers cover:

  • no-var, single-declaration prefer-const, ESLint-safe eqeqeq
  • typescript/no-wrapper-object-types (primitives only; Object is detection-only)
  • typescript/prefer-as-const, no-useless-rename, object-shorthand, typescript/no-extra-non-null-assertion
  • typescript/no-unnecessary-type-constraint, typescript/prefer-namespace-keyword, no-useless-escape
  • typescript/no-import-type-side-effects (hoists inline type modifiers)
  • typescript/await-thenable (type-aware: drops await on non-thenable operands)
  • Every format rule

See also

  • Format: the format rule set (including print-width reflow).
  • Overview: the ttsc fix / ttsc format command summary.
Last updated on