Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
semistandard
Advanced tools
All the goodness of feross/standard with semicolons sprinkled on top.
npm install semistandard
Importantly:
Use this in one of your projects? Include one of these badges in your readme to let people know that your code is using the standard style.
[![js-semistandard-style](https://cdn.rawgit.com/flet/semistandard/master/badge.svg)](https://github.com/Flet/semistandard)
[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg?style=flat-square)](https://github.com/Flet/semistandard)
The easiest way to use JavaScript Semi-Standard Style to check your code is to install it
globally as a Node command line program. To do so, simply run the following command in
your terminal (flag -g
installs semistandard
globally on your system, omit it if you want
to install in the current working directory):
npm install semistandard -g
After you've done that you should be able to use the semistandard
program. The simplest use
case would be checking the style of all JavaScript files in the current working directory:
$ semistandard
Error: Use JavaScript Semi-Standard Style
lib/torrent.js:950:11: Expected '===' and instead saw '=='.
package.json
{
"name": "my-cool-package",
"devDependencies": {
"semistandard": "*"
},
"scripts": {
"test": "semistandard && node my-normal-tests-littered-with-semicolons.js"
}
}
npm test
$ npm test
Error: Code style check failed:
lib/torrent.js:950:11: Expected '===' and instead saw '=='.
To use a custom parser, install it from npm (example: npm install babel-eslint
) and add this to your package.json:
{
"semistandard": {
"parser": "babel-eslint"
}
}
Install Syntastic and add these lines to .vimrc
:
let g:syntastic_javascript_checkers=['standard']
let g:syntastic_javascript_standard_exec = 'semistandard'
For automatic formatting on save, add these two lines to .vimrc
:
autocmd bufwritepost *.js silent !semistandard % --fix
set autoread
Just like in standard
, The paths node_modules/**
, *.min.js
, bundle.js
, coverage/**
, hidden files/folders
(beginning with .
), and all patterns in a project's root .gitignore
file are
automatically excluded when looking for .js
files to check.
Sometimes you need to ignore additional folders or specific minfied files. To do that, add
a semistandard.ignore
property to package.json
:
"semistandard": {
"ignore": [
"**/out/",
"/lib/select2/",
"/lib/ckeditor/",
"tmp.js"
]
}
snazzy
If you want prettier output, just install the snazzy
package and pipe semistandard
to it:
$ semistandard --verbose | snazzy
See feross/standard for more information.
10.0.0 2017-03-06
Updated to match the latest standard
rules and the newest standard-engine
features.
@feross did a great writeup on the standard
changelog that covers all the updates:
https://github.com/feross/standard/blob/master/CHANGELOG.md
In summary:
standard --fix
(Estimated % of affected standard users, based on test suite in parens)
typeof
expressions against string literals (valid-typeof) #629 (0%)FAQs
All the goodness of `feross/standard` with semicolons sprinkled on top.
The npm package semistandard receives a total of 14,076 weekly downloads. As such, semistandard popularity was classified as popular.
We found that semistandard demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.