Standard is a JavaScript style guide, linter, and formatter designed for simplicity and consistency. It enforces a strict, opinionated code style with zero configuration, aiming to eliminate bike-shedding over stylistic choices. Currently at version 17.1.2, it sees active maintenance with minor releases frequently addressing dependency updates and bug fixes, while major versions, like v17.0.0, primarily focus on synchronizing with the broader ESLint ecosystem rather than introducing new rules. Key differentiators include its 'no configuration' philosophy, automatic code formatting via `standard --fix`, and early detection of style issues and common programmer errors, saving time in code reviews. It functions as an all-in-one alternative to separate tools like ESLint and Prettier, using ESLint under the hood but abstracting away its configuration complexity.
npm install standardVerified import paths — ran on the pinned version, not inferred.
Demonstrates `standard`'s automatic fixing capabilities by showing a JavaScript file with common style violations (semicolons, var, ==, double quotes) and the command to fix them.
Review the changelog for v17.0.0 to identify specific rule changes. Update ESLint disable comments (e.g., change `node/` to `n/`). Run `standard --fix` to automatically resolve most stylistic issues after upgrading.
Accept `standard`'s rules as-is. If customization is essential, migrate to direct ESLint usage and extend `eslint-config-standard` to layer your own changes, or consider `standardx` for minor tweaks.
Choose one primary formatter/linter. If using `standard`, it's recommended to disable other formatters (e.g., Prettier) in your editor's workspace settings. If you need both, consider 'ejecting' from `standard` and using ESLint with `eslint-config-standard` and `eslint-config-prettier` to manage conflicts.
Ensure your Node.js environment meets the minimum requirements (`^12.22.0 || ^14.17.0 || >=16.0.0`). Upgrade Node.js if necessary.
Change `==` to `===` or `!=` to `!==`.
Remove the unnecessary semicolon. `standard --fix` can often resolve these automatically.
Add a space: `function foo ()` instead of `function foo()` or `async () =>` instead of `async() =>`. `standard --fix` often corrects this.
Remove the unused variable or use it. If intentional, you might need to use `// eslint-disable-line no-unused-vars` (but this goes against `standard`'s philosophy).
Change `let` or `var` to `const` for variables that do not change their value. `standard --fix` can automate this.
No dependency data recorded yet.