Standard
🌟 JavaScript Style Guide, with linter & automatic code fixer
Install / Use
/learn @standard/StandardREADME
JavaScript style guide, linter, and formatter
This module saves you (and others!) time in three ways:
- No configuration. The easiest way to enforce code quality in your
project. No decisions to make. No
.eslintrcfiles to manage. It just works. - Automatically format code. Just run
standard --fixand say goodbye to messy or inconsistent code. - Catch style issues & programmer errors early. Save precious code review time by eliminating back-and-forth between reviewer & contributor.
Give it a try by running npx standard --fix right now!
Table of Contents
- Quick start
- FAQ
- Why should I use JavaScript Standard Style?
- Who uses JavaScript Standard Style?
- Are there text editor plugins?
- Is there a readme badge?
- I disagree with rule X, can you change it?
- But this isn't a real web standard!
- Is there an automatic formatter?
- How do I ignore files?
- How do I disable a rule?
- I use a library that pollutes the global namespace. How do I prevent "variable is not defined" errors?
- How do I use experimental JavaScript (ES Next) features?
- Can I use a JavaScript language variant, like Flow or TypeScript?
- What about Mocha, Jest, Jasmine, QUnit, etc?
- What about Web Workers and Service Workers?
- What is the difference between warnings and errors?
- Can I check code inside of Markdown or HTML files?
- Is there a Git
pre-commithook? - How do I make the output all colorful and pretty?
- Is there a Node.js API?
- How do I contribute to StandardJS?
Install
The easiest way to use JavaScript Standard Style is to install it globally as a Node command line program. Run the following command in Terminal:
$ npm install standard --global
Or, you can install standard locally, for use in a single project:
$ npm install standard --save-dev
Note: To run the preceding commands, Node.js and npm must be installed.
Usage
After you've installed standard, you should be able to use the standard program. The
simplest use case would be checking the style of all JavaScript files in the
current working directory:
$ standard
Error: Use JavaScript Standard Style
lib/torrent.js:950:11: Expected '===' and instead saw '=='.
If you've installed standard locally, run with npx instead:
$ npx standard
You can optionally pass in a directory (or directories) using the glob pattern. Be
sure to quote paths containing glob patterns so that they are expanded by
standard instead of your shell:
$ standard "src/util/**/*.js" "test/**/*.js"
Note: by default standard will look for all files matching the patterns:
**/*.js, **/*.jsx.
What you might do if you're clever
-
Add it to
package.json{ "name": "my-cool-package", "devDependencies": { "standard": "*" }, "scripts": { "test": "standard && node my-tests.js" } } -
Style is checked automatically when you run
npm test$ npm test Error: Use JavaScript Standard Style lib/torrent.js:950:11: Expected '===' and instead saw '=='. -
Never give style feedback on a pull request again!
Why should I use JavaScript Standard Style?
The beauty of JavaScript Standard Style is that it's simple. No one wants to maintain multiple hundred-line style configuration files for every module/project they work on. Enough of this madness!
This module saves you (and others!) time in three ways:
- No configuration. The easiest way to enforce consistent style in your project. Just drop it in.
- Automatically format code. Just run
standard --fixand say goodbye to messy or inconsistent code. - Catch style issues & programmer errors early. Save precious code review time by eliminating back-and-forth between reviewer & contributor.
Adopting standard style means ranking the importance of code clarity and
community conventions higher than personal style. This might not make sense for
100% of projects and development cultures, however open source can be a hostile
place for newbies. Setting up clear, automated contributor expectations makes a
project healthier.
For more info, see the conference talk "Write Perfect Code with Standard and
ESLint". In this talk, you'll learn
about linting, when to use standard versus eslint, and how prettier compares
to standard.
Who uses JavaScript Standard Style?
| <img width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/nodejs.png> | <img width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/npm.png> | <img width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/github.png> | <img width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/wormhole.png> | | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- |
| <img width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/express.png> | <img width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/electron.png> | <img width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/nuxtjs.png> | <img width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/elastic.png> | | ------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------
Related Skills
canvas
330.3kCanvas Skill Display HTML content on connected OpenClaw nodes (Mac app, iOS, Android). Overview The canvas tool lets you present web content on any connected node's canvas view. Great for: -
node-connect
330.3kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
81.3kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
Agent Development
81.3kThis skill should be used when the user asks to "create an agent", "add an agent", "write a subagent", "agent frontmatter", "when to use description", "agent examples", "agent tools", "agent colors", "autonomous agent", or needs guidance on agent structure, system prompts, triggering conditions, or agent development best practices for Claude Code plugins.
