standard
Advanced tools
Comparing version 9.0.0-beta.0 to 9.0.0
@@ -87,3 +87,4 @@ # Authors | ||
- Peter Jenkins (peterjenkins@users.noreply.github.com) | ||
- nyuszika7h (nyuszika7h@openmailbox.org) | ||
#### Generated by bin/update-authors.sh. |
@@ -6,8 +6,25 @@ # Change Log | ||
## UNRELEASED 9.0.0 (BETA) - 2017-03-01 | ||
## 9.0.0 - 2017-02-28 | ||
It's time for a new major version of `standard`! As usual, this release contains a | ||
bunch of awesomeness to help you keep your code in tip-top shape! | ||
We've added several new rules designed to **catch potential programmer errors** | ||
(i.e. bugs), as well as rules to make programmer intent **more explicit** in | ||
certain circumstances. | ||
This release continues our trend of tightening up rules so that, wherever possible, | ||
there's one "right" way to do things. This design goal is intended to reduce the | ||
time that teams and maintainers spend giving code review feedback in pull requests. | ||
When you upgrade, consider running `standard --fix` to automatically fix some of the | ||
errors caught by the new rules in this version. | ||
*Note: If you use the Chai test framework, you will need to make some changes to | ||
your tests to improve their robustness. [Read about the changes you need to make](https://github.com/feross/standard/issues/690#issuecomment-278533482).* | ||
## New features | ||
- Update ESLint from 3.10.x to 3.15.x. | ||
- 3 additional rules are now fixable with `standard --fix`! | ||
- Update ESLint from 3.10.x to 3.15.x | ||
- 3 additional rules are now fixable with `standard --fix` | ||
@@ -19,3 +36,3 @@ ## New rules | ||
- Disallow mixing different operators without parens ([no-mixed-operators](http://eslint.org/docs/rules/no-mixed-operators)) [#566](https://github.com/feross/standard/issues/566) (5%) | ||
- Enforce 1 newline at end of file (previously 1 or 2 were allowed) ([no-multiple-empty-lines](http://eslint.org/docs/rules/no-multiple-empty-lines)) [#733](https://github.com/feross/standard/issues/733) (3%) | ||
- Enforce 1 newline at end of file (previously 1 or 2 were ok) ([no-multiple-empty-lines](http://eslint.org/docs/rules/no-multiple-empty-lines)) [#733](https://github.com/feross/standard/issues/733) (3%) | ||
- Disallow Unused Expressions ([no-unused-expressions](http://eslint.org/docs/rules/no-unused-expressions)) [#690](https://github.com/feross/standard/issues/690) (3%) | ||
@@ -40,14 +57,14 @@ - Note: this affects users of the Chai test framework. [Read about the changes you need to make](https://github.com/feross/standard/issues/690#issuecomment-278533482). | ||
- Update ESLint from 3.8.x to 3.10.x. | ||
- 3 additional rules are now fixable with `standard --fix`! | ||
- Update ESLint from 3.8.x to 3.10.x | ||
- 3 additional rules are now fixable with `standard --fix` | ||
## 8.5.0 - 2016-10-25 | ||
- Update ESLint from 3.7.x to 3.8.x. | ||
- 2 additional rules are now fixable with `standard --fix`! | ||
- Update ESLint from 3.7.x to 3.8.x | ||
- 2 additional rules are now fixable with `standard --fix` | ||
## 8.4.0 - 2016-10-10 | ||
- Update ESLint from 3.6.x to 3.7.x. | ||
- 5 additional rules are now fixable with `standard --fix`! | ||
- Update ESLint from 3.6.x to 3.7.x | ||
- 5 additional rules are now fixable with `standard --fix` | ||
- Use more conservative semver ranges [#654](https://github.com/feross/standard/issues/654) | ||
@@ -73,9 +90,9 @@ | ||
- Support ES7 (i.e. ES2016) syntax. | ||
- Update ESLint from 3.5.x to 3.6.x. | ||
- 4 additional rules are now fixable with `standard --fix`! | ||
- Update ESLint from 3.5.x to 3.6.x | ||
- 4 additional rules are now fixable with `standard --fix` | ||
## 8.1.0 - 2016-09-17 | ||
- Update ESLint from 3.3.x to 3.5.x. | ||
- Around 10 additional rules are now fixable with `standard --fix`! | ||
- Update ESLint from 3.3.x to 3.5.x | ||
- Around 10 additional rules are now fixable with `standard --fix` | ||
@@ -82,0 +99,0 @@ ## 8.0.0 - 2016-08-23 |
{ | ||
"name": "standard", | ||
"description": "JavaScript Standard Style", | ||
"version": "9.0.0-beta.0", | ||
"version": "9.0.0", | ||
"author": { | ||
@@ -16,3 +16,3 @@ "email": "feross@feross.org", | ||
"eslint": "~3.15.0", | ||
"eslint-config-standard": "7.0.0-beta.0", | ||
"eslint-config-standard": "7.0.0", | ||
"eslint-config-standard-jsx": "3.3.0", | ||
@@ -19,0 +19,0 @@ "eslint-plugin-promise": "~3.4.0", |
@@ -206,3 +206,3 @@ <h1 align="center"> | ||
[<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=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) | | ||
|---|---|---|---|---| | ||
@@ -449,4 +449,4 @@ | ||
`standard` supports the latest version of the ECMAscript, including all language | ||
feature proposals that are in "Stage 4" of the proposal process. | ||
`standard` supports the latest ECMAScript features, ES8 (ES2017), including | ||
language feature proposals that are in "Stage 4" of the proposal process. | ||
@@ -453,0 +453,0 @@ To support experimental language features, `standard` supports specifying a |
111
RULES.md
@@ -573,2 +573,3 @@ # JavaScript Standard Style | ||
eval( "var result = user." + propName ) // ✗ avoid | ||
var result = user[propName] // ✓ ok | ||
``` | ||
@@ -660,2 +661,10 @@ | ||
} | ||
switch (filter) { | ||
case 1: | ||
doSomething() | ||
// fallthrough // ✓ ok | ||
case 2: | ||
doSomethingElse() | ||
} | ||
``` | ||
@@ -694,3 +703,4 @@ | ||
```js | ||
setTimeout("alert('Hello world')") // ✗ avoid | ||
setTimeout("alert('Hello world')") // ✗ avoid | ||
setTimeout(function () { alert('Hello world') }) // ✓ ok | ||
``` | ||
@@ -722,3 +732,3 @@ | ||
```js | ||
function myFunc() /*<NBSP>*/{} // ✗ avoid | ||
function myFunc () /*<NBSP>*/{} // ✗ avoid | ||
``` | ||
@@ -768,3 +778,3 @@ | ||
function myFunc () { | ||
myOtherFunc() // ✓ ok | ||
myOtherFunc() // ✓ ok | ||
} | ||
@@ -905,2 +915,4 @@ ``` | ||
const regexp = /test value/ // ✗ avoid | ||
const regexp = /test {3}value/ // ✓ ok | ||
const regexp = /test value/ // ✓ ok | ||
@@ -1137,2 +1149,3 @@ ``` | ||
const user = { name: 'Jane Doe', age: 30, username: 'jdoe86' } // ✓ ok | ||
const user = { | ||
@@ -1170,3 +1183,3 @@ name: 'Jane Doe', | ||
* **Semicolon's must have a space after and no space before.** | ||
* **Semicolons must have a space after and no space before.** | ||
@@ -1189,3 +1202,3 @@ eslint: [`semi-spacing`](http://eslint.org/docs/rules/semi-spacing) | ||
* **No spaces inside parens.** | ||
* **No spaces inside parentheses.** | ||
@@ -1205,3 +1218,3 @@ eslint: [`space-in-parens`](http://eslint.org/docs/rules/space-in-parens) | ||
typeof!admin // ✗ avoid | ||
typof !admin // ✓ ok | ||
typeof !admin // ✓ ok | ||
``` | ||
@@ -1216,2 +1229,5 @@ | ||
// comment // ✓ ok | ||
/*comment*/ // ✗ avoid | ||
/* comment */ // ✓ ok | ||
``` | ||
@@ -1237,3 +1253,3 @@ | ||
* **`typeof` must be compared to valid string.** | ||
* **`typeof` must be compared to a valid string.** | ||
@@ -1247,3 +1263,3 @@ eslint: [`valid-typeof`](http://eslint.org/docs/rules/valid-typeof) | ||
* **Immediately Invoked Function Expressions (IFFE's) must be wrapped.** | ||
* **Immediately Invoked Function Expressions (IIFEs) must be wrapped.** | ||
@@ -1255,3 +1271,4 @@ eslint: [`wrap-iife`](http://eslint.org/docs/rules/wrap-iife) | ||
const getName = (function () { }) // ✓ ok | ||
const getName = (function () { }()) // ✓ ok | ||
const getName = (function () { })() // ✓ ok | ||
``` | ||
@@ -1331,3 +1348,3 @@ | ||
This is much preferred: | ||
This is strongly preferred: | ||
@@ -1355,43 +1372,41 @@ ```js | ||
[Relying on automatic semicolon insertion] is quite safe, and perfectly valid JS that every browser understands. Closure compiler, yuicompressor, packer, and jsmin all can properly minify it. There is no performance impact anywhere. | ||
> [Relying on automatic semicolon insertion] is quite safe, and perfectly valid JS that every browser understands. Closure compiler, yuicompressor, packer, and jsmin all can properly minify it. There is no performance impact anywhere. | ||
> | ||
> I am sorry that, instead of educating you, the leaders in this language community have given you lies and fear. That was shameful. I recommend learning how statements in JS are actually terminated (and in which cases they are not terminated), so that you can write code that you find beautiful. | ||
> | ||
> In general, `\n` ends a statement unless: | ||
> 1. The statement has an unclosed paren, array literal, or object literal or ends in some | ||
> other way that is not a valid way to end a statement. (For instance, ending with `.` | ||
> or `,`.) | ||
> 2. The line is `--` or `++` (in which case it will decrement/increment the next token.) | ||
> 3. It is a `for()`, `while()`, `do`, `if()`, or `else`, and there is no `{` | ||
> 4. The next line starts with `[`, `(`, `+`, `*`, `/`, `-`, `,`, `.`, or some other | ||
> binary operator that can only be found between two tokens in a single expression. | ||
> | ||
> The first is pretty obvious. Even JSLint is ok with `\n` chars in JSON and parenthesized constructs, and with `var` statements that span multiple lines ending in `,`. | ||
> | ||
> The second is super weird. I’ve never seen a case (outside of these sorts of conversations) where you’d want to do write `i\n++\nj`, but, point of fact, that’s parsed as `i; ++j`, not `i++; j`. | ||
> | ||
> The third is well understood, if generally despised. `if (x)\ny()` is equivalent to `if (x) { y() }`. The construct doesn’t end until it reaches either a block, or a statement. | ||
> | ||
> `;` is a valid JavaScript statement, so `if(x);` is equivalent to `if(x){}` or, “If x, do nothing.” This is more commonly applied to loops where the loop check also is the update function. Unusual, but not unheard of. | ||
> | ||
> The fourth is generally the fud-inducing “oh noes, you need semicolons!” case. But, as it turns out, it’s quite easy to *prefix* those lines with semicolons if you don’t mean them to be continuations of the previous line. For example, instead of this: | ||
> | ||
> ```js | ||
> foo(); | ||
> [1,2,3].forEach(bar); | ||
> ``` | ||
> | ||
> you could do this: | ||
> | ||
> ```js | ||
> foo() | ||
> ;[1,2,3].forEach(bar) | ||
> ``` | ||
> | ||
> The advantage is that the prefixes are easier to notice, once you are accustomed to never seeing lines starting with `(` or `[` without semis. | ||
I am sorry that, instead of educating you, the leaders in this language community have given you lies and fear. That was shameful. I recommend learning how statements in JS are actually terminated (and in which cases they are not terminated), so that you can write code that you find beautiful. | ||
In general, `\n` ends a statement unless: | ||
1. The statement has an unclosed paren, array literal, or object literal or ends in some | ||
other way that is not a valid way to end a statement. (For instance, ending with `.` | ||
or `,`.) | ||
2. The line is `--` or `++` (in which case it will decrement/increment the next token.) | ||
3. It is a `for()`, `while()`, `do`, `if()`, or `else`, and there is no `{` | ||
4. The next line starts with `[`, `(`, `+`, `*`, `/`, `-`, `,`, `.`, or some other | ||
binary operator that can only be found between two tokens in a single expression. | ||
The first is pretty obvious. Even JSLint is ok with `\n` chars in JSON and parenthesized constructs, and with `var` statements that span multiple lines ending in `,`. | ||
The second is super weird. I’ve never seen a case (outside of these sorts of conversations) where you’d want to do write `i\n++\nj`, but, point of fact, that’s parsed as `i; ++j`, not `i++; j`. | ||
The third is well understood, if generally despised. `if (x)\ny()` is equivalent to `if (x) { y() }`. The construct doesn’t end until it reaches either a block, or a statement. | ||
`;` is a valid JavaScript statement, so `if(x);` is equivalent to `if(x){}` or, “If x, do nothing.” This is more commonly applied to loops where the loop check also is the update function. Unusual, but not unheard of. | ||
The fourth is generally the fud-inducing “oh noes, you need semicolons!” case. But, as it turns out, it’s quite easy to *prefix* those lines with semicolons if you don’t mean them to be continuations of the previous line. For example, instead of this: | ||
```js | ||
foo(); | ||
[1,2,3].forEach(bar); | ||
``` | ||
you could do this: | ||
```js | ||
foo() | ||
;[1,2,3].forEach(bar) | ||
``` | ||
The advantage is that the prefixes are easier to notice, once you are accustomed to never seeing lines starting with `(` or `[` without semis. | ||
*End quote from "An Open Letter to JavaScript Leaders Regarding Semicolons".* | ||
[1]: http://blog.izs.me/post/2353458699/an-open-letter-to-javascript-leaders-regarding | ||
[2]: http://inimino.org/~inimino/blog/javascript_semicolons | ||
[3]: https://www.youtube.com/watch?v=gsfbh17Ax9I |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
157640
0
+ Addedeslint-config-standard@7.0.0(transitive)
- Removedeslint-config-standard@7.0.0-beta.0(transitive)
Updatedeslint-config-standard@7.0.0