Introduction
StandardJS is a JavaScript style guide, linter, and formatter rolled into one tool with zero configuration required. It enforces a consistent coding style across projects by combining a curated set of ESLint rules into a single opinionated package, eliminating debates about code formatting.
What StandardJS Does
- Lints JavaScript and TypeScript files against a fixed rule set with no
.eslintrcneeded - Auto-fixes formatting issues in place with the
--fixflag - Integrates with editors like VS Code, Vim, and Sublime for real-time feedback
- Supports JSX and Flow syntax out of the box
- Provides a sharable ESLint config (
eslint-config-standard) for custom setups
Architecture Overview
StandardJS is built on top of ESLint and bundles a carefully curated set of rules from eslint-config-standard. When you run standard, it invokes ESLint internally with a locked configuration, so there are no config files to manage. The --fix flag delegates to ESLint's auto-fix engine to rewrite code in place.
Self-Hosting & Configuration
- Install via npm:
npm install standard --save-dev - Add a lint script to
package.json:"scripts": {"lint": "standard"} - Use
standard --fixin CI pipelines for automatic formatting - Ignore specific files with a
standard.ignorefield inpackage.json - Override globals with
standard.globalsinpackage.jsonwhen needed
Key Features
- Zero configuration required to get started
- Catches common bugs like unused variables and accidental globals
- Automatic code formatting with
--fix - Supports modern ES2024+ syntax, JSX, and TypeScript via plugins
- Used by companies including npm, GitHub, and Brave
Comparison with Similar Tools
- ESLint — More flexible but requires configuration; StandardJS wraps ESLint with fixed rules
- Prettier — Focuses only on formatting, not linting; StandardJS does both
- Biome — Rust-based all-in-one tool; StandardJS is JS-native and ESLint-compatible
- XO — Similar opinionated linter by Sindre Sorhus; StandardJS has a larger community
FAQ
Q: Can I override specific rules?
A: StandardJS is intentionally opinionated and does not support per-rule overrides. If you need customization, use eslint-config-standard directly with ESLint.
Q: Does StandardJS work with TypeScript?
A: Yes. Use ts-standard or configure eslint-config-standard-with-typescript for full TypeScript support.
Q: Does it support semicolons?
A: StandardJS enforces no-semicolon style by default. If you prefer semicolons, use semistandard instead.
Q: How does it compare in performance to ESLint? A: Performance is equivalent since StandardJS runs ESLint under the hood. The difference is in configuration: StandardJS needs none.