SkillAgentSearch skills...

Standard

🌟 JavaScript Style Guide, with linter & automatic code fixer

Install / Use

/learn @standard/Standard

README

<h1 align="center"> <a href="https://standardjs.com"><img src="https://cdn.rawgit.com/standard/standard/master/sticker.svg" alt="Standard - JavaScript Style Guide" width="200"></a> <br> JavaScript Standard Style <br> <br> </h1> <p align="center"> <a href="https://discord.gg/ZegqCBr"><img src="https://img.shields.io/discord/612704110008991783?logo=discord&logoColor=white&label=Discord&color=5865F2" alt="discord"></a> <a href="https://github.com/standard/standard/actions/workflows/test-external.yml"><img src="https://github.com/standard/standard/actions/workflows/test-external.yml/badge.svg?branch=master" alt="External tests"></a> <a href="https://github.com/standard/standard/actions/workflows/test-internal.yml"><img src="https://github.com/standard/standard/actions/workflows/test-internal.yml/badge.svg?branch=master" alt="Internal tests"></a> <a href="https://github.com/standard/standard/actions?query=workflow%3A%22Old+test%22"><img src="https://github.com/standard/standard/workflows/Old%20test/badge.svg" alt="status badge old Node test"></a> <a href="https://www.npmjs.com/package/standard"><img src="https://img.shields.io/npm/v/standard.svg" alt="npm version"></a> <a href="https://www.npmjs.com/package/eslint-config-standard"><img src="https://img.shields.io/npm/dm/eslint-config-standard.svg" alt="npm downloads"></a> <a href="https://standardjs.com"><img src="https://img.shields.io/badge/code_style-standard-brightgreen.svg" alt="Standard - JavaScript Style Guide"></a> </p> <h5 align="center"> Sponsored by&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://socket.dev"><img src="https://cdn.rawgit.com/standard/standard/master/docs/logos/socket.png" alt="Socket – Supply Chain Dependency Security for JavaScript and npm" height=50 valign="middle"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://wormhole.app/?utm_medium=sponsorship&utm_source=standard&utm_campaign=feross"><img src="https://cdn.rawgit.com/standard/standard/master/docs/logos/wormhole.png" alt="Wormhole" height=50 valign="middle"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://serpapi.com/"><img src="https://cdn.rawgit.com/standard/standard/master/docs/logos/serpapi.png" height=35 valign="middle"></a> </h5> <p align="center"> <a href="/docs/README-en.md">English</a> • <a href="/docs/README-esla.md">Español (Latinoamérica)</a> • <a href="/docs/README-fr.md">Français</a> • <a href="/docs/README-id.md">Bahasa Indonesia</a> • <a href="/docs/README-iteu.md">Italiano (Italian)</a> • <a href="/docs/README-ja.md">日本語 (Japanese)</a> • <a href="/docs/README-kokr.md">한국어 (Korean)</a> • <a href="/docs/README-ptbr.md">Português (Brasil)</a> • <a href="/docs/README-zhcn.md">简体中文 (Simplified Chinese)</a> • <a href="/docs/README-zhtw.md">繁體中文 (Taiwanese Mandarin)</a> </p>

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 .eslintrc files to manage. It just works.
  • Automatically format code. Just run standard --fix and 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

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

  1. Add it to package.json

    {
      "name": "my-cool-package",
      "devDependencies": {
        "standard": "*"
      },
      "scripts": {
        "test": "standard && node my-tests.js"
      }
    }
    
  2. 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 '=='.
    
  3. 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 --fix and 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

View on GitHub
GitHub Stars29.4k
CategoryDevelopment
Updated3h ago
Forks2.3k

Languages

JavaScript

Security Score

100/100

Audited on Mar 23, 2026

No findings