• Stars
    star
    1,383
  • Rank 32,643 (Top 0.7 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created about 9 years ago
  • Updated 8 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

๐Ÿฆ All the goodness of `standard/standard` with semicolons sprinkled on top.

JavaScript Semi-Standard Style

tests npm downloads

One Semicolon for the Dark Lord on his dark throne

All the goodness of standard/standard with semicolons sprinkled on top.

Install

npm install semistandard

Rules

Importantly:

Badge

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

[![js-semistandard-style](https://raw.githubusercontent.com/standard/semistandard/master/badge.svg)](https://github.com/standard/semistandard)

js-semistandard-style

[![js-semistandard-style](https://img.shields.io/badge/code%20style-semistandard-brightgreen.svg)](https://github.com/standard/semistandard)

Usage

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 '=='.

Editor plugins

What you might do if you're clever

  1. Add it to package.json
{
  "name": "my-cool-package",
  "devDependencies": {
    "semistandard": "*"
  },
  "scripts": {
    "test": "semistandard && node my-normal-tests-littered-with-semicolons.js"
  }
}
  1. Check style automatically when you run npm test
$ npm test
Error: Code style check failed:
  lib/torrent.js:950:11: Expected '===' and instead saw '=='.
  1. Never give style feedback on a pull request again! (unless it's about semicolons)

Custom Parser

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"
  }
}

Vim

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

Ignoring files

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"
  ]
}

Make it look snazzy

If you want prettier output, just install the snazzy package and pipe semistandard to it:

$ semistandard --verbose | snazzy

See standard/standard for more information.

More Repositories

1

standard

๐ŸŒŸ JavaScript Style Guide, with linter & automatic code fixer
JavaScript
28,824
star
2

eslint-config-standard

ESLint Config for JavaScript Standard Style
TypeScript
2,546
star
3

eslint-config-standard-react

ESLint Shareable Config for React/JSX support in JavaScript Standard Style
JavaScript
453
star
4

ts-standard

Typescript style guide, linter, and formatter using StandardJS
JavaScript
428
star
5

snazzy

Format JavaScript Standard Style as Stylish (i.e. snazzy) output
JavaScript
420
star
6

awesome-standard

Documenting the explosion of packages in the standard ecosystem!
383
star
7

standardx

๐Ÿ’ฅ JavaScript Standard Style with custom tweaks
JavaScript
144
star
8

standard-engine

๐Ÿš’ The guts of `standard` modularized for reuse
JavaScript
144
star
9

eslint-plugin-standard

ESlint Rules for the Standard Linter
JavaScript
124
star
10

vscode-standard

VS Code extension for JavaScript Standard Style (`standard`) with automatic fixing
TypeScript
119
star
11

eslint-config-standard-jsx

ESLint Shareable Config for JSX support in JavaScript Standard Style
JavaScript
102
star
12

standard-loader

webpack loader for linting your code with https://github.com/feross/standard
JavaScript
68
star
13

eslint-config-semistandard

๐Ÿ’ฏ semistandard eslint sharable config
JavaScript
61
star
14

atom-standardjs-snippets

โšก A collection of JavaScript snippets for Atom, Standard Style
CoffeeScript
48
star
15

deglob

๐Ÿ“‚ Take a list of glob patterns and return an array of file locations, respecting `.gitignore` and allowing for ignore patterns via `package.json`.
JavaScript
39
star
16

atom-standard-formatter

Atom package to format code using Javascript Standard Style.
JavaScript
35
star
17

standard-packages

List of packages that use `standard`
JavaScript
33
star
18

standard-www

๐Ÿ‘† Website for JavaScript Standard Style (@standard)
CSS
30
star
19

standard-json

๐Ÿ”›Format JavaScript Standard Style output to a JSON array.
JavaScript
21
star
20

standard-tap

๐Ÿšฐ Format JavaScript Standard Style as TAP output
JavaScript
17
star
21

brackets-standard

Brackets extension for standard, a simple linter with sensible defaults. No longer maintained, Try using https://github.com/zaggino/brackets-eslint and https://github.com/feross/eslint-config-standard
JavaScript
10
star
22

.github

9
star
23

standard-demo

๐Ÿฐ Web demo of JavaScript Standard Style (Work In Progress)
JavaScript
9
star
24

standardizer

๐Ÿ’ซ A tiny service to lint and format JavaScript code using JavaScript Standard Style.
JavaScript
8
star