{"id":28712238,"url":"https://github.com/feross/standard","last_synced_at":"2025-06-14T23:01:53.985Z","repository":{"id":26440389,"uuid":"29891188","full_name":"standard/standard","owner":"standard","description":"🌟 JavaScript Style Guide, with linter \u0026 automatic code fixer","archived":false,"fork":false,"pushed_at":"2024-09-13T12:48:47.000Z","size":3659,"stargazers_count":29317,"open_issues_count":128,"forks_count":2318,"subscribers_count":466,"default_branch":"master","last_synced_at":"2025-06-11T10:12:35.954Z","etag":null,"topics":["development","ecmascript","es6","eslint","javascript","linter","nodejs","standard","static-code-analysis","style-guide"],"latest_commit_sha":null,"homepage":"https://standardjs.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"ambershen/Front-end-Developer-Interview-Questions","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/standard.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null},"funding":{"github":["standard","feross"]}},"created_at":"2015-01-27T01:23:31.000Z","updated_at":"2025-06-11T05:27:13.000Z","dependencies_parsed_at":"2023-01-16T22:30:26.419Z","dependency_job_id":"746444c4-b67e-466d-92a9-4be6f39d325f","html_url":"https://github.com/standard/standard","commit_stats":{"total_commits":1650,"total_committers":195,"mean_commits":8.461538461538462,"dds":0.3539393939393939,"last_synced_commit":"be621152d2c0a23079296035bb26e57cebe2f319"},"previous_names":["feross/standard"],"tags_count":184,"template":false,"template_full_name":null,"purl":"pkg:github/standard/standard","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/standard%2Fstandard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/standard%2Fstandard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/standard%2Fstandard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/standard%2Fstandard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/standard","download_url":"https://codeload.github.com/standard/standard/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/standard%2Fstandard/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259896112,"owners_count":22928325,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["development","ecmascript","es6","eslint","javascript","linter","nodejs","standard","static-code-analysis","style-guide"],"created_at":"2025-06-14T23:01:23.357Z","updated_at":"2025-06-14T23:01:53.896Z","avatar_url":"https://github.com/standard.png","language":"JavaScript","readme":"\u003ch1 align=\"center\"\u003e\n  \u003ca href=\"https://standardjs.com\"\u003e\u003cimg src=\"https://cdn.rawgit.com/standard/standard/master/sticker.svg\" alt=\"Standard - JavaScript Style Guide\" width=\"200\"\u003e\u003c/a\u003e\n  \u003cbr\u003e\n  JavaScript Standard Style\n  \u003cbr\u003e\n  \u003cbr\u003e\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://discord.gg/ZegqCBr\"\u003e\u003cimg src=\"https://img.shields.io/discord/612704110008991783?logo=discord\u0026logoColor=white\u0026label=Discord\u0026color=5865F2\" alt=\"discord\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/standard/standard/actions/workflows/test-external.yml\"\u003e\u003cimg src=\"https://github.com/standard/standard/actions/workflows/test-external.yml/badge.svg?branch=master\" alt=\"External tests\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/standard/standard/actions/workflows/test-internal.yml\"\u003e\u003cimg src=\"https://github.com/standard/standard/actions/workflows/test-internal.yml/badge.svg?branch=master\" alt=\"Internal tests\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://github.com/standard/standard/actions?query=workflow%3A%22Old+test%22\"\u003e\u003cimg src=\"https://github.com/standard/standard/workflows/Old%20test/badge.svg\" alt=\"status badge old Node test\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/standard\"\u003e\u003cimg src=\"https://img.shields.io/npm/v/standard.svg\" alt=\"npm version\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/eslint-config-standard\"\u003e\u003cimg src=\"https://img.shields.io/npm/dm/eslint-config-standard.svg\" alt=\"npm downloads\"\u003e\u003c/a\u003e\n  \u003ca href=\"https://standardjs.com\"\u003e\u003cimg src=\"https://img.shields.io/badge/code_style-standard-brightgreen.svg\" alt=\"Standard - JavaScript Style Guide\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch5 align=\"center\"\u003e\n  Sponsored by\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003ca href=\"https://socket.dev\"\u003e\u003cimg 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\"\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp;\u003ca href=\"https://wormhole.app/?utm_medium=sponsorship\u0026utm_source=standard\u0026utm_campaign=feross\"\u003e\u003cimg src=\"https://cdn.rawgit.com/standard/standard/master/docs/logos/wormhole.png\" alt=\"Wormhole\" height=50 valign=\"middle\"\u003e\u003c/a\u003e\n\u003c/h5\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"/docs/README-en.md\"\u003eEnglish\u003c/a\u003e •\n  \u003ca href=\"/docs/README-esla.md\"\u003eEspañol (Latinoamérica)\u003c/a\u003e •\n  \u003ca href=\"/docs/README-fr.md\"\u003eFrançais\u003c/a\u003e •\n  \u003ca href=\"/docs/README-id.md\"\u003eBahasa Indonesia\u003c/a\u003e •\n  \u003ca href=\"/docs/README-iteu.md\"\u003eItaliano (Italian)\u003c/a\u003e •\n  \u003ca href=\"/docs/README-ja.md\"\u003e日本語 (Japanese)\u003c/a\u003e •\n  \u003ca href=\"/docs/README-kokr.md\"\u003e한국어 (Korean)\u003c/a\u003e •\n  \u003ca href=\"/docs/README-ptbr.md\"\u003ePortuguês (Brasil)\u003c/a\u003e •\n  \u003ca href=\"/docs/README-zhcn.md\"\u003e简体中文 (Simplified Chinese)\u003c/a\u003e •\n  \u003ca href=\"/docs/README-zhtw.md\"\u003e繁體中文 (Taiwanese Mandarin)\u003c/a\u003e\n\u003c/p\u003e\n\n## JavaScript style guide, linter, and formatter\n\nThis module saves you (and others!) time in three ways:\n\n- **No configuration.** The easiest way to enforce code quality in your\n  project. No decisions to make. No `.eslintrc` files to manage. It just works.\n- **Automatically format code.** Just run `standard --fix` and say goodbye to\n  messy or inconsistent code.\n- **Catch style issues \u0026 programmer errors early.** Save precious code review\n  time by eliminating back-and-forth between reviewer \u0026 contributor.\n\nGive it a try by running `npx standard --fix` right now!\n\n## Table of Contents\n\n- Quick start\n  - [Install](#install)\n  - [Usage](#usage)\n  - [What you might do if you're clever](#what-you-might-do-if-youre-clever)\n- FAQ\n  - [Why should I use JavaScript Standard Style?](#why-should-i-use-javascript-standard-style)\n  - [Who uses JavaScript Standard Style?](#who-uses-javascript-standard-style)\n  - [Are there text editor plugins?](#are-there-text-editor-plugins)\n  - [Is there a readme badge?](#is-there-a-readme-badge)\n  - [I disagree with rule X, can you change it?](#i-disagree-with-rule-x-can-you-change-it)\n  - [But this isn't a real web standard!](#but-this-isnt-a-real-web-standard)\n  - [Is there an automatic formatter?](#is-there-an-automatic-formatter)\n  - [How do I ignore files?](#how-do-i-ignore-files)\n  - [How do I disable a rule?](#how-do-i-disable-a-rule)\n  - [I use a library that pollutes the global namespace. How do I prevent \"variable is not defined\" errors?](#i-use-a-library-that-pollutes-the-global-namespace-how-do-i-prevent-variable-is-not-defined-errors)\n  - [How do I use experimental JavaScript (ES Next) features?](#how-do-i-use-experimental-javascript-es-next-features)\n  - [Can I use a JavaScript language variant, like Flow or TypeScript?](#can-i-use-a-javascript-language-variant-like-flow-or-typescript)\n  - [What about Mocha, Jest, Jasmine, QUnit, etc?](#what-about-mocha-jest-jasmine-qunit-etc)\n  - [What about Web Workers and Service Workers?](#what-about-web-workers-and-service-workers)\n  - [What is the difference between warnings and errors?](#what-is-the-difference-between-warnings-and-errors)\n  - [Can I check code inside of Markdown or HTML files?](#can-i-check-code-inside-of-markdown-or-html-files)\n  - [Is there a Git `pre-commit` hook?](#is-there-a-git-pre-commit-hook)\n  - [How do I make the output all colorful and pretty?](#how-do-i-make-the-output-all-colorful-and-pretty)\n  - [Is there a Node.js API?](#is-there-a-nodejs-api)\n  - [How do I contribute to StandardJS?](#how-do-i-contribute-to-standardjs)\n\n## Install\n\nThe easiest way to use JavaScript Standard Style is to install it globally as a\nNode command line program. Run the following command in Terminal:\n\n```bash\n$ npm install standard --global\n```\n\nOr, you can install `standard` locally, for use in a single project:\n\n```bash\n$ npm install standard --save-dev\n```\n\n*Note: To run the preceding commands, [Node.js](http://nodejs.org) and [npm](https://npmjs.com) must be installed.*\n\n## Usage\n\nAfter you've installed `standard`, you should be able to use the `standard` program. The\nsimplest use case would be checking the style of all JavaScript files in the\ncurrent working directory:\n\n```bash\n$ standard\nError: Use JavaScript Standard Style\n  lib/torrent.js:950:11: Expected '===' and instead saw '=='.\n```\n\nIf you've installed `standard` locally, run with `npx` instead:\n\n```bash\n$ npx standard\n```\n\nYou can optionally pass in a directory (or directories) using the glob pattern. Be\nsure to quote paths containing glob patterns so that they are expanded by\n`standard` instead of your shell:\n\n```bash\n$ standard \"src/util/**/*.js\" \"test/**/*.js\"\n```\n\n**Note:** by default `standard` will look for all files matching the patterns:\n`**/*.js`, `**/*.jsx`.\n\n## What you might do if you're clever\n\n1. Add it to `package.json`\n\n   ```json\n   {\n     \"name\": \"my-cool-package\",\n     \"devDependencies\": {\n       \"standard\": \"*\"\n     },\n     \"scripts\": {\n       \"test\": \"standard \u0026\u0026 node my-tests.js\"\n     }\n   }\n   ```\n\n2. Style is checked automatically when you run `npm test`\n\n   ```bash\n   $ npm test\n   Error: Use JavaScript Standard Style\n     lib/torrent.js:950:11: Expected '===' and instead saw '=='.\n   ```\n\n3. Never give style feedback on a pull request again!\n\n## Why should I use JavaScript Standard Style?\n\nThe beauty of JavaScript Standard Style is that it's simple. No one wants to\nmaintain multiple hundred-line style configuration files for every module/project\nthey work on. Enough of this madness!\n\nThis module saves you (and others!) time in three ways:\n\n- **No configuration.** The easiest way to enforce consistent style in your\n  project. Just drop it in.\n- **Automatically format code.** Just run `standard --fix` and say goodbye to\n  messy or inconsistent code.\n- **Catch style issues \u0026 programmer errors early.** Save precious code review\n  time by eliminating back-and-forth between reviewer \u0026 contributor.\n\nAdopting `standard` style means ranking the importance of code clarity and\ncommunity conventions higher than personal style. This might not make sense for\n100% of projects and development cultures, however open source can be a hostile\nplace for newbies. Setting up clear, automated contributor expectations makes a\nproject healthier.\n\nFor more info, see the conference talk [\"Write Perfect Code with Standard and\nESLint\"](https://www.youtube.com/watch?v=kuHfMw8j4xk). In this talk, you'll learn\nabout linting, when to use `standard` versus `eslint`, and how `prettier` compares\nto `standard`.\n\n## Who uses JavaScript Standard Style?\n\n[\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/nodejs.png\u003e](https://nodejs.org) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/npm.png\u003e](https://www.npmjs.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/github.png\u003e](https://github.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/wormhole.png\u003e](https://wormhole.app) |\n|---|---|---|---|\n\n[\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/express.png\u003e](http://expressjs.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/electron.png\u003e](http://electron.atom.io) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/nuxtjs.png\u003e](https://nuxtjs.org/) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/elastic.png\u003e](https://www.elastic.co) |\n|---|---|---|---|\n\n| [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/mongodb.jpg\u003e](https://www.mongodb.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/zendesk.png\u003e](https://www.zendesk.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/brave.png\u003e](https://www.brave.com) | [\u003cimg width=190 src=https://assets.vercel.com/image/upload/v1621541666/front/assets/logotype-black-on-white.png\u003e](https://vercel.com) |\n|---|---|---|---|\n\n| [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/socket.png\u003e](https://socket.dev) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/nearform.png\u003e](http://www.nearform.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/typeform.png\u003e](https://www.typeform.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/gov-uk.png\u003e](https://gds.blog.gov.uk) |\n|---|---|---|---|\n\n| [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/heroku.png\u003e](https://www.heroku.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/saucelabs.png\u003e](https://saucelabs.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/automattic.png\u003e](https://automattic.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/godaddy.png\u003e](https://www.godaddy.com) |\n|---|---|---|---|\n\n| [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/webtorrent.png\u003e](https://webtorrent.io) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/ipfs.png\u003e](https://ipfs.io) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/dat.png\u003e](https://datproject.org) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/bitcoinjs.png\u003e](https://bitcoinjs.org) |\n|---|---|---|---|\n\n| [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/voltra.png\u003e](https://voltra.co) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/treasuredata.png\u003e](https://www.treasuredata.com) | [\u003cimg alt=\"Free MIDIs, MIDI file downloads\" width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/bitmidi.png\u003e](https://bitmidi.com) | [\u003cimg width=190 alt=\"College essays, AP notes\" src=https://cdn.rawgit.com/standard/standard/master/docs/logos/studynotes.jpg\u003e](https://www.apstudynotes.org) |\n|---|---|---|---|\n\n| [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/optiopay.png\u003e](https://www.optiopay.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/jaguar-landrover.png\u003e](https://www.jlrtechincubator.com/jlrti/) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/bustle.jpg\u003e](https://www.bustle.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/zentrick.png\u003e](https://www.zentrick.com) |\n|---|---|---|---|\n\n| [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/greenkeeper.png\u003e](https://greenkeeper.io) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/karma.png\u003e](https://karma-runner.github.io) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/taser.png\u003e](https://www.taser.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/neo4j.png\u003e](https://www.neo4j.com) |\n|---|---|---|---|\n\n| [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/rentograph.png\u003e](https://rentograph.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/eaze.png\u003e](https://www.eaze.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/ctrl-alt-deseat.png\u003e](https://www.ctrlaltdeseat.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/clevertech.png\u003e](https://clevertech.biz) |\n|---|---|---|---|\n\n| [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/aragon.png\u003e](https://aragon.org) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/flowsent.png\u003e](https://www.flowsent.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/puma-browser.png\u003e](https://www.pumabrowser.com/) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/webstorm.png\u003e](https://www.jetbrains.com/webstorm/) |\n|---|---|---|---|\n\n| [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/fastify.png\u003e](https://www.fastify.io) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/scuttlebutt.png\u003e](https://www.scuttlebutt.nz) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/solid.png\u003e](https://solid.inrupt.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/grab.png\u003e](https://www.grab.com) |\n|---|---|---|---|\n\n| [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/jublia.png\u003e](https://jublia.com/) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/atom.png\u003e](https://atom.io) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/peek.png\u003e](https://www.peek.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/dotenv.png\u003e](https://www.dotenv.org) |\n|---|---|---|---|\n\n| [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/nodesource.png\u003e](https://nodesource.com) | [\u003cimg width=190 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/searchapi.png\u003e](https://www.searchapi.io/) | Your Logo Here |  |\n|---|---|---|---|\n\n\nIn addition to companies, many community members use `standard` on packages that\nare [too numerous](https://raw.githubusercontent.com/standard/standard-packages/master/all.json)\nto list here.\n\n`standard` is also the top-starred linter in GitHub's\n[Clean Code Linter](https://github.com/showcases/clean-code-linters) showcase.\n\n## Are there text editor plugins?\n\nFirst, install `standard`. Then, install the appropriate plugin for your editor:\n\n### Sublime Text\n\nUsing **[Package Control][sublime-1]**, install **[SublimeLinter][sublime-2]** and\n**[SublimeLinter-contrib-standard][sublime-3]**.\n\nFor automatic formatting on save, install **[StandardFormat][sublime-4]**.\n\n[sublime-1]: https://packagecontrol.io/\n[sublime-2]: http://www.sublimelinter.com/en/latest/\n[sublime-3]: https://packagecontrol.io/packages/SublimeLinter-contrib-standard\n[sublime-4]: https://packagecontrol.io/packages/StandardFormat\n\n### Atom\n\nInstall **[linter-js-standard][atom-1]**.\n\nAlternatively, you can install **[linter-js-standard-engine][atom-4]**. Instead of\nbundling a version of `standard` it will automatically use the version installed\nin your current project. It will also work out of the box with other linters based\non **[standard-engine][atom-5]**.\n\nFor automatic formatting, install **[standard-formatter][atom-2]**. For snippets,\ninstall **[standardjs-snippets][atom-3]**.\n\n[atom-1]: https://atom.io/packages/linter-js-standard\n[atom-2]: https://atom.io/packages/standard-formatter\n[atom-3]: https://atom.io/packages/standardjs-snippets\n[atom-4]: https://atom.io/packages/linter-js-standard-engine\n[atom-5]: https://github.com/standard/standard-engine\n\n### Visual Studio Code\n\nInstall **[vscode-standard][vscode-1]**. (Includes support for automatic formatting.)\n\nFor JS snippets, install: **[vscode-standardjs-snippets][vscode-2]**. For React snippets, install **[vscode-react-standard][vscode-3]**.\n\n[vscode-1]: https://marketplace.visualstudio.com/items?itemName=standard.vscode-standard\n[vscode-2]: https://marketplace.visualstudio.com/items?itemName=capaj.vscode-standardjs-snippets\n[vscode-3]: https://marketplace.visualstudio.com/items?itemName=TimonVS.ReactSnippetsStandard\n\n### Vim\n\nInstall **[ale][vim-1]**. And add these lines to your `.vimrc` file.\n\n```vim\nlet g:ale_linters = {\n\\   'javascript': ['standard'],\n\\}\nlet g:ale_fixers = {'javascript': ['standard']}\n```\n\nThis sets standard as your only linter and fixer for javascript files and so prevents conflicts with eslint. For linting and automatic fixing on save, add these lines to `.vimrc`:\n```vim\nlet g:ale_lint_on_save = 1\nlet g:ale_fix_on_save = 1\n```\n\n\nAlternative plugins to consider include [neomake][vim-2] and [syntastic][vim-3], both of which have built-in support for `standard` (though configuration may be necessary).\n\n[vim-1]: https://github.com/w0rp/ale\n[vim-2]: https://github.com/neomake/neomake\n[vim-3]: https://github.com/vim-syntastic/syntastic\n\n### Emacs\n\nInstall **[Flycheck][emacs-1]** and check out the **[manual][emacs-2]** to learn\nhow to enable it in your projects.\n\n[emacs-1]: http://www.flycheck.org\n[emacs-2]: http://www.flycheck.org/en/latest/user/installation.html\n\n### Brackets\n\nSearch the extension registry for **[\"Standard Code Style\"][brackets-1]** and click \"Install\".\n\n[brackets-1]: https://github.com/ishamf/brackets-standard/\n\n### WebStorm (PhpStorm, IntelliJ, RubyMine, JetBrains, etc.)\n\nWebStorm [recently announced native support](https://blog.jetbrains.com/webstorm/2017/01/webstorm-2017-1-eap-171-2272/)\nfor `standard` directly in the IDE.\n\nIf you still prefer to configure `standard` manually, [follow this guide][webstorm-1]. This applies to all JetBrains products, including PhpStorm, IntelliJ, RubyMine, etc.\n\n[webstorm-1]: docs/webstorm.md\n\n## Is there a readme badge?\n\nYes! If you use `standard` in your project, you can include one of these badges in\nyour readme to let people know that your code is using the standard style.\n\n[![JavaScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard)\n\n```md\n[![JavaScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard)\n```\n\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n\n```md\n[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)\n```\n\n## I disagree with rule X, can you change it?\n\nNo. The whole point of `standard` is to save you time by avoiding\n[bikeshedding][bikeshedding] about code style. There are lots of debates online about\ntabs vs. spaces, etc. that will never be resolved. These debates just distract from\ngetting stuff done. At the end of the day you have to 'just pick something', and\nthat's the whole philosophy of `standard` -- its a bunch of sensible 'just pick\nsomething' opinions. Hopefully, users see the value in that over defending their\nown opinions.\n\nThere are a couple of similar packages for anyone who does not want to completely accept `standard`:\n- [semistandard](https://github.com/standard/semistandard) - standard, with semicolons\n- [standardx](https://github.com/standard/standardx) - standard, with custom tweaks\n\nIf you really want to configure hundreds of ESLint rules individually, you can\nalways use `eslint` directly with\n[eslint-config-standard](https://github.com/standard/eslint-config-standard) to\nlayer your changes on top.\n[`standard-eject`](https://github.com/josephfrazier/standard-eject) can help\nyou migrate from `standard` to `eslint` and `eslint-config-standard`.\n\nPro tip: Just use `standard` and move on. There are actual real problems that you\ncould spend your time solving! :P\n\n[bikeshedding]: https://docs.freebsd.org/en/books/faq/#bikeshed-painting\n\n## But this isn't a real web standard!\n\nOf course it's not! The style laid out here is not affiliated with any official web\nstandards groups, which is why this repo is called `standard/standard` and not\n`ECMA/standard`.\n\nThe word \"standard\" has more meanings than just \"web standard\" :-) For example:\n\n- This module helps hold our code to a high *standard of quality*.\n- This module ensures that new contributors follow some basic *style standards*.\n\n## Is there an automatic formatter?\n\nYes! You can use `standard --fix` to fix most issues automatically.\n\n`standard --fix` is built into `standard` for maximum convenience. Most problems\nare fixable, but some errors (like forgetting to handle errors) must be fixed\nmanually.\n\nTo save you time, `standard` outputs the message \"`Run standard --fix to\nautomatically fix some problems`\" when it detects problems that can be fixed\nautomatically.\n\n## How do I ignore files?\n\nCertain paths (`node_modules/`, `coverage/`, `vendor/`, `*.min.js`,\nand files/folders that begin with `.` like `.git/`) are automatically ignored.\n\nPaths in a project's root `.gitignore` file are also automatically ignored.\n\nSometimes you need to ignore additional folders or specific minified files. To do\nthat, add a `standard.ignore` property to `package.json`:\n\n```json\n\"standard\": {\n  \"ignore\": [\n    \"**/out/\",\n    \"/lib/select2/\",\n    \"/lib/ckeditor/\",\n    \"tmp.js\"\n  ]\n}\n```\n\n## How do I disable a rule?\n\nIn rare cases, you'll need to break a rule and hide the error generated by\n`standard`.\n\nJavaScript Standard Style uses [ESLint](http://eslint.org/) under-the-hood and\nyou can hide errors as you normally would if you used ESLint directly.\n\nDisable **all rules** on a specific line:\n\n```js\nfile = 'I know what I am doing' // eslint-disable-line\n```\n\nOr, disable **only** the `\"no-use-before-define\"` rule:\n\n```js\nfile = 'I know what I am doing' // eslint-disable-line no-use-before-define\n```\n\nOr, disable the `\"no-use-before-define\"` rule for **multiple lines**:\n\n```js\n/* eslint-disable no-use-before-define */\nconsole.log('offending code goes here...')\nconsole.log('offending code goes here...')\nconsole.log('offending code goes here...')\n/* eslint-enable no-use-before-define */\n```\n\n## I use a library that pollutes the global namespace. How do I prevent \"variable is not defined\" errors?\n\nSome packages (e.g. `mocha`) put their functions (e.g. `describe`, `it`) on the\nglobal object (poor form!). Since these functions are not defined or `require`'d\nanywhere in your code, `standard` will warn that you're using a variable that is\nnot defined (usually, this rule is really useful for catching typos!). But we want\nto disable it for these global variables.\n\nTo let `standard` (as well as humans reading your code) know that certain variables\nare global in your code, add this to the top of your file:\n\n```js\n/* global myVar1, myVar2 */\n```\n\nIf you have hundreds of files, it may be desirable to avoid adding comments to\nevery file. In this case, run:\n\n```bash\n$ standard --global myVar1 --global myVar2\n```\n\nOr, add this to `package.json`:\n\n```json\n{\n  \"standard\": {\n    \"globals\": [ \"myVar1\", \"myVar2\" ]\n  }\n}\n```\n\n*Note: `global` and `globals` are equivalent.*\n\n## How do I use experimental JavaScript (ES Next) features?\n\n`standard` supports the latest ECMAScript features, ES8 (ES2017), including\nlanguage feature proposals that are in \"Stage 4\" of the proposal process.\n\nTo support experimental language features, `standard` supports specifying a\ncustom JavaScript parser. Before using a custom parser, consider whether the added\ncomplexity is worth it.\n\nTo use a custom parser, first install it from npm:\n\n```bash\nnpm install @babel/eslint-parser --save-dev\n```\n\nThen run:\n\n```bash\n$ standard --parser @babel/eslint-parser\n```\n\nOr, add this to `package.json`:\n\n```json\n{\n  \"standard\": {\n    \"parser\": \"@babel/eslint-parser\"\n  }\n}\n```\n\n## Can I use a JavaScript language variant, like Flow or TypeScript?\n\n`standard` supports the latest ECMAScript features. However, Flow and TypeScript add new\nsyntax to the language, so they are not supported out-of-the-box.\n\nFor TypeScript, an official variant `ts-standard` is supported and maintained that provides a very\nsimilar experience to `standard`.\n\nFor other JavaScript language variants, `standard` supports specifying a custom JavaScript\nparser as well as an ESLint plugin to handle the changed syntax. Before using a JavaScript\nlanguage variant, consider whether the added complexity is worth it.\n\n### TypeScript\n\n[`ts-standard`](https://github.com/standard/ts-standard) is the officially supported variant for\nTypeScript. `ts-standard` supports all the same rules and options as `standard` and includes\nadditional TypeScript specific rules. `ts-standard` will even lint regular `javascript` files\nby setting the configuration in `tsconfig.json`.\n\n```bash\nnpm install ts-standard --save-dev\n```\n\nThen run (where `tsconfig.json` is located in the working directory):\n\n```bash\n$ ts-standard\n```\n\nOr, add this to `package.json`:\n\n```json\n{\n  \"ts-standard\": {\n    \"project\": \"./tsconfig.json\"\n  }\n}\n```\n\n*Note: To include additional files in linting such as test files, create a `tsconfig.eslint.json` file to use instead.*\n\nIf you really want to configure hundreds of ESLint rules individually, you can always use eslint\ndirectly with [`eslint-config-standard-with-typescript`](https://github.com/standard/eslint-config-standard-with-typescript)\nto layer your changes on top.\n\n### Flow\n\nTo use Flow, you need to run `standard` with `@babel/eslint-parser` as the parser and\n`eslint-plugin-flowtype` as a plugin.\n\n```bash\nnpm install @babel/eslint-parser eslint-plugin-flowtype --save-dev\n```\n\nThen run:\n\n```bash\n$ standard --parser @babel/eslint-parser --plugin flowtype\n```\n\nOr, add this to `package.json`:\n\n```json\n{\n  \"standard\": {\n    \"parser\": \"@babel/eslint-parser\",\n    \"plugins\": [ \"flowtype\" ]\n  }\n}\n```\n\n*Note: `plugin` and `plugins` are equivalent.*\n\n## What about Mocha, Jest, Jasmine, QUnit, etc?\n\nTo support mocha in test files, add this to the top of the test files:\n\n```js\n/* eslint-env mocha */\n```\n\nOr, run:\n\n```bash\n$ standard --env mocha\n```\n\nWhere `mocha` can be one of `jest`, `jasmine`, `qunit`, `phantomjs`, and so on. To see a\nfull list, check ESLint's\n[specifying environments](https://eslint.org/docs/latest/use/configure/language-options#specifying-environments)\ndocumentation. For a list of what globals are available for these environments,\ncheck the\n[globals](https://github.com/sindresorhus/globals/blob/master/globals.json) npm\nmodule.\n\n*Note: `env` and `envs` are equivalent.*\n\n## What about Web Workers and Service Workers?\n\nAdd this to the top of web worker files:\n\n```js\n/* eslint-env worker */\n```\n\nThis lets `standard` (as well as humans reading the code) know that `self` is a\nglobal in web worker code.\n\nFor Service workers, add this instead:\n\n```js\n/* eslint-env serviceworker */\n```\n\n## What is the difference between warnings and errors?\n\n`standard` treats all rule violations as errors, which means that `standard`\nwill exit with a non-zero (error) exit code.\n\nHowever, we may occasionally release a new major version of `standard`\nwhich changes a rule that affects the majority of `standard` users (for example,\ntransitioning from `var` to `let`/`const`). We do this only when we think the\nadvantage is worth the cost and only when the rule is\n[auto-fixable](#is-there-an-automatic-formatter).\n\nIn these situations, we have a \"transition period\" where the rule change is only\na \"warning\". Warnings don't cause `standard` to return a non-zero (error)\nexit code. However, a warning message will still print to the console. During\nthe transition period, `using standard --fix` will update your code so that it's\nready for the next major version.\n\nThe slow and careful approach is what we strive for with `standard`. We're\ngenerally extremely conservative in enforcing the usage of new language\nfeatures. We want using `standard` to be light and fun and so we're careful\nabout making changes that may get in your way. As always, you can\n[disable a rule](#how-do-i-disable-a-rule) at any time, if necessary.\n\n## Can I check code inside of Markdown or HTML files?\n\nTo check code inside Markdown files, use [`standard-markdown`](https://www.npmjs.com/package/standard-markdown).\n\nAlternatively, there are ESLint plugins that can check code inside Markdown, HTML,\nand many other types of language files:\n\nTo check code inside Markdown files, use an ESLint plugin:\n\n```bash\n$ npm install eslint-plugin-markdown\n```\n\nThen, to check JS that appears inside code blocks, run:\n\n```bash\n$ standard --plugin markdown '**/*.md'\n```\n\nTo check code inside HTML files, use an ESLint plugin:\n\n```bash\n$ npm install eslint-plugin-html\n```\n\nThen, to check JS that appears inside `\u003cscript\u003e` tags, run:\n\n```bash\n$ standard --plugin html '**/*.html'\n```\n\n## Is there a Git `pre-commit` hook?\n\nYes! Hooks are great for ensuring that unstyled code never even makes it into your repo.\nNever give style feedback on a pull request again!\n\nYou even have a choice...\n\n### Install your own hook\n\n```bash\n#!/bin/bash\n\n# Ensure all JavaScript files staged for commit pass standard code style\nfunction xargs-r() {\n  # Portable version of \"xargs -r\". The -r flag is a GNU extension that\n  # prevents xargs from running if there are no input files.\n  if IFS= read -r -d $'\\n' path; then\n    echo \"$path\" | cat - | xargs \"$@\"\n  fi\n}\ngit diff --name-only --cached --relative | grep '\\.jsx\\?$' | sed 's/[^[:alnum:]]/\\\\\u0026/g' | xargs-r -E '' -t standard\nif [[ $? -ne 0 ]]; then\n  echo 'JavaScript Standard Style errors were detected. Aborting commit.'\n  exit 1\nfi\n```\n\n### Use a `pre-commit` hook\n\nThe [pre-commit](https://pre-commit.com/) library allows hooks to be declared within a `.pre-commit-config.yaml` configuration file in the repo, and therefore more easily maintained across a team.\n\nUsers of pre-commit can simply add `standard` to their `.pre-commit-config.yaml` file, which will automatically fix `.js`, `.jsx`, `.mjs` and `.cjs` files:\n```yaml\n  - repo: https://github.com/standard/standard\n    rev: master\n    hooks:\n      - id: standard\n```\n\nAlternatively, for more advanced styling configurations, use `standard` within the [eslint hook](https://github.com/pre-commit/mirrors-eslint):\n```yaml\n  - repo: https://github.com/pre-commit/mirrors-eslint\n    rev: master\n    hooks:\n      - id: eslint\n        files: \\.[jt]sx?$  # *.js, *.jsx, *.ts and *.tsx\n        types: [file]\n        additional_dependencies:\n          - eslint@latest\n          - eslint-config-standard@latest\n          # and whatever other plugins...\n```\n\n## How do I make the output all colorful and pretty?\n\nThe built-in output is simple and straightforward, but if you like shiny things,\ninstall [snazzy](https://www.npmjs.com/package/snazzy):\n\n```bash\n$ npm install snazzy\n```\n\nAnd run:\n\n```bash\n$ standard | snazzy\n```\n\nThere's also [standard-tap](https://www.npmjs.com/package/standard-tap),\n[standard-json](https://www.npmjs.com/package/standard-json),\n[standard-reporter](https://www.npmjs.com/package/standard-reporter), and\n[standard-summary](https://www.npmjs.com/package/standard-summary).\n\n## Is there a Node.js API?\n\nYes!\n\n### `async standard.lintText(text, [opts])`\n\nLint the provided source `text`. An `opts` object may be provided:\n\n```js\n{\n  // unique to lintText\n  filename: '',         // path of file containing the text being linted\n\n  // common to lintText and lintFiles\n  cwd: '',              // current working directory (default: process.cwd())\n  fix: false,           // automatically fix problems\n  extensions: [],       // file extensions to lint (has sane defaults)\n  globals: [],          // custom global variables to declare\n  plugins: [],          // custom eslint plugins\n  envs: [],             // custom eslint environment\n  parser: '',           // custom js parser (e.g. babel-eslint)\n  usePackageJson: true, // use options from nearest package.json?\n  useGitIgnore: true    // use file ignore patterns from .gitignore?\n}\n```\n\nAll options are optional, though some ESLint plugins require the `filename` option.\n\nAdditional options may be loaded from a `package.json` if it's found for the current working directory. See below for further details.\n\nReturns a `Promise` resolving to the `results` or rejected with an `Error`.\n\nThe `results` object will contain the following properties:\n\n```js\nconst results = {\n  results: [\n    {\n      filePath: '',\n      messages: [\n        { ruleId: '', message: '', line: 0, column: 0 }\n      ],\n      errorCount: 0,\n      warningCount: 0,\n      output: '' // fixed source code (only present with {fix: true} option)\n    }\n  ],\n  errorCount: 0,\n  warningCount: 0\n}\n```\n\n### `async standard.lintFiles(files, [opts])`\n\nLint the provided `files` globs. An `opts` object may be provided:\n\n```js\n{\n  // unique to lintFiles\n  ignore: [],           // file globs to ignore (has sane defaults)\n\n  // common to lintText and lintFiles\n  cwd: '',              // current working directory (default: process.cwd())\n  fix: false,           // automatically fix problems\n  extensions: [],       // file extensions to lint (has sane defaults)\n  globals: [],          // custom global variables to declare\n  plugins: [],          // custom eslint plugins\n  envs: [],             // custom eslint environment\n  parser: '',           // custom js parser (e.g. babel-eslint)\n  usePackageJson: true, // use options from nearest package.json?\n  useGitIgnore: true    // use file ignore patterns from .gitignore?\n}\n```\n\nAdditional options may be loaded from a `package.json` if it's found for the current working directory. See below for further details.\n\nBoth `ignore` and `files` patterns are resolved relative to the current working directory.\n\nReturns a `Promise` resolving to the `results` or rejected with an `Error` (same as above).\n\n## How do I contribute to StandardJS?\n\nContributions are welcome! Check out the [issues](https://github.com/standard/standard/issues) or the [PRs](https://github.com/standard/standard/pulls), and make your own if you want something that you don't see there.\n\nWant to chat? [Join contributors on Discord](https://discord.gg/Jxjejujpmc).\n\nHere are some important packages in the `standard` ecosystem:\n\n- **[standard](https://github.com/standard/standard)** - this repo\n  - **[standard-engine](https://github.com/standard/standard-engine)** - cli engine for arbitrary eslint rules\n  - **[eslint-config-standard](https://github.com/standard/eslint-config-standard)** - eslint rules for standard\n  - **[eslint-config-standard-jsx](https://github.com/standard/eslint-config-standard-jsx)** - eslint rules for standard (JSX)\n  - **[eslint](https://github.com/eslint/eslint)** - the linter that powers standard\n- **[snazzy](https://github.com/standard/snazzy)** - pretty terminal output for standard\n- **[standard-www](https://github.com/standard/standard-www)** - code for https://standardjs.com\n- **[semistandard](https://github.com/standard/semistandard)** - standard, with semicolons (if you must)\n- **[standardx](https://github.com/standard/standardx)** - standard, with custom tweaks\n\nThere are also many **[editor plugins](#are-there-text-editor-plugins)**, a list of\n**[npm packages that use `standard`](https://github.com/standard/standard-packages)**,\nand an awesome list of\n**[packages in the `standard` ecosystem](https://github.com/standard/awesome-standard)**.\n\n## Security Policies and Procedures\n\nThe `standard` team and community take all security bugs in `standard` seriously. Please see our [security policies and procedures](https://github.com/standard/.github/blob/master/SECURITY.md) document to learn how to report issues.\n\n## License\n\n[MIT](LICENSE). Copyright (c) [Feross Aboukhadijeh](https://feross.org).\n","funding_links":["https://github.com/sponsors/standard","https://github.com/sponsors/feross"],"categories":["QA Tools [🔝](#readme)","Packages","Dev Tools","QA Tools","Preconfigured Configs with ESLint Set up","Uncategorized","包","Linting","Command-line apps","目录","Javascript","JavaScript","Linters","QA 工具","6. 在线工具"],"sub_categories":["Command-line apps","Miscellaneous","Runner","Other Configs","Uncategorized","命令行程序","命令行应用","Sass","JavaScript","运行器","24.3 Web Sockets","运行器e2e测试"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeross%2Fstandard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeross%2Fstandard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeross%2Fstandard/lists"}