{"id":16962360,"url":"https://github.com/aeharding/standard2","last_synced_at":"2026-05-09T09:04:25.954Z","repository":{"id":57369394,"uuid":"91906858","full_name":"aeharding/standard2","owner":"aeharding","description":"The next, better StandardJS. With semicolons.","archived":false,"fork":false,"pushed_at":"2017-05-20T17:59:43.000Z","size":1201,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-22T19:08:15.310Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aeharding.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-20T17:58:02.000Z","updated_at":"2023-12-15T19:41:28.000Z","dependencies_parsed_at":"2022-09-09T18:20:28.150Z","dependency_job_id":null,"html_url":"https://github.com/aeharding/standard2","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aeharding/standard2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeharding%2Fstandard2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeharding%2Fstandard2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeharding%2Fstandard2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeharding%2Fstandard2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aeharding","download_url":"https://codeload.github.com/aeharding/standard2/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aeharding%2Fstandard2/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261348750,"owners_count":23145313,"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":[],"created_at":"2024-10-13T23:06:18.044Z","updated_at":"2026-05-09T09:04:25.858Z","avatar_url":"https://github.com/aeharding.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  \u003ca href=\"https://standardjs.com\"\u003e\u003cimg src=\"https://cdn.rawgit.com/feross/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://travis-ci.org/feross/standard\"\u003e\u003cimg src=\"https://img.shields.io/travis/feross/standard/master.svg\" alt=\"travis\"\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\u003ch4 align=\"center\"\u003eOne JavaScript Style to Rule Them All\u003c/h4\u003e\n\n\u003cp align=\"center\"\u003e\n  Translations:\n  \u003ca href=\"docs/README-ptbr.md\"\u003ePortuguês\u003c/a\u003e,\n  \u003ca href=\"docs/README-esla.md\"\u003eSpanish\u003c/a\u003e,\n  \u003ca href=\"docs/README-zhtw.md\"\u003e繁體中文\u003c/a\u003e,\n  \u003ca href=\"docs/README-zhcn.md\"\u003e简体中文\u003c/a\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n## JavaScript style guide, with linter \u0026 automatic code fixer\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\nNo decisions to make. No `.eslintrc`, `.jshintrc`, or `.jscsrc` files to manage. It just\nworks.\n\nInstall with:\n\n```\nnpm install standard --save-dev\n```\n\n## The Rules\n\n- **2 spaces** – for indentation\n- **Single quotes for strings** – except to avoid escaping\n- **No unused variables** – this one catches *tons* of bugs!\n- **No semicolons** – [It's][1] [fine.][2] [Really!][3]\n- **Never start a line with `(`, `[`, or `` ` ``**\n  - This is the **only** gotcha with omitting semicolons – *automatically checked for you!*\n  - [More details][4]\n- **Space after keywords** `if (condition) { ... }`\n- **Space after function name** `function name (arg) { ... }`\n- Always use `===` instead of `==` – but `obj == null` is allowed to check `null || undefined`.\n- Always handle the node.js `err` function parameter\n- Always prefix browser globals with `window` – except `document` and `navigator` are okay\n  - Prevents accidental use of poorly-named browser globals like `open`, `length`,\n    `event`, and `name`.\n- **And [more goodness][5]** – *give `standard` a try today!*\n\n[1]: http://blog.izs.me/post/2353458699/an-open-letter-to-javascript-leaders-regarding\n[2]: http://inimino.org/~inimino/blog/javascript_semicolons\n[3]: https://www.youtube.com/watch?v=gsfbh17Ax9I\n[4]: RULES.md#semicolons\n[5]: RULES.md#javascript-standard-style\n\nTo get a better idea, take a look at\n[a sample file](https://github.com/expressjs/body-parser/blob/master/index.js) written\nin JavaScript Standard Style. Or, check out one of the\n[thousands of projects](https://raw.githubusercontent.com/feross/standard-packages/master/all.json)\nthat use `standard`!\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 hide a certain warning?](#how-do-i-hide-a-certain-warning)\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?](#can-i-use-a-javascript-language-variant-like-flow)\n  - [What about Mocha, Jasmine, QUnit, etc?](#what-about-mocha-jasmine-qunit-etc)\n  - [What about Web Workers?](#what-about-web-workers)\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 `standard`?](#how-do-i-contribute-to-standard)\n- [License](#license)\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\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\n## Who uses JavaScript Standard Style?\n\nLots of folks!\n\n[\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/npm.png\u003e](https://www.npmjs.com) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/github.png\u003e](https://github.com) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/opbeat.png\u003e](https://opbeat.com) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/nearform.png\u003e](http://www.nearform.com) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/brave.png\u003e](https://www.brave.com) |\n|---|---|---|---|---|\n\n| [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/zeit.png\u003e](https://zeit.co) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/zendesk.png\u003e](https://www.zendesk.com) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/mongodb.jpg\u003e](https://www.mongodb.com) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/typeform.jpg\u003e](https://www.typeform.com) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/gov-uk.png\u003e](https://gds.blog.gov.uk) |\n|---|---|---|---|---|\n\n[\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/express.png\u003e](http://expressjs.com) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/webtorrent.png\u003e](https://webtorrent.io) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/ipfs.png\u003e](https://ipfs.io) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/dat.png\u003e](https://datproject.org) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/bitcoinjs.png\u003e](https://bitcoinjs.org) |\n|---|---|---|---|---|\n\n[\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/atom.png\u003e](https://atom.io) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/electron.png\u003e](http://electron.atom.io) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/voltra.png\u003e](https://voltra.co) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/treasuredata.png\u003e](https://www.treasuredata.com) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/clevertech.png\u003e](https://clevertech.biz) |\n|---|---|---|---|---|\n\n[\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/studynotes.jpg\u003e](https://www.apstudynotes.org) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/optiopay.png\u003e](https://www.optiopay.com) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/jaguar-landrover.png\u003e](https://www.jlrtechincubator.com/jlrti/) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/bustle.jpg\u003e](https://www.bustle.com) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/zentrick.png\u003e](https://www.zentrick.com) |\n|---|---|---|---|---|\n\n[\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/nodesource.png\u003e](https://nodesource.com) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/greenkeeper.png\u003e](https://greenkeeper.io) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/karma.png\u003e](https://karma-runner.github.io) | [\u003cimg width=150 src=https://cdn.rawgit.com/feross/standard/master/docs/logos/taser.png\u003e](https://www.taser.com) |\n|---|---|---|---|\n\nIn addition to companies, many community members use `standard` on packages that\nare [too numerous](https://raw.githubusercontent.com/feross/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\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\n### Visual Studio Code\n\nInstall **[vscode-standardjs][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/chenxsan.vscode-standardjs\n[vscode-2]: https://marketplace.visualstudio.com/items?itemName=capaj.vscode-standardjs-snippets\n[vscode-3]: https://marketplace.visualstudio.com/items/TimonVS.ReactSnippetsStandard\n\n### Vim\n\nInstall **[ale][vim-1]**.\n\nFor automatic formatting on save, add these lines to `.vimrc`:\n\n```vim\nautocmd bufwritepost *.js silent !standard --fix %\nset autoread\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/feross/standard/master/badge.svg)](https://github.com/feross/standard)\n\n```md\n[![JavaScript Style Guide](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/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\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/feross/eslint-config-standard) to\nlayer your changes on top.\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://www.freebsd.org/doc/en/books/faq/misc.html#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 `feross/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 automatically 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`, `bundle.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 hide a certain warning?\n\nIn rare cases, you'll need to break a rule and hide the warning generated by\n`standard`.\n\nJavaScript Standard Style uses [ESLint](http://eslint.org/) under-the-hood and\nyou can hide warnings as you normally would if you used ESLint directly.\n\nTo get verbose output (so you can find the particular rule name to ignore), run:\n\n```bash\n$ standard --verbose\nError: Use JavaScript Standard Style\n  routes/error.js:20:36: 'file' was used before it was defined. (no-use-before-define)\n```\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, install it from npm (example: `npm install babel-eslint`)\nand run:\n\n```bash\n$ standard --parser babel-eslint\n```\n\nOr, add this to `package.json`:\n\n```json\n{\n  \"standard\": {\n    \"parser\": \"babel-eslint\"\n  }\n}\n```\n\nIf `standard` is installed globally (i.e. `npm install standard --global`), then\nbe sure to install `babel-eslint` globally as well, with\n`npm install babel-eslint --global`.\n\n## Can I use a JavaScript language variant, like Flow?\n\nBefore using a custom JS language variant, consider whether the added complexity\n(and effort required to get new contributors up-to-speed) is worth it.\n\n`standard` supports ESLint plugins. Use one of these to transform your code into\nvalid JavaScript before `standard` sees it. To use a custom parser, install it from\nnpm and run:\n\n```bash\n$ standard --plugin PLUGIN_NAME\n```\n\nOr, add this to `package.json`:\n\n```json\n{\n  \"standard\": {\n    \"plugins\": [ \"PLUGIN_NAME\" ]\n  }\n}\n```\n\nTo use Flow, you need to use `babel-eslint` as your parser. So, run\n`npm install eslint-plugin-flowtype babel-eslint`, then run:\n\n```bash\n$ standard --plugin flowtype --parser babel-eslint\n```\n\nOr, add this to `package.json`:\n\n```json\n{\n  \"standard\": {\n    \"plugins\": [ \"flowtype\" ],\n    \"parser\": \"babel-eslint\"\n  }\n}\n```\n\nIf `standard` is installed globally (i.e. `npm install standard --global`), then\nbe sure to install `eslint-plugin-flowtype` globally as well, with\n`npm install eslint-plugin-flowtype --global`.\n\n*Note: `plugin` and `plugins` are equivalent.*\n\n## What about Mocha, Jasmine, QUnit, etc?\n\nTo support mocha in your test files, add this to the beginning of your 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 `jasmine`, `qunit`, `phantomjs`, and so on. To see a\nfull list, check ESLint's\n[specifying environments](http://eslint.org/docs/user-guide/configuring.html#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?\n\nAdd this to the top of your files:\n\n```js\n/* eslint-env serviceworker */\n```\n\nThis lets `standard` (as well as humans reading your code) know that `self` is a\nglobal in web worker code.\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\nFunny you should ask!\n\n```sh\n#!/bin/sh\n# Ensure all javascript files staged for commit pass standard code style\ngit diff --name-only --cached --relative | grep '\\.jsx\\?$' | xargs standard\nif [ $? -ne 0 ]; then exit 1; fi\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 --verbose | 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### `standard.lintText(text, [opts], callback)`\n\nLint the provided source `text`. An `opts` object may be provided:\n\n```js\n{\n  cwd: '',      // current working directory (default: process.cwd())\n  filename: '', // path of the file containing the text being linted (optional, though some eslint plugins require it)\n  fix: false,   // automatically fix problems\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}\n```\n\nAdditional options may be loaded from a `package.json` if it's found for the\ncurrent working directory.\n\nThe `callback` will be called with an `Error` and `results` object.\n\nThe `results` object will contain the following properties:\n\n```js\nvar 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### `results = standard.lintTextSync(text, [opts])`\n\nSynchronous version of `standard.lintText()`. If an error occurs, an exception is\nthrown. Otherwise, a `results` object is returned.\n\n### `standard.lintFiles(files, [opts], callback)`\n\nLint the provided `files` globs. An `opts` object may be provided:\n\n```js\nvar opts = {\n  ignore: [],   // file globs to ignore (has sane defaults)\n  cwd: '',      // current working directory (default: process.cwd())\n  fix: false,   // automatically fix problems\n  globals: [],  // global variables to declare\n  plugins: [],  // eslint plugins\n  envs: [],     // eslint environment\n  parser: ''    // js parser (e.g. babel-eslint)\n}\n```\n\nThe `callback` will be called with an `Error` and `results` object (same as above).\n\n## How do I contribute to `standard`?\n\nContributions are welcome! Check out the [issues](https://github.com/feross/standard/issues) or the [PRs](https://github.com/feross/standard/pulls), and make your own if you want something that you don't see there.\n\nWant to chat? Join contributors on IRC in the `#standard` channel on freenode.\n\nHere are some important packages in the `standard` ecosystem:\n\n- **[standard](https://github.com/feross/standard)** - this repo\n  - **[standard-engine](https://github.com/flet/standard-engine)** - cli engine for arbitrary eslint rules\n  - **[eslint-config-standard](https://github.com/feross/eslint-config-standard)** - eslint rules for standard\n  - **[eslint-config-standard-jsx](https://github.com/feross/eslint-config-standard-jsx)** - eslint rules for standard (JSX)\n  - **[eslint-plugin-standard](https://github.com/xjamundx/eslint-plugin-standard)** - custom eslint rules for standard (not part of eslint core)\n  - **[eslint](https://github.com/eslint/eslint)** - the linter that powers standard\n- **[snazzy](https://github.com/feross/snazzy)** - pretty terminal output for standard\n- **[standard-www](https://github.com/feross/standard-www)** - code for https://standardjs.com\n- **[semistandard](https://github.com/Flet/semistandard)** - standard, with semicolons (if you must)\n\nThere are also many **[editor plugins](#are-there-text-editor-plugins)**, a list of\n**[npm packages that use `standard`](https://github.com/feross/standard-packages)**,\nand an awesome list of\n**[packages in the `standard` ecosystem](https://github.com/feross/awesome-standard)**.\n\n## License\n\n[MIT](LICENSE). Copyright (c) [Feross Aboukhadijeh](http://feross.org).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faeharding%2Fstandard2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faeharding%2Fstandard2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faeharding%2Fstandard2/lists"}