1.4.3 • Published 10 years ago
modern-standard v1.4.3
JavaScript Modern Standard Style
One Style to Rule Them All
No decisions to make. No .eslintrc, .jshintrc, or .jscsrc files to manage. It just
works.
This module saves you (and others!) time in two ways:
- No configuration. The easiest way to enforce consistent style in your project. Just drop it in.
- Catch style errors before they're submitted in PRs. Saves precious code review time by eliminating back-and-forth between maintainer and contributor.
This is a linter for the future, based on the standard linter. It expects to be run within a babel environment, using the latest available babel syntax.
Rule Differences from Standard
- Always require parens for arrow functions, arrow-parens: always.
- Require commas in a multi-line block, comma-dangle: "always-multiline".
- Arrow functions everywhere, prefer-arrow-callback.
- Prefer spread instead of .apply where possible, prefer-spread.
- Template strings, prefer-template.
- Require a yield statement in generators, require-yield.
Methodology Differences from Standard
- We will freely update rules based on current best practices. Becuase of this we recommend that you lock down the current version of modern-standard.
- We are currently only targeting the latest javascript syntax, generally this code is transpiled by babel.
- We want to move faster and be more receptive to community issues and contributions.
- Everything is under one organization, and all linting code is in a single repo. This makes it much easier for contributors.
- This is an experiment and we're happy if standard adopts these rules or if this repository is forked.
Install
npm install modern-standardIntegrating modern-standard
Add it to
package.json{ "name": "my-package", "devDependencies": { "modern-standard": "*" }, "scripts": { "test": "modern-standard && node my-tests.js" } }Check style automatically when you run
npm test$ npm test Error: Use JavaScript Modern Standard Style lib/torrent.js:950:11: Expected '===' and instead saw '=='.Never give style feedback on a pull request again!
Text editor plugins
First, install modern-standard. Then, install the appropriate plugin for your editor:
Sublime Text
SublimeLinter-contrib-modern-standard is currently under construction and should be published in package control soon.
Atom
ide-plugin-atom can be found here: https://atom.io/packages/modern-standard-ide-plugin-atom