Socket
Socket
Sign inDemoInstall

standard

Package Overview
Dependencies
300
Maintainers
17
Versions
183
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 11.0.1 to 12.0.0

12

AUTHORS.md

@@ -116,2 +116,3 @@ # Authors

- Joe Boyle (joe.boyle@jibo.com)
- Adrian Trunzo (adrian@instoredoes.com)
- Pablo Varela (pablovarela182@gmail.com)

@@ -123,3 +124,12 @@ - Luan Vicente (hi@idlua.me)

- Maarten Ackermans (maarten.ackermans@gmail.com)
- ★★ (งツ)ว ★★ (theaichholzer@gmail.com)
- Fahad Hossain (fa7ad@users.noreply.github.com)
- kaijun (cadenho@hotmail.com)
- Andre Sattler (andresattler.webdev@gmail.com)
- Lucas Baldassari (lucasbaldassari@gmail.com)
- WangJie (i@i8e.net)
- Theophilus Omoregbee (theo4u@ymail.com)
- Charlie Gerard (charlie.a.gerard@gmail.com)
- Christopher J. Brody (chris.brody@gmail.com)
#### Generated by bin/update-authors.sh.
#### Generated by tools/update-authors.sh.

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

## 12.0.0 - 2018-08-28
New version of ESLint, new version of Standard!
When you upgrade, consider running `standard --fix` to automatically format your code to match the newly added rules.
### New features
- Update `eslint` from `~4.19.0` to `~5.0.0`.
- Support JSXFragment nodes (e.g. `<></>`)
- Lots of minor changes to rules to catch more edge cases!
- The README is now available in French! (Thanks [@charliegerard](https://github.com/charliegerard)!)
- Other community contributed translations exist in Spanish, Italian, Korean, Portuguese, Simplified Chinese, and Taiwanese Mandarin.
- More translations are welcome!
### New rules
*(Estimated % of affected standard users, based on test suite in parens)*
- Require spacing inside of braces ([object-curly-spacing](https://eslint.org/docs/rules/object-curly-spacing)) [#609](https://github.com/standard/standard/issues/609) [eslint-config-standard/#35](https://github.com/standard/eslint-config-standard/issues/35) (29%)
- Disallow APIs that were deprecated in Node 10 ([no-deprecated-api](https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/no-deprecated-api.md)) [#1164](https://github.com/standard/standard/pull/1164) (15%)
- e.g. `assert.equal()`, `assert.deepEqual()` and `assert.notEqual()` were deprecated in Node 10.
- Disallow self assignment of properties ([no-self-assign](https://eslint.org/docs/rules/no-self-assign)) [#1186](https://github.com/standard/standard/issues/1186) (0%)
### Changed rules
None.
## 11.0.0 - 2018-02-18

@@ -8,0 +36,0 @@

26

package.json
{
"name": "standard",
"description": "JavaScript Standard Style",
"version": "11.0.1",
"version": "12.0.0",
"author": {
"email": "feross@feross.org",
"name": "Feross Aboukhadijeh",
"url": "http://feross.org/"
"url": "https://feross.org/"
},

@@ -15,14 +15,14 @@ "bin": "./bin/cmd.js",

"dependencies": {
"eslint": "~4.18.0",
"eslint-config-standard": "11.0.0",
"eslint-config-standard-jsx": "5.0.0",
"eslint-plugin-import": "~2.9.0",
"eslint-plugin-node": "~6.0.0",
"eslint-plugin-promise": "~3.7.0",
"eslint-plugin-react": "~7.7.0",
"eslint-plugin-standard": "~3.0.1",
"standard-engine": "~8.0.0"
"eslint": "~5.4.0",
"eslint-config-standard": "~12.0.0",
"eslint-config-standard-jsx": "~6.0.2",
"eslint-plugin-import": "~2.14.0",
"eslint-plugin-node": "~7.0.1",
"eslint-plugin-promise": "~4.0.0",
"eslint-plugin-react": "~7.11.1",
"eslint-plugin-standard": "~4.0.0",
"standard-engine": "~9.0.0"
},
"devDependencies": {
"babel-eslint": "^8.0.3",
"babel-eslint": "^9.0.0",
"cross-spawn": "^6.0.3",

@@ -76,4 +76,4 @@ "eslint-index": "^1.3.0",

"test": "./bin/cmd.js --verbose && tape test/*.js",
"update-authors": "./bin/update-authors.sh"
"update-authors": "./tools/update-authors.sh"
}
}

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

<a href="/docs/README-esla.md">Español (Latinoamérica)</a> •
<a href="/docs/README-fr.md">Français</a> •
<a href="/docs/README-iteu.md">Italiano (Italian)</a> •

@@ -52,2 +53,6 @@ <a href="/docs/README-kokr.md">한국어 (Korean)</a> •

### Open Source Supporters
<a href="https://nsrc.io/oss-feross" target='_blank'><img src='https://feross.org/images/supporters/nodesource.png' width=125></a>
## StandardJS — The Rules

@@ -59,4 +64,2 @@

- **No semicolons** – [It's][1] [fine.][2] [Really!][3]
- **Never start a line with `(`, `[`, or `` ` ``**
- This is the **only** gotcha with omitting semicolons – *automatically checked for you!*
- [More details][4]

@@ -67,5 +70,7 @@ - **Space after keywords** `if (condition) { ... }`

- Always handle the node.js `err` function parameter
- Always prefix browser globals with `window` – except `document` and `navigator` are okay
- Prevents accidental use of poorly-named browser globals like `open`, `length`,
- Declare browser globals with `/* global */` comment at top of file
- Prevents accidental use of vaguely-named browser globals like `open`, `length`,
`event`, and `name`.
- Example: `/* global alert, prompt */`
- Exceptions are: `window`, `document`, and `navigator`
- **And [more goodness][5]** – *give `standard` a try today!*

@@ -76,4 +81,4 @@

[3]: https://www.youtube.com/watch?v=gsfbh17Ax9I
[4]: /docs/RULES-en.md#semicolons
[5]: /docs/RULES-en.md#javascript-standard-style
[4]: /RULES.md#semicolons
[5]: /RULES.md#javascript-standard-style

@@ -284,11 +289,18 @@ To get a better idea, take a look at

Install **[ale][vim-1]**.
Install **[ale][vim-1]**. And add these lines to your `.vimrc` file.
For automatic formatting on save, add these lines to `.vimrc`:
```vim
let g:ale_linters = {
\ 'javascript': ['standard'],
\}
let g:ale_fixers = {'javascript': ['standard']}
```
This sets standard as your only linter and fixer for javascript files and so prevents conflicts with eslint. For linting and automatic fixing on save, add these lines to `.vimrc`:
```vim
autocmd bufwritepost *.js silent !standard --fix %
set autoread
let g:ale_lint_on_save = 1
let g:ale_fix_on_save = 1
```
Alternative 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).

@@ -321,3 +333,3 @@

[webstorm-1]: webstorm.md
[webstorm-1]: docs/webstorm.md

@@ -616,8 +628,8 @@ ## Is there a readme badge?

## What about Web Workers?
## What about Web Workers and Service Workers?
Add this to the top of worker files:
Add this to the top of web worker files:
```js
/* eslint-env serviceworker */
/* eslint-env worker */
```

@@ -628,2 +640,8 @@

For Service workers, add this instead:
```js
/* eslint-env serviceworker */
```
## Can I check code inside of Markdown or HTML files?

@@ -671,7 +689,7 @@

# 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 $@
if IFS= read -r -d $'\n' path; then
{ echo "$path"; cat; } | xargs $@
fi
}
git diff -z --name-only --cached --relative | grep -z '\.jsx\?$' | xargs-r -0 -t standard
git diff --name-only --cached --relative | grep '\.jsx\?$' | sed 's/[^[:alnum:]]/\\&/g' | xargs-r -E '' -t standard
if [[ $? -ne 0 ]]; then

@@ -788,2 +806,3 @@ echo 'JavaScript Standard Style errors were detected. Aborting commit.'

- **[semistandard](https://github.com/Flet/semistandard)** - standard, with semicolons (if you must)
- **[standardx](https://github.com/standard/standardx)** - standard, with custom tweaks

@@ -797,2 +816,2 @@ There are also many **[editor plugins](#are-there-text-editor-plugins)**, a list of

[MIT](LICENSE). Copyright (c) [Feross Aboukhadijeh](http://feross.org).
[MIT](LICENSE). Copyright (c) [Feross Aboukhadijeh](https://feross.org).

@@ -15,3 +15,3 @@ # JavaScript Standard Style

This is a TL;DR of the [standard](https://github.com/standard/standard) JavaScript
This is a summary of the [standard](https://github.com/standard/standard) JavaScript
rules.

@@ -184,5 +184,17 @@

* **Always prefix browser globals** with `window.`.<br>
Exceptions are: `document`, `console` and `navigator`.
* **Declare browser globals** with a `/* global */` comment.<br>
Exceptions are: `window`, `document` and `navigator`.<br>
Prevents accidental use of poorly-named browser globals like `open`, `length`,
`event`, and `name`.
```js
/* global alert, prompt */
alert('hi')
prompt('ok?')
```
Explicitly referencing the function or property on `window` is okay too, though
such code will not run in a Worker which uses `self` instead of `window`.
eslint: [`no-undef`](http://eslint.org/docs/rules/no-undef)

@@ -376,3 +388,3 @@

set name (value) { // ✗ avoid
this.name = value
this._name = value
}

@@ -383,6 +395,6 @@ }

set name (value) {
this.name = value
this._name = value
},
get name () { // ✓ ok
return this.name
return this._name
}

@@ -759,3 +771,7 @@ }

function game () {
score: 50 // ✗ avoid
score: while (true) { // ✗ avoid
score -= 10
if (score > 0) continue score
break
}
}

@@ -1305,4 +1321,8 @@ ```

* Never start a line with `(`, `[`, or `` ` ``. This is the only gotcha with omitting semicolons, and standard protects you from this potential issue.
* Never start a line with `(`, `[`, `` ` ``, or a handful of other unlikely possibilities.
This is the only gotcha with omitting semicolons, and `standard` protects you from this potential issue.
(The full list is: `[`, `(`, `` ` ``, `+`, `*`, `/`, `-`, `,`, `.`, but most of these will never appear at the start of a line in real code.)
eslint: [`no-unexpected-multiline`](http://eslint.org/docs/rules/no-unexpected-multiline)

@@ -1309,0 +1329,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc