Skip to main content

Why Some React Apps Use "lint": "npx biome lint --write && npx tsc --noEmit"

This script combines two important tools in one command:


What is biome?

  • Biome is a newer alternative to ESLint (and Prettier combined) — an all-in-one linter and formatter for JavaScript/TypeScript and related ecosystems.
  • It aims to provide faster, simpler, and more integrated linting and formatting compared to using ESLint + Prettier separately.
  • biome lint --write lints your code and automatically fixes formatting and code style issues in-place.

What is tsc --noEmit?

  • tsc is the TypeScript compiler.
  • The --noEmit flag tells tsc to only check types, without generating any output files.
  • This is used to catch TypeScript type errors early, ensuring your code is type-safe.

Why combine them in a lint script?

"lint": "npx biome lint --write && npx tsc --noEmit"
  • First, run biome lint --write to fix stylistic and linting issues automatically.
  • Then, run tsc --noEmit to verify type correctness.
  • Using && means the type check runs only if linting succeeds.

Benefits of this approach

  • Simplifies tooling: Biome replaces separate ESLint + Prettier tools.
  • Ensures code quality: Both style and type errors are checked.
  • Speeds up development: Auto-fixing with Biome reduces manual formatting.
  • Modern tooling: Biome is designed with modern JS/TS ecosystems in mind.

Summary

This script reflects a modern setup where linting and type-checking are combined into one command, making it easy to maintain clean, consistent, and type-safe React apps with minimal config.