AceDevHub
Production TypeScriptFree

Strict Mode and Tooling

Enable strict compiler flags, integrate ESLint type-aware rules, and use editor settings that catch bugs before commit.

AdvancedFreeTooling

strict: true enables the compiler's strongest default checks — strictNullChecks, noImplicitAny, strictFunctionTypes, and more. Teams that enable strict early pay a one-time migration cost and avoid years of nullable bugs. Turning strict on in a mature codebase requires incremental file-by-file enablement or @ts-expect-error cleanup sprints.

TypeScript alone does not catch all issues — ESLint with typescript-eslint adds style and some logic rules typecheck misses. Editor format-on-save and CI running tsc --noEmit plus lint form the quality gate before merge.

What strict enables

strictNullChecks separates null and undefined from other types — optional chaining becomes necessary instead of accidental. noImplicitAny errors on untyped parameters and implicit any locals. strictFunctionTypes checks function parameter contravariance on callbacks.

strict-null.ts
Loading editor…

Incremental strict adoption

strictNullChecks and noImplicitAny can be enabled individually before full strict. // @ts-nocheck at file top disables checking — use temporarily during migration, not permanently. prefer @ts-expect-error with comments explaining why.

incremental.ts
Loading editor…

ESLint with typescript-eslint

typescript-eslint parser reads tsconfig for type-aware rules — no-floating-promises, no-misused-promises, consistent-type-imports. Run eslint in CI alongside tsc. type-aware linting is slower — scope to src/ not entire monorepo if needed.

eslint.config.example.mjs
Loading editor…
FlagCatches
strictNullChecksnull/undefined access
noImplicitAnyUntyped params/locals
noUncheckedIndexedAccessundefined array access
exactOptionalPropertyTypesundefined vs missing

Editor and CI workflow

Enable TypeScript SDK in the editor for the workspace TypeScript version — not an outdated global. CI should run npm run typecheck (tsc --noEmit) on every PR. Pre-commit hooks optional but typecheck in CI is non-negotiable for typed codebases.

package.json scripts
Loading editor…
  • strict: true for new projects
  • typescript-eslint for promise and import rules
  • tsc --noEmit in CI
  1. 1strict catches nullable and any bugs
  2. 2Enable flags incrementally if needed
  3. 3ESLint complements tsc
  4. 4Next: typing async and Promises