🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

standard

Package Overview
Dependencies
Maintainers
17
Versions
185
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

standard - npm Package Compare versions

Comparing version

to
11.0.0-beta.0

.editorconfig

@@ -6,2 +6,41 @@ # Change Log

## 11.0.0-beta.0 - 2017-12-14
This release has no new rules, but it does update to the latest version of `eslint`, which has some significant changes to exisitng rules. Most updates are to make rules more strict.
Thankfully, most will just need to run `standard --fix` to update their code to be compliant.
eslint 4:
- Bumped to 4.13.0.
- The `indent` rule is more strict.
- The `padded-blocks` rule is more strict.
- The `space-before-function-paren` rule is more strict.
- The `no-multi-spaces` rule is more strict.
- Minor improvements to
- `no-extra-parens`,
- `no-unexpected-multiline`,
- `no-regex-spaces`, and
- `space-unary-ops`
eslint-plugin-import:
- Bumped to 2.8.0.
- Updated for eslint 4.0 compatibility.
- Various small bug fixes included related to `import/*` rules.
eslint-plugin-node:
- The `no-deprecated-api` rule updated to with node 8 support and better node 6 support.
- eslint-plugin-promise:
- Bumped to 3.6.0.
eslint-plugin-react:
- Bumped to 5.0.0
- Fix jsx-indent crash
- Fix jsx-indent indentation calculation with nested JSX
- jsx-no-undef will not check the global scope by default.
- Fix jsx-curly-spacing newline with object literals bug
- Fix jsx-curly-spacing schema incompatibility with ESLint 4.2.0
- Fix alignment bug in jsx-indent
## 10.0.3 - 2017-08-06

@@ -8,0 +47,0 @@

39

docs/README-en.md

@@ -19,9 +19,9 @@ <h1 align="center">

<p align="center">
<a href="README-en.md">English</a> •
<a href="README-esla.md">Español (Latinoamérica)</a> •
<a href="README-iteu.md">Italiano (Italian)</a> •
<a href="README-kokr.md">한국어 (Korean)</a> •
<a href="README-ptbr.md">Português (Brasil)</a> •
<a href="README-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="README-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
<a href="/docs/README-en.md">English</a> •
<a href="/docs/README-esla.md">Español (Latinoamérica)</a> •
<a href="/docs/README-iteu.md">Italiano (Italian)</a> •
<a href="/docs/README-kokr.md">한국어 (Korean)</a> •
<a href="/docs/README-ptbr.md">Português (Brasil)</a> •
<a href="/docs/README-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="/docs/README-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
</p>

@@ -218,3 +218,3 @@

[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/rentograph.png>](https://rentograph.com) |
[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/rentograph.png>](https://rentograph.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/eaze.png>](https://www.eaze.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/ctrl-alt-deseat.png>](https://www.ctrlaltdeseat.com) | | |
|---|---|---|---|---|

@@ -344,2 +344,4 @@

layer your changes on top.
[`standard-eject`](https://github.com/josephfrazier/standard-eject) can help
you migrate from `standard` to `eslint` and `eslint-config-standard`.

@@ -650,7 +652,18 @@ Pro tip: Just use `standard` and move on. There are actual real problems that you

```sh
#!/bin/sh
# Ensure all javascript files staged for commit pass standard code style
git diff --name-only --cached --relative | grep '\.jsx\?$' | xargs standard
if [ $? -ne 0 ]; then exit 1; fi
```bash
#!/bin/bash
# Ensure all JavaScript files staged for commit pass standard code style
function xargs-r() {
# Portable version of "xargs -r". The -r flag is a GNU extension that
# prevents xargs from running if there are no input files.
if IFS= read -r -d '' path; then
{ echo -n "$path"; echo -ne "\0"; cat; } | xargs $@
fi
}
git diff -z --name-only --cached --relative | grep -z '\.jsx\?$' | xargs-r -0 -t standard
if [[ $? -ne 0 ]]; then
echo 'JavaScript Standard Style errors were detected. Aborting commit.'
exit 1
fi
```

@@ -657,0 +670,0 @@

@@ -19,9 +19,9 @@ <h1 align="center">

<p align="center">
<a href="README-en.md">English</a> •
<a href="README-esla.md">Español (Latinoamérica)</a> •
<a href="README-iteu.md">Italiano (Italian)</a> •
<a href="README-kokr.md">한국어 (Korean)</a> •
<a href="README-ptbr.md">Português (Brasil)</a> •
<a href="README-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="README-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
<a href="/docs/README-en.md">English</a> •
<a href="/docs/README-esla.md">Español (Latinoamérica)</a> •
<a href="/docs/README-iteu.md">Italiano (Italian)</a> •
<a href="/docs/README-kokr.md">한국어 (Korean)</a> •
<a href="/docs/README-ptbr.md">Português (Brasil)</a> •
<a href="/docs/README-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="/docs/README-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
</p>

@@ -210,5 +210,8 @@

[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/nodesource.png>](https://nodesource.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/greenkeeper.png>](https://greenkeeper.io) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/karma.png>](https://karma-runner.github.io) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/taser.png>](https://www.taser.com) |
[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/nodesource.png>](https://nodesource.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/greenkeeper.png>](https://greenkeeper.io) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/karma.png>](https://karma-runner.github.io) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/taser.png>](https://www.taser.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/neo4j.png>](https://www.neo4j.com) |
|---|---|---|---|---|
[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/rentograph.png>](https://rentograph.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/eaze.png>](https://www.eaze.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/ctrl-alt-deseat.png>](https://www.ctrlaltdeseat.com) | | |
|---|---|---|---|---|
Adicionalmente a compañías, muchos miembros de la comunidad usan `standard` en modulos que son

@@ -550,10 +553,21 @@ [muy numerosos](https://raw.githubusercontent.com/standard/standard-packages/master/all.json) para listar aquí.

```sh
#!/bin/sh
```bash
#!/bin/bash
# Asegura que todos los archivos javascript especificados
# para hacer commit pasan los estandares de estilo de código
git diff --name-only --cached --relative | grep '\.jsx\?$' | xargs standard
if [ $? -ne 0 ]; then exit 1; fi
function xargs-r() {
# Portable version of "xargs -r". The -r flag is a GNU extension that
# prevents xargs from running if there are no input files.
if IFS= read -r -d '' path; then
{ echo -n "$path"; echo -ne "\0"; cat; } | xargs $@
fi
}
git diff -z --name-only --cached --relative | grep -z '\.jsx\?$' | xargs-r -0 -t standard
if [[ $? -ne 0 ]]; then
echo 'JavaScript Standard Style errors were detected. Aborting commit.'
exit 1
fi
```
## ¿Cómo hago la salida (output) toda colorida y *bonita*?

@@ -560,0 +574,0 @@

@@ -19,9 +19,9 @@ <h1 align="center">

<p align="center">
<a href="README-en.md">English</a> •
<a href="README-esla.md">Español (Latinoamérica)</a> •
<a href="README-iteu.md">Italiano (Italian)</a> •
<a href="README-kokr.md">한국어 (Korean)</a> •
<a href="README-ptbr.md">Português (Brasil)</a> •
<a href="README-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="README-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
<a href="/docs/README-en.md">English</a> •
<a href="/docs/README-esla.md">Español (Latinoamérica)</a> •
<a href="/docs/README-iteu.md">Italiano (Italian)</a> •
<a href="/docs/README-kokr.md">한국어 (Korean)</a> •
<a href="/docs/README-ptbr.md">Português (Brasil)</a> •
<a href="/docs/README-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="/docs/README-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
</p>

@@ -189,3 +189,2 @@

[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/npm.png>](https://www.npmjs.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/github.png>](https://github.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/opbeat.png>](https://opbeat.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/nearform.png>](http://www.nearform.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/brave.png>](https://www.brave.com) |

@@ -209,3 +208,6 @@ |---|---|---|---|---|

[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/rentograph.png>](https://rentograph.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/eaze.png>](https://www.eaze.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/ctrl-alt-deseat.png>](https://www.ctrlaltdeseat.com) | | |
|---|---|---|---|---|
Oltre alle aziende, anche molti membri della comunità usano `standard` su pacchetti che sono [troppo numerosi](https://raw.githubusercontent.com/standard/standard-packages/master/all.json) da mostrare qui.

@@ -553,10 +555,20 @@

```sh
#!/bin/sh
```bash
#!/bin/bash
#Assicurati che tutti i file javascript pronti per il commit passano lo standard code style
git diff --name-only --cached --relative | grep '\.jsx\?$' | xargs standard
if [ $? -ne 0 ]; then exit 1; fi
function xargs-r() {
# Portable version of "xargs -r". The -r flag is a GNU extension that
# prevents xargs from running if there are no input files.
if IFS= read -r -d '' path; then
{ echo -n "$path"; echo -ne "\0"; cat; } | xargs $@
fi
}
git diff -z --name-only --cached --relative | grep -z '\.jsx\?$' | xargs-r -0 -t standard
if [[ $? -ne 0 ]]; then
echo 'JavaScript Standard Style errors were detected. Aborting commit.'
exit 1
fi
```
## Come posso mostrare l'output del mio codice colorato e *carino*?

@@ -563,0 +575,0 @@

@@ -19,9 +19,9 @@ <h1 align="center">

<p align="center">
<a href="README-en.md">English</a> •
<a href="README-esla.md">Español (Latinoamérica)</a> •
<a href="README-iteu.md">Italiano (Italian)</a> •
<a href="README-kokr.md">한국어 (Korean)</a> •
<a href="README-ptbr.md">Português (Brasil)</a> •
<a href="README-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="README-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
<a href="/docs/README-en.md">English</a> •
<a href="/docs/README-esla.md">Español (Latinoamérica)</a> •
<a href="/docs/README-iteu.md">Italiano (Italian)</a> •
<a href="/docs/README-kokr.md">한국어 (Korean)</a> •
<a href="/docs/README-ptbr.md">Português (Brasil)</a> •
<a href="/docs/README-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="/docs/README-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
</p>

@@ -91,3 +91,3 @@

- [실험용 JavaScript (ES Next) 기능은 어떻게 사용하나요?](#실험용-javascript-es-next-기능은-어떻게-사용하나요)
- [Flow와 같은 JavaScrpt 언어 변형을 사용할 수 있나요?](#flow와-같은-javascrpt-언어-변형을-사용할-수-있나요)
- [javaScrpt와 다른 Flow 또는 typescript에서도 사용할 수 있나요?](#javaScrpt와-다른-Flow-또는-typescript에서도-사용할-수-있나요)
- [Mocha, Jasmine, QUnit 등은 어떻습니까?](#mocha-jasmine-qunit-등은-어떻습니까)

@@ -196,5 +196,8 @@ - [Web Workes는 어떻습니까?](#web-workes는-어떻습니까)

[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/nodesource.png>](https://nodesource.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/greenkeeper.png>](https://greenkeeper.io) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/karma.png>](https://karma-runner.github.io) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/taser.png>](https://www.taser.com) |
|---|---|---|---|
[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/nodesource.png>](https://nodesource.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/greenkeeper.png>](https://greenkeeper.io) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/karma.png>](https://karma-runner.github.io) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/taser.png>](https://www.taser.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/neo4j.png>](https://www.neo4j.com) |
|---|---|---|---|---|
[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/rentograph.png>](https://rentograph.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/eaze.png>](https://www.eaze.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/ctrl-alt-deseat.png>](https://www.ctrlaltdeseat.com) | | |
|---|---|---|---|---|
회사 이외에 많은 커뮤니티 회원은 여기에 나열하기에는 [너무 많은](https://raw.githubusercontent.com/standard/standard-packages/master/all.json) 패키지들이 `standard`를 사용합니다.

@@ -223,2 +226,4 @@

또는 **[linter-js-standard-engine][atom-4]** 를 설치할 수 있습니다. `standard` 버전을 번들링하는 대신 현재 프로젝트에 설치된 버전을 자동으로 사용합니다. 또한 **[standard-engine][atom-5]**를 기반으로하는 다른 linter와 함께 작동합니다.
저장시 자동포멧을 적용하려면 **[standard-formatter][atom-2]** 를 설치합니다. 스니펫의 경우 **[standardjs-snippets][atom-3]** 을 설치합니다.

@@ -229,2 +234,4 @@

[atom-3]: https://atom.io/packages/standardjs-snippets
[atom-4]: https://atom.io/packages/linter-js-standard-engine
[atom-5]: https://github.com/Flet/standard-engine

@@ -302,2 +309,3 @@ ### Visual Studio Code

수백 개의 ESLint 규칙을 개별적으로 구성하려는 경우 `eslint`를 직접 [eslint-config-standard](https://github.com/standard/eslint-config-standard)와 함께 사용하여 변경 사항을 맨 위에 배치 할 수 있습니다.
[`standard-eject`](https://github.com/josephfrazier/standard-eject)는`standard`에서 `eslint`와 `eslint-config-standard` 로의 마이그레이션을 도와 줄 수 있습니다.

@@ -320,3 +328,3 @@ 팁 : 표준을 사용하고 계속 진행하십시오. 당신의 시간을 소비하고 있는 실질적인 문제를 해결하세요! :P

예! `standard --fix`를 사용하면 자동으로 대부분의 문제를 자동으로 해결할 수 있습니다.
예! 대부분의 이슈를 자동으로 수정하려면 `standard --fix`를 사용할 수 있습니다.

@@ -416,3 +424,11 @@ `standard --fix`는 최대의 편의를 위해 `standard`에 내장되어 있습니다. 대부분의 문제점은 고칠 수 있지만 일부 오류(오류 처리를 잊어 버리는 것)는 수동으로 해결해야합니다.

커스텀파서를 사용하기 전에 먼저 npm모듈을 설치합니다.
```bash
npm install babel-eslint --save-dev
```
다음을 수행합니다.
```bash
$ standard --parser babel-eslint

@@ -433,12 +449,22 @@ ```

## Flow와 같은 JavaScrpt 언어 변형을 사용할 수 있나요?
## javaScrpt와 다른 Flow 또는 typescript에서도 사용할 수 있나요?
커스텀 JS 언어 변형을 사용하기 전에 추가된 복잡성 (그리고 새로운 기여자를 최신으로 만드는데 필요한 노력)이 그만한 가치가 있는지 고려하십시오.
`standard`는 최신 ECMAScript 기능을 지원합니다. 그러나 Flow 및 TypeScript는 새로운 구문을 언어에 추가해야하기 때문에 즉시 사용할 수 없습니다.
`standard`는 ESLint 플러그인을 지원합니다. `standard` 중 하나를 보기 전에 코드를 유효한 JavaScript로 변환하려면 이 중 하나를 사용하십시오. 맞춤 구문 분석기를 사용하려면 npm에서 설치하고 다음을 실행하십시오.
JavaScript 언어 변형을 지원하기 위해 `standard`는 변경된 구문을 처리 할 수있는 ESLint 플러그인뿐만 아니라 맞춤 JavaScript 파서를 지정하는 것을 지원합니다. JavaScript 언어 변형을 사용하기 전에 추가된 복잡성이 가치가 있는지 고려하십시오.
### Flow
Flow를 사용하려면`babel-eslint`를 파서로 사용하고`eslint-plugin-flowtype`을 플러그인으로 사용하여`standard`를 실행해야합니다.
```bash
$ standard --plugin 플러그인_이름
npm install babel-eslint eslint-plugin-flowtype --save-dev
```
다음을 실행하세요.
```bash
$ standard --parser babel-eslint --plugin flowtype
```
아니면, `package.json`에 아래 코드를 추가하세요.

@@ -449,3 +475,4 @@

"standard": {
"plugins": [ "플러그인_이름" ]
"parser": "babel-eslint",
"plugins": [ "flowtype" ]
}

@@ -455,8 +482,21 @@ }

Flow를 사용하려면 `babel-eslint`를 파서로 사용해야합니다. 따라서 `npm install eslint-plugin-flowtype babel-eslint`를 수행한 후에, 다음을 실행하십시오.
*주의 :`plugin`과`plugins`는 동일합니다.*
만약`standard`가 전역 적으로 설치된다면 (즉,`npm install standard - global`), `babel-eslint`와`eslint-plugin-flowtype`도 함께 설치해야합니다. `npm install babel-eslint eslint-plugin-flowtype --global`.
### TypeScript
TypeScript를 사용하려면`typescript-eslint-parser`를 파서로`standard`를, 플러그인으로`eslint-plugin-typescript`를 실행하고 표준을 lint`* .ts` 파일로 보내야합니다. (기본값이 아니기 때문)
```bash
$ standard --plugin flowtype --parser babel-eslint
npm install typescript-eslint-parser eslint-plugin-typescript --save-dev
```
다음을 실행합니다.
```bash
$ standard --parser typescript-eslint-parser --plugin typescript *.ts
```
아니면, `package.json`에 아래 코드를 추가하세요.

@@ -467,4 +507,4 @@

"standard": {
"plugins": [ "flowtype" ],
"parser": "babel-eslint"
"parser": "typescript-eslint-parser",
"plugins": [ "typescript" ]
}

@@ -474,6 +514,10 @@ }

`standard`가 전역으로 설치된 경우 (즉, `npm install standard --global`) `npm install-eslint-plugin-flowtype --global`을 사용하여 `eslint-plugin-flowtype`을 전역으로 설치해야합니다.
`package.json`을 사용하면 다음과 같이 실행할 수 있습니다.
**참고 : 플러그인 및 플러그인은 동일합니다.**
```bash
standard *.ts
```
`standard`가 전역으로 설치된 경우 (즉, `npm install standard --global`) `npm install typescript-eslint-parser eslint-plugin-typescript --global`을 사용하여 `eslint-plugin-flowtype`와 `typescript-eslint-parser`를 전역으로 설치해야합니다.
## Mocha, Jasmine, QUnit 등은 어떻습니까?

@@ -505,3 +549,3 @@

이것은 `standard` (자신의 코드를 읽는 사람뿐만 아니라)이 web worker 코드에서 `자신`이 전역(global)이라는 것을 알 수 있게 해줍니다.
이것은 `standard` (코드를 읽는 사람뿐만 아니라)이 web worker 코드에서 `자신`이 전역(global)이라는 것을 알 수 있게 해줍니다.

@@ -542,7 +586,18 @@ ## Markdown 또는 HTML 파일 내부의 코드를 확인할 수 있나요?

```sh
#!/bin/sh
```bash
#!/bin/bash
# 커밋을 위해 준비된 모든 자바 스크립트 파일이 표준 코드 스타일을 통과하는지 확인합니다.
git diff --name-only --cached --relative | grep '\.jsx\?$' | xargs standard
if [ $? -ne 0 ]; then exit 1; fi
function xargs-r() {
# Portable version of "xargs -r". The -r flag is a GNU extension that
# prevents xargs from running if there are no input files.
if IFS= read -r -d '' path; then
{ echo -n "$path"; echo -ne "\0"; cat; } | xargs $@
fi
}
git diff -z --name-only --cached --relative | grep -z '\.jsx\?$' | xargs-r -0 -t standard
if [[ $? -ne 0 ]]; then
echo 'JavaScript Standard Style errors were detected. Aborting commit.'
exit 1
fi
```

@@ -549,0 +604,0 @@

@@ -19,9 +19,9 @@ <h1 align="center">

<p align="center">
<a href="README-en.md">English</a> •
<a href="README-esla.md">Español (Latinoamérica)</a> •
<a href="README-iteu.md">Italiano (Italian)</a> •
<a href="README-kokr.md">한국어 (Korean)</a> •
<a href="README-ptbr.md">Português (Brasil)</a> •
<a href="README-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="README-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
<a href="/docs/README-en.md">English</a> •
<a href="/docs/README-esla.md">Español (Latinoamérica)</a> •
<a href="/docs/README-iteu.md">Italiano (Italian)</a> •
<a href="/docs/README-kokr.md">한국어 (Korean)</a> •
<a href="/docs/README-ptbr.md">Português (Brasil)</a> •
<a href="/docs/README-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="/docs/README-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
</p>

@@ -451,7 +451,18 @@

```sh
#!/bin/sh
```bash
#!/bin/bash
# Ensure all javascript files staged for commit pass standard code style
git diff --name-only --cached --relative | grep '\.jsx\?$' | xargs standard
if [ $? -ne 0 ]; then exit 1; fi
function xargs-r() {
# Portable version of "xargs -r". The -r flag is a GNU extension that
# prevents xargs from running if there are no input files.
if IFS= read -r -d '' path; then
{ echo -n "$path"; echo -ne "\0"; cat; } | xargs $@
fi
}
git diff -z --name-only --cached --relative | grep -z '\.jsx\?$' | xargs-r -0 -t standard
if [[ $? -ne 0 ]]; then
echo 'JavaScript Standard Style errors were detected. Aborting commit.'
exit 1
fi
```

@@ -458,0 +469,0 @@

@@ -19,9 +19,9 @@ <h1 align="center">

<p align="center">
<a href="README-en.md">English</a> •
<a href="README-esla.md">Español (Latinoamérica)</a> •
<a href="README-iteu.md">Italiano (Italian)</a> •
<a href="README-kokr.md">한국어 (Korean)</a> •
<a href="README-ptbr.md">Português (Brasil)</a> •
<a href="README-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="README-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
<a href="/docs/README-en.md">English</a> •
<a href="/docs/README-esla.md">Español (Latinoamérica)</a> •
<a href="/docs/README-iteu.md">Italiano (Italian)</a> •
<a href="/docs/README-kokr.md">한국어 (Korean)</a> •
<a href="/docs/README-ptbr.md">Português (Brasil)</a> •
<a href="/docs/README-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="/docs/README-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
</p>

@@ -192,5 +192,8 @@

[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/nodesource.png>](https://nodesource.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/greenkeeper.png>](https://greenkeeper.io) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/karma.png>](https://karma-runner.github.io) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/taser.png>](https://www.taser.com) |
|---|---|---|---|
[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/nodesource.png>](https://nodesource.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/greenkeeper.png>](https://greenkeeper.io) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/karma.png>](https://karma-runner.github.io) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/taser.png>](https://www.taser.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/neo4j.png>](https://www.neo4j.com) |
|---|---|---|---|---|
[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/rentograph.png>](https://rentograph.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/eaze.png>](https://www.eaze.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/ctrl-alt-deseat.png>](https://www.ctrlaltdeseat.com) | | |
|---|---|---|---|---|
除公司组织外,[很多个人](https://raw.githubusercontent.com/standard/standard-packages/master/all.json)也在项目中使用,这里就不一一罗列了。

@@ -512,7 +515,18 @@

```sh
#!/bin/sh
```bash
#!/bin/bash
# 确保将要提交的所有 JavaScript 代码通过 standard 规范的检查
git diff --name-only --cached --relative | grep '\.jsx\?$' | xargs standard
if [ $? -ne 0 ]; then exit 1; fi
function xargs-r() {
# Portable version of "xargs -r". The -r flag is a GNU extension that
# prevents xargs from running if there are no input files.
if IFS= read -r -d '' path; then
{ echo -n "$path"; echo -ne "\0"; cat; } | xargs $@
fi
}
git diff -z --name-only --cached --relative | grep -z '\.jsx\?$' | xargs-r -0 -t standard
if [[ $? -ne 0 ]]; then
echo 'JavaScript Standard Style errors were detected. Aborting commit.'
exit 1
fi
```

@@ -621,3 +635,3 @@

- **[standard-www](https://github.com/standard/standard-www)** - https://standardjs.com 站点的源码
- **[semistandard](https://github.com/Flet/semistandard)** - standard 规范带逗号的版本(如果你需要的话)
- **[semistandard](https://github.com/Flet/semistandard)** - standard 规范带分号的版本(如果你需要的话)

@@ -624,0 +638,0 @@ 还有很多 **[编辑器插件](#text-editor-plugins)**、一个

@@ -19,9 +19,9 @@ <h1 align="center">

<p align="center">
<a href="README-en.md">English</a> •
<a href="README-esla.md">Español (Latinoamérica)</a> •
<a href="README-iteu.md">Italiano (Italian)</a> •
<a href="README-kokr.md">한국어 (Korean)</a> •
<a href="README-ptbr.md">Português (Brasil)</a> •
<a href="README-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="README-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
<a href="/docs/README-en.md">English</a> •
<a href="/docs/README-esla.md">Español (Latinoamérica)</a> •
<a href="/docs/README-iteu.md">Italiano (Italian)</a> •
<a href="/docs/README-kokr.md">한국어 (Korean)</a> •
<a href="/docs/README-ptbr.md">Português (Brasil)</a> •
<a href="/docs/README-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="/docs/README-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
</p>

@@ -171,20 +171,23 @@

[<img width=150 src=../docs/logos/npm.png>](https://www.npmjs.com) | [<img width=150 src=../docs/logos/github.png>](https://github.com) | [<img width=150 src=../docs/logos/opbeat.png>](https://opbeat.com) | [<img width=150 src=../docs/logos/nearform.png>](http://www.nearform.com) | [<img width=150 src=../docs/logos/brave.png>](https://www.brave.com) |
[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/npm.png>](https://www.npmjs.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/github.png>](https://github.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/opbeat.png>](https://opbeat.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/nearform.png>](http://www.nearform.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/brave.png>](https://www.brave.com) |
|---|---|---|---|---|
| [<img width=150 src=../docs/logos/zeit.png>](https://zeit.co) | [<img width=150 src=../docs/logos/zendesk.png>](https://www.zendesk.com) | [<img width=150 src=../docs/logos/mongodb.jpg>](https://www.mongodb.com) | [<img width=150 src=../docs/logos/typeform.jpg>](https://www.typeform.com) | [<img width=150 src=../docs/logos/gov-uk.png>](https://gds.blog.gov.uk) |
| [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/zeit.png>](https://zeit.co) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/zendesk.png>](https://www.zendesk.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/mongodb.jpg>](https://www.mongodb.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/typeform.jpg>](https://www.typeform.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/gov-uk.png>](https://gds.blog.gov.uk) |
|---|---|---|---|---|
[<img width=150 src=../docs/logos/express.png>](http://expressjs.com) | [<img width=150 src=../docs/logos/webtorrent.png>](https://webtorrent.io) | [<img width=150 src=../docs/logos/ipfs.png>](https://ipfs.io) | [<img width=150 src=../docs/logos/dat.png>](https://datproject.org) | [<img width=150 src=../docs/logos/bitcoinjs.png>](https://bitcoinjs.org) |
[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/express.png>](http://expressjs.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/webtorrent.png>](https://webtorrent.io) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/ipfs.png>](https://ipfs.io) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/dat.png>](https://datproject.org) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/bitcoinjs.png>](https://bitcoinjs.org) |
|---|---|---|---|---|
[<img width=150 src=../docs/logos/atom.png>](https://atom.io) | [<img width=150 src=../docs/logos/electron.png>](http://electron.atom.io) | [<img width=150 src=../docs/logos/voltra.png>](https://voltra.co) | [<img width=150 src=../docs/logos/treasuredata.png>](https://www.treasuredata.com) | [<img width=150 src=../docs/logos/clevertech.png>](https://clevertech.biz) |
[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/atom.png>](https://atom.io) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/electron.png>](http://electron.atom.io) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/voltra.png>](https://voltra.co) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/treasuredata.png>](https://www.treasuredata.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/clevertech.png>](https://clevertech.biz) |
|---|---|---|---|---|
[<img width=150 src=../docs/logos/studynotes.jpg>](https://www.apstudynotes.org) | [<img width=150 src=../docs/logos/optiopay.png>](https://www.optiopay.com) | [<img width=150 src=../docs/logos/jaguar-landrover.png>](https://www.jlrtechincubator.com/jlrti/) | [<img width=150 src=../docs/logos/bustle.jpg>](https://www.bustle.com) | [<img width=150 src=../docs/logos/zentrick.png>](https://www.zentrick.com) |
[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/studynotes.jpg>](https://www.apstudynotes.org) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/optiopay.png>](https://www.optiopay.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/jaguar-landrover.png>](https://www.jlrtechincubator.com/jlrti/) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/bustle.jpg>](https://www.bustle.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/zentrick.png>](https://www.zentrick.com) |
|---|---|---|---|---|
[<img width=150 src=../docs/logos/nodesource.png>](https://nodesource.com) | [<img width=150 src=../docs/logos/greenkeeper.png>](https://greenkeeper.io) | [<img width=150 src=../docs/logos/karma.png>](https://karma-runner.github.io) | [<img width=150 src=../docs/logos/taser.png>](https://www.taser.com) |
[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/nodesource.png>](https://nodesource.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/greenkeeper.png>](https://greenkeeper.io) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/karma.png>](https://karma-runner.github.io) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/taser.png>](https://www.taser.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/neo4j.png>](https://www.neo4j.com) |
|---|---|---|---|---|
[<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/rentograph.png>](https://rentograph.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/eaze.png>](https://www.eaze.com) | [<img width=150 src=https://cdn.rawgit.com/standard/standard/master/docs/logos/ctrl-alt-deseat.png>](https://www.ctrlaltdeseat.com) | | |
|---|---|---|---|---|
除了公司之外,非常多的社群也在套件中採用了 `standard` [因為太多了](https://raw.githubusercontent.com/standard/standard-packages/master/all.json) 無法在此一一列舉。

@@ -509,7 +512,18 @@

```sh
#!/bin/sh
```bash
#!/bin/bash
# Ensure all javascript files staged for commit pass standard code style
git diff --name-only --cached --relative | grep '\.jsx\?$' | xargs standard
if [ $? -ne 0 ]; then exit 1; fi
function xargs-r() {
# Portable version of "xargs -r". The -r flag is a GNU extension that
# prevents xargs from running if there are no input files.
if IFS= read -r -d '' path; then
{ echo -n "$path"; echo -ne "\0"; cat; } | xargs $@
fi
}
git diff -z --name-only --cached --relative | grep -z '\.jsx\?$' | xargs-r -0 -t standard
if [[ $? -ne 0 ]]; then
echo 'JavaScript Standard Style errors were detected. Aborting commit.'
exit 1
fi
```

@@ -516,0 +530,0 @@

# JavaScript Standard Style
<p align="center">
<a href="RULES-en.md">English</a> •
<a href="RULES-esla.md">Español (Latinoamérica)</a> •
<a href="RULES-iteu.md">Italiano (Italian)</a> •
<a href="RULES-kokr.md">한국어 (Korean)</a> •
<a href="RULES-ptbr.md">Português (Brasil)</a> •
<a href="RULES-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="RULES-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
<a href="/docs/RULES-en.md">English</a> •
<a href="/docs/RULES-esla.md">Español (Latinoamérica)</a> •
<a href="/docs/RULES-iteu.md">Italiano (Italian)</a> •
<a href="/docs/RULES-kokr.md">한국어 (Korean)</a> •
<a href="/docs/RULES-ptbr.md">Português (Brasil)</a> •
<a href="/docs/RULES-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="/docs/RULES-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
</p>

@@ -12,0 +12,0 @@

# JavaScript Standard Style
<p align="center">
<a href="RULES-en.md">English</a> •
<a href="RULES-esla.md">Español (Latinoamérica)</a> •
<a href="RULES-iteu.md">Italiano (Italian)</a> •
<a href="RULES-kokr.md">한국어 (Korean)</a> •
<a href="RULES-ptbr.md">Português (Brasil)</a> •
<a href="RULES-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="RULES-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
<a href="/docs/RULES-en.md">English</a> •
<a href="/docs/RULES-esla.md">Español (Latinoamérica)</a> •
<a href="/docs/RULES-iteu.md">Italiano (Italian)</a> •
<a href="/docs/RULES-kokr.md">한국어 (Korean)</a> •
<a href="/docs/RULES-ptbr.md">Português (Brasil)</a> •
<a href="/docs/RULES-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="/docs/RULES-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
</p>

@@ -12,0 +12,0 @@

# JavaScript Standard Style
<p align="center">
<a href="RULES-en.md">English</a> •
<a href="RULES-esla.md">Español (Latinoamérica)</a> •
<a href="RULES-iteu.md">Italiano (Italian)</a> •
<a href="RULES-kokr.md">한국어 (Korean)</a> •
<a href="RULES-ptbr.md">Português (Brasil)</a> •
<a href="RULES-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="RULES-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
<a href="/docs/RULES-en.md">English</a> •
<a href="/docs/RULES-esla.md">Español (Latinoamérica)</a> •
<a href="/docs/RULES-iteu.md">Italiano (Italian)</a> •
<a href="/docs/RULES-kokr.md">한국어 (Korean)</a> •
<a href="/docs/RULES-ptbr.md">Português (Brasil)</a> •
<a href="/docs/RULES-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="/docs/RULES-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
</p>

@@ -12,0 +12,0 @@

# JavaScript Standard Style
<p align="center">
<a href="RULES-en.md">English</a> •
<a href="RULES-esla.md">Español (Latinoamérica)</a> •
<a href="RULES-iteu.md">Italiano (Italian)</a> •
<a href="RULES-kokr.md">한국어 (Korean)</a> •
<a href="RULES-ptbr.md">Português (Brasil)</a> •
<a href="RULES-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="RULES-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
<a href="/docs/RULES-en.md">English</a> •
<a href="/docs/RULES-esla.md">Español (Latinoamérica)</a> •
<a href="/docs/RULES-iteu.md">Italiano (Italian)</a> •
<a href="/docs/RULES-kokr.md">한국어 (Korean)</a> •
<a href="/docs/RULES-ptbr.md">Português (Brasil)</a> •
<a href="/docs/RULES-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="/docs/RULES-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
</p>

@@ -1074,2 +1074,3 @@

if (!key in obj) {} // ✗ 피하세요
if (!(key in obj)) {} // ✓ 좋아요
```

@@ -1076,0 +1077,0 @@

# JavaScript Standard Style
<p align="center">
<a href="RULES-en.md">English</a> •
<a href="RULES-esla.md">Español (Latinoamérica)</a> •
<a href="RULES-iteu.md">Italiano (Italian)</a> •
<a href="RULES-kokr.md">한국어 (Korean)</a> •
<a href="RULES-ptbr.md">Português (Brasil)</a> •
<a href="RULES-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="RULES-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
<a href="/docs/RULES-en.md">English</a> •
<a href="/docs/RULES-esla.md">Español (Latinoamérica)</a> •
<a href="/docs/RULES-iteu.md">Italiano (Italian)</a> •
<a href="/docs/RULES-kokr.md">한국어 (Korean)</a> •
<a href="/docs/RULES-ptbr.md">Português (Brasil)</a> •
<a href="/docs/RULES-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="/docs/RULES-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
</p>

@@ -12,0 +12,0 @@

# JavaScript Standard Style
<p align="center">
<a href="RULES-en.md">English</a> •
<a href="RULES-esla.md">Español (Latinoamérica)</a> •
<a href="RULES-iteu.md">Italiano (Italian)</a> •
<a href="RULES-kokr.md">한국어 (Korean)</a> •
<a href="RULES-ptbr.md">Português (Brasil)</a> •
<a href="RULES-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="RULES-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
<a href="/docs/RULES-en.md">English</a> •
<a href="/docs/RULES-esla.md">Español (Latinoamérica)</a> •
<a href="/docs/RULES-iteu.md">Italiano (Italian)</a> •
<a href="/docs/RULES-kokr.md">한국어 (Korean)</a> •
<a href="/docs/RULES-ptbr.md">Português (Brasil)</a> •
<a href="/docs/RULES-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="/docs/RULES-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
</p>

@@ -133,6 +133,8 @@

// ✗ avoid
if (condition) {
if (condition)
{
// ...
}
else {
else
{
// ...

@@ -139,0 +141,0 @@ }

# JavaScript Standard Style
<p align="center">
<a href="RULES-en.md">English</a> •
<a href="RULES-esla.md">Español (Latinoamérica)</a> •
<a href="RULES-iteu.md">Italiano (Italian)</a> •
<a href="RULES-kokr.md">한국어 (Korean)</a> •
<a href="RULES-ptbr.md">Português (Brasil)</a> •
<a href="RULES-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="RULES-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
<a href="/docs/RULES-en.md">English</a> •
<a href="/docs/RULES-esla.md">Español (Latinoamérica)</a> •
<a href="/docs/RULES-iteu.md">Italiano (Italian)</a> •
<a href="/docs/RULES-kokr.md">한국어 (Korean)</a> •
<a href="/docs/RULES-ptbr.md">Português (Brasil)</a> •
<a href="/docs/RULES-zhcn.md">简体中文 (Simplified Chinese)</a> •
<a href="/docs/RULES-zhtw.md">繁體中文 (Taiwanese Mandarin)</a>
</p>

@@ -12,0 +12,0 @@

{
"name": "standard",
"description": "JavaScript Standard Style",
"version": "10.0.3",
"version": "11.0.0-beta.0",
"author": {

@@ -15,14 +15,14 @@ "email": "feross@feross.org",

"dependencies": {
"eslint": "~3.19.0",
"eslint-config-standard": "10.2.1",
"eslint": "~4.13.0",
"eslint-config-standard": "11.0.0-beta.0",
"eslint-config-standard-jsx": "4.0.2",
"eslint-plugin-import": "~2.2.0",
"eslint-plugin-node": "~4.2.2",
"eslint-plugin-promise": "~3.5.0",
"eslint-plugin-react": "~6.10.0",
"eslint-plugin-import": "~2.8.0",
"eslint-plugin-node": "~5.2.1",
"eslint-plugin-promise": "~3.6.0",
"eslint-plugin-react": "~7.5.1",
"eslint-plugin-standard": "~3.0.1",
"standard-engine": "~7.0.0"
"standard-engine": "~7.2.0"
},
"devDependencies": {
"babel-eslint": "^7.0.0",
"babel-eslint": "^8.0.3",
"cross-spawn": "^5.0.1",

@@ -33,3 +33,3 @@ "eslint-index": "^1.3.0",

"run-parallel-limit": "^1.0.3",
"standard-packages": "^3.1.9",
"standard-packages": "^3.2.11",
"tape": "^4.6.0"

@@ -36,0 +36,0 @@ },