Skip to content

Abh upstream v1.10.3 #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 121 commits into from
Dec 11, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
4916dc6
Update: no-implicit-coercion validate AssignmentExpression (fixes #4348)
ipanasenko Nov 6, 2015
fdfc6cd
Fix: eslint.report can be called w/o node if loc provided (fixes #4220)
platinumazure Nov 2, 2015
ae696eb
Update: Add Popular Style Guides (fixes #4320)
Nov 5, 2015
4648b2b
Merge pull request #4314 from platinumazure/context-report
nzakas Nov 9, 2015
b9d1fc6
Fix: Display singular/plural version of "line" in message (fixes #4359)
mariusschulz Nov 9, 2015
ea1da0b
Fix: Add the missing "as-needed" docs to the radix rule (fixes #4364)
mgol Nov 9, 2015
595258b
Merge pull request #4367 from mzgol/radix-docs
ilyavolodin Nov 11, 2015
98691d7
Merge pull request #4357 from mariusschulz/patch-1
nzakas Nov 11, 2015
02afa61
Merge pull request #4340 from xjamundx/style-guides
nzakas Nov 11, 2015
c58f294
Fix: no-undef-init should ignore const (fixes #4284)
nzakas Nov 12, 2015
22d1e03
Update: Refactor eslint.verify args (fixes #4395)
nzakas Nov 12, 2015
81c793f
Merge pull request #4396 from eslint/issue4284
ilyavolodin Nov 12, 2015
425eb7c
Merge pull request #4398 from eslint/issue4395
ilyavolodin Nov 12, 2015
a4b3114
Fix: Handle comments in comma-spacing (fixes #4389)
alberto Nov 12, 2015
013664f
Update: Allow empty arrow body (fixes #4411)
alberto Nov 14, 2015
1ff31d3
Docs: Document semi-spacing behaviour (fixes #4404)
alberto Nov 12, 2015
1f265b1
Fix: eqeqeq autofix avoids clashes with space-infix-ops (fixes #4423)
platinumazure Nov 14, 2015
db6ba1d
Merge pull request #4420 from eslint/issue4411
ilyavolodin Nov 14, 2015
b2228dc
Merge pull request #4421 from eslint/issue4404
ilyavolodin Nov 14, 2015
59920bf
Revert "Update: Allow empty arrow body (fixes #4411)"
nzakas Nov 14, 2015
0b44234
Merge pull request #4425 from eslint/revert-4420-issue4411
nzakas Nov 14, 2015
20d9433
Merge pull request #4424 from platinumazure/fix-eqeqeq-autofix
nzakas Nov 14, 2015
5444116
Docs: missing close rbracket in example
storkme Nov 14, 2015
957fe08
Merge pull request #4422 from storkme/patch-1
nzakas Nov 14, 2015
6d59e0e
Fix: `id-length` properties never option (fixes #4347)
mysticatea Nov 15, 2015
7b0afc3
Fix: `curly` warns wrong location for `else` (fixes #4362)
mysticatea Nov 15, 2015
7092637
Fix: Support empty if blocks in lines-around-comment (fixes #4339)
alberto Nov 11, 2015
3b3b335
Merge pull request #4430 from mysticatea/curly/fix-wrong-error-in-multi
nzakas Nov 15, 2015
804abd8
Merge pull request #4433 from eslint/issue4339
nzakas Nov 15, 2015
812c263
Fix: `no-extend-native` crashed at empty defineProperty (fixes #4438)
mysticatea Nov 16, 2015
032b7a6
Docs: Replace link to deprecated rule with newer rule
amarshall Nov 14, 2015
169bd96
Update: Add JSX exceptions to no-extra-parens (fixes #4229)
btmills Nov 16, 2015
522c8cd
Merge pull request #4439 from mysticatea/no-extend-native/crash
ilyavolodin Nov 16, 2015
4db2932
Merge pull request #4416 from amarshall/patch-1
ilyavolodin Nov 16, 2015
1b4750e
Merge pull request #4440 from eslint/issue4229
nzakas Nov 16, 2015
c411406
Revert "Update: Add JSX exceptions to no-extra-parens (fixes #4229)"
btmills Nov 16, 2015
c9a8883
New: Config files with extensions (fixes #4045, fixes #4263)
nzakas Nov 13, 2015
756b279
Merge pull request #4406 from eslint/issue4045
nzakas Nov 16, 2015
8637cf5
Merge pull request #4450 from eslint/revert-4440-issue4229
nzakas Nov 16, 2015
87b5e4f
New: Disable comment config option (fixes #3901)
tofumatt Oct 16, 2015
8f31572
Docs: Update indent.md
ngbrown Nov 11, 2015
bbbcaaa
Merge pull request #4392 from ngbrown/patch-1
gyandeeps Nov 16, 2015
700f11f
Fix: Autofix quotes produces invalid javascript (fixes #4380)
nightwing Nov 16, 2015
65c33d8
Fix: Improves performance (refs #3530)
mysticatea Nov 14, 2015
502f2aa
Fix: space-before-keywords false positive (fixes #4449)
alberto Nov 17, 2015
5de5866
Update: replace label and break with IIFE and return (fixes #4459)
ipanasenko Nov 17, 2015
92c1999
Merge pull request #4429 from mysticatea/id-length/fix-properties-never
nzakas Nov 17, 2015
7ebb027
Merge pull request #4186 from tofumatt/disallow-inline-rule-config-3901
nzakas Nov 17, 2015
d166ad3
Merge pull request #4456 from eslint/issue4449
nzakas Nov 17, 2015
791ed1a
Merge pull request #4460 from ipanasenko/issue-4459
nzakas Nov 17, 2015
7446e47
Update: Accept array for `ignorePattern` (fixes #3982)
jmm Nov 16, 2015
846e893
Fix: Handle comments in block-spacing (fixes #4387)
alberto Nov 17, 2015
b5c70b6
Merge pull request #4123 from jmm/ignore-pattern-array-squashed
nzakas Nov 17, 2015
fd5d4e3
Docs: Fix typo in default `cacheLocation` value
ahutchings Nov 18, 2015
4536241
Merge pull request #4466 from ahutchings/patch-1
gyandeeps Nov 18, 2015
2017aa5
Update: Display errors at the place where fix should go (fixes #4470)
nightwing Nov 17, 2015
b07589e
Merge pull request #4471 from nightwing/issue4470
nzakas Nov 18, 2015
03209e2
Update: return type error in `valid-jsdoc` rule (fixes #4443)
gyandeeps Nov 16, 2015
4cc8326
Update: Add class support to `require-jsdoc` rule (fixes #4268)
gyandeeps Nov 3, 2015
ea6dff4
Merge pull request #4428 from mysticatea/code-path-analysis/improve-p…
nzakas Nov 19, 2015
f5a9197
Merge pull request #4454 from eslint/issue4443
nzakas Nov 19, 2015
ba0bf6b
Merge pull request #4328 from eslint/issue4268
nzakas Nov 19, 2015
b602297
Merge pull request #4426 from nightwing/issue4380
nzakas Nov 19, 2015
cef00c3
Merge pull request #4349 from ipanasenko/issue-4348
nzakas Nov 19, 2015
08d655b
Merge pull request #4401 from eslint/issue4389
nzakas Nov 19, 2015
b4dfd3a
Docs: Fix home directory config description (fixes #4398)
nzakas Nov 19, 2015
ff9c797
Docs: Clean up description of recommended rules (fixes #4365)
nzakas Nov 19, 2015
7ebaeae
Docs: Move legacy rules to stylistic (files #4111)
nzakas Nov 19, 2015
6c04d51
Docs: Update description of exported comment (fixes #3916)
nzakas Nov 19, 2015
936e293
Merge pull request #4477 from eslint/issue4398
ilyavolodin Nov 19, 2015
a0e0a48
Merge pull request #4478 from eslint/issue4365
ilyavolodin Nov 19, 2015
c7ec8a5
Merge pull request #4479 from eslint/issue4111
ilyavolodin Nov 19, 2015
3439bc2
Merge pull request #4480 from eslint/issue3916
ilyavolodin Nov 19, 2015
aff7d6d
Update: --init to create extensioned files (fixes #4476)
nzakas Nov 19, 2015
5b4a94e
Merge pull request #4484 from eslint/issue4476
ilyavolodin Nov 20, 2015
c761263
Merge pull request #4390 from eslint/issue4387
nzakas Nov 20, 2015
be2c000
1.10.0
nzakas Nov 20, 2015
bec6c9b
Fix: Revert freezing context object (refs #4495)
nzakas Nov 20, 2015
bee05aa
Build: Update eslint bot messages (fixes #4497)
nzakas Nov 20, 2015
80b2ddb
Merge pull request #4498 from eslint/issue4495
nzakas Nov 20, 2015
01f33d3
1.10.1
nzakas Nov 20, 2015
4fb128f
Merge pull request #4499 from eslint/issue4497
ilyavolodin Nov 20, 2015
6dfe712
Docs: Load badge from HTTPS
brianloveswords Nov 21, 2015
1a7997b
Merge pull request #4503 from brianloveswords/patch-1
nzakas Nov 21, 2015
6b1d048
Fix: Add a RestProperty test of `no-undef` (fixes #3271)
mysticatea Nov 21, 2015
ff21d33
Merge pull request #4506 from mysticatea/no-undef/rest-property
nzakas Nov 21, 2015
828f4cb
Fix: `no-spaced-func` had been crashed (fixes #4508)
mysticatea Nov 22, 2015
cbdc73b
Merge pull request #4519 from mysticatea/no-spaced-func/fix-crash
ilyavolodin Nov 23, 2015
f4af63b
Fix: Incorrect location in no-fallthrough (fixes #4516)
alberto Nov 23, 2015
7302727
Build: Allow revert commits in commit messages (fixes #4452)
alberto Nov 22, 2015
0e73089
Merge pull request #4517 from eslint/issue4452
ilyavolodin Nov 23, 2015
3f1a8a4
Merge pull request #4525 from eslint/issue4516
nzakas Nov 23, 2015
e47265f
Build: Add branch update during release process (fixes #4491)
gyandeeps Nov 23, 2015
1d54730
Merge pull request #4526 from eslint/issue4491
nzakas Nov 23, 2015
e0ecb22
Fix: `brace-style` ASI fix for if-else condition (fixes #4520)
gyandeeps Nov 23, 2015
9fe6bd1
Fix: `valid-jsdoc` unneeded require check fix (fixes #4527)
gyandeeps Nov 23, 2015
f0b8807
Merge pull request #4528 from eslint/issue4520
nzakas Nov 23, 2015
c314315
Merge pull request #4530 from eslint/issue4527
nzakas Nov 23, 2015
5fd685a
Fix: Add for-in to `curly` rule (fixes #4436)
Nov 25, 2015
d16ae0d
Merge pull request #4541 from kaicataldo/issue4436
ilyavolodin Nov 25, 2015
03ff54f
Fix: Bugfix for eqeqeq autofix (fixes #4540)
platinumazure Nov 25, 2015
d0683f3
Upgrade: [email protected] (fixes #4545)
platinumazure Nov 25, 2015
3d712c3
Merge pull request #4546 from platinumazure/upgrade-doctrine
nzakas Nov 26, 2015
30cd6b0
Fix: lines-around-comment with multiple comments (fixes #3509)
alberto Nov 26, 2015
76d104d
Upgrade: Pinned down js-yaml to avoid breaking dep (fixes #4553)
alberto Nov 26, 2015
d24519f
Merge pull request #4554 from eslint/issue4553
nzakas Nov 27, 2015
1a3d095
Merge pull request #4544 from platinumazure/eqeqeq-autofix-issue
nzakas Nov 27, 2015
8b66d65
Merge pull request #4552 from eslint/issue3509
nzakas Nov 27, 2015
0f5b86f
Upgrade: [email protected] (refs #4485)
nzakas Nov 27, 2015
931e0a2
1.10.2
nzakas Nov 27, 2015
95d2e0b
Fix: Ignore space before function in array start (fixes #4569)
alberto Nov 29, 2015
f01840d
Fix: Add for-of to `curly` rule (fixes #4571)
Nov 30, 2015
6189ebb
Docs: Reference .eslintrc.* in contributing docs (fixes #4532)
Nov 30, 2015
58ee960
Merge pull request #4572 from eslint/issue4569
nzakas Nov 30, 2015
2679a39
Merge pull request #4573 from kaicataldo/curlyforof
nzakas Nov 30, 2015
fdce86d
Merge pull request #4577 from kaicataldo/configurationfilesdocs
nzakas Nov 30, 2015
4e163a7
Docs: Update strict rule docs (fixes #4583)
nzakas Dec 1, 2015
901d525
Merge pull request #4584 from eslint/issue4583
nzakas Dec 1, 2015
2436cc6
1.10.3
nzakas Dec 1, 2015
e28087e
resolve merge conflict
Dec 10, 2015
fd49900
Permit airbnb config packages only
Dec 10, 2015
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
72 changes: 72 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,75 @@
v1.10.3 - December 1, 2015

* Docs: Update strict rule docs (fixes #4583) (Nicholas C. Zakas)
* Docs: Reference .eslintrc.* in contributing docs (fixes #4532) (Kai Cataldo)
* Fix: Add for-of to `curly` rule (fixes #4571) (Kai Cataldo)
* Fix: Ignore space before function in array start (fixes #4569) (alberto)

v1.10.2 - November 27, 2015

* Upgrade: [email protected] (refs #4485) (Nicholas C. Zakas)
* Upgrade: Pinned down js-yaml to avoid breaking dep (fixes #4553) (alberto)
* Fix: lines-around-comment with multiple comments (fixes #3509) (alberto)
* Upgrade: [email protected] (fixes #4545) (Kevin Partington)
* Fix: Bugfix for eqeqeq autofix (fixes #4540) (Kevin Partington)
* Fix: Add for-in to `curly` rule (fixes #4436) (Kai Cataldo)
* Fix: `valid-jsdoc` unneeded require check fix (fixes #4527) (Gyandeep Singh)
* Fix: `brace-style` ASI fix for if-else condition (fixes #4520) (Gyandeep Singh)
* Build: Add branch update during release process (fixes #4491) (Gyandeep Singh)
* Build: Allow revert commits in commit messages (fixes #4452) (alberto)
* Fix: Incorrect location in no-fallthrough (fixes #4516) (alberto)
* Fix: `no-spaced-func` had been crashed (fixes #4508) (Toru Nagashima)
* Fix: Add a RestProperty test of `no-undef` (fixes #3271) (Toru Nagashima)
* Docs: Load badge from HTTPS (Brian J Brennan)
* Build: Update eslint bot messages (fixes #4497) (Nicholas C. Zakas)

v1.10.1 - November 20, 2015

* Fix: Revert freezing context object (refs #4495) (Nicholas C. Zakas)
* 1.10.0 (Nicholas C. Zakas)

v1.10.0 - November 20, 2015

* Docs: Remove dupes from changelog (Nicholas C. Zakas)
* Update: --init to create extensioned files (fixes #4476) (Nicholas C. Zakas)
* Docs: Update description of exported comment (fixes #3916) (Nicholas C. Zakas)
* Docs: Move legacy rules to stylistic (files #4111) (Nicholas C. Zakas)
* Docs: Clean up description of recommended rules (fixes #4365) (Nicholas C. Zakas)
* Docs: Fix home directory config description (fixes #4398) (Nicholas C. Zakas)
* Update: Add class support to `require-jsdoc` rule (fixes #4268) (Gyandeep Singh)
* Update: return type error in `valid-jsdoc` rule (fixes #4443) (Gyandeep Singh)
* Update: Display errors at the place where fix should go (fixes #4470) (nightwing)
* Docs: Fix typo in default `cacheLocation` value (Andrew Hutchings)
* Fix: Handle comments in block-spacing (fixes #4387) (alberto)
* Update: Accept array for `ignorePattern` (fixes #3982) (Jesse McCarthy)
* Update: replace label and break with IIFE and return (fixes #4459) (Ilya Panasenko)
* Fix: space-before-keywords false positive (fixes #4449) (alberto)
* Fix: Improves performance (refs #3530) (Toru Nagashima)
* Fix: Autofix quotes produces invalid javascript (fixes #4380) (nightwing)
* Docs: Update indent.md (Nathan Brown)
* New: Disable comment config option (fixes #3901) (Matthew Riley MacPherson)
* New: Config files with extensions (fixes #4045, fixes #4263) (Nicholas C. Zakas)
* Revert "Update: Add JSX exceptions to no-extra-parens (fixes #4229)" (Brandon Mills)
* Update: Add JSX exceptions to no-extra-parens (fixes #4229) (Brandon Mills)
* Docs: Replace link to deprecated rule with newer rule (Andrew Marshall)
* Fix: `no-extend-native` crashed at empty defineProperty (fixes #4438) (Toru Nagashima)
* Fix: Support empty if blocks in lines-around-comment (fixes #4339) (alberto)
* Fix: `curly` warns wrong location for `else` (fixes #4362) (Toru Nagashima)
* Fix: `id-length` properties never option (fixes #4347) (Toru Nagashima)
* Docs: missing close rbracket in example (@storkme)
* Revert "Update: Allow empty arrow body (fixes #4411)" (Nicholas C. Zakas)
* Fix: eqeqeq autofix avoids clashes with space-infix-ops (fixes #4423) (Kevin Partington)
* Docs: Document semi-spacing behaviour (fixes #4404) (alberto)
* Update: Allow empty arrow body (fixes #4411) (alberto)
* Fix: Handle comments in comma-spacing (fixes #4389) (alberto)
* Update: Refactor eslint.verify args (fixes #4395) (Nicholas C. Zakas)
* Fix: no-undef-init should ignore const (fixes #4284) (Nicholas C. Zakas)
* Fix: Add the missing "as-needed" docs to the radix rule (fixes #4364) (Michał Gołębiowski)
* Fix: Display singular/plural version of "line" in message (fixes #4359) (Marius Schulz)
* Update: Add Popular Style Guides (fixes #4320) (Jamund Ferguson)
* Fix: eslint.report can be called w/o node if loc provided (fixes #4220) (Kevin Partington)
* Update: no-implicit-coercion validate AssignmentExpression (fixes #4348) (Ilya Panasenko)

v1.9.0 - November 6, 2015

* Update: Make radix accept a "as-needed" option (fixes #4048) (Michał Gołębiowski)
Expand Down
5 changes: 4 additions & 1 deletion Makefile.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ function getReleaseType(version) {
function release(type) {
var newVersion;/* , changes;*/

exec("git checkout master && git fetch origin && git reset --hard origin/master");
exec("npm install && npm prune");

target.test();
echo("Generating new version");
newVersion = execSilent("npm version " + type).trim();
Expand Down Expand Up @@ -944,7 +947,7 @@ target.checkGitCommit = function() {
}

// Only check non-release messages
if (!semver.valid(commitMsgs[0])) {
if (!semver.valid(commitMsgs[0]) && !/^Revert /.test(commitMsgs[0])) {
if (commitMsgs[0].slice(0, commitMsgs[0].indexOf("\n")).length > 72) {
echo(" - First line of commit message must not exceed 72 characters");
failed = true;
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,5 +122,5 @@ Join our [Mailing List](https://groups.google.com/group/eslint) or [Chatroom](ht
[travis-url]: https://travis-ci.org/eslint/eslint
[coveralls-image]: https://img.shields.io/coveralls/eslint/eslint/master.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/eslint/eslint?branch=master
[downloads-image]: http://img.shields.io/npm/dm/eslint.svg?style=flat-square
[downloads-image]: https://img.shields.io/npm/dm/eslint.svg?style=flat-square
[downloads-url]: https://www.npmjs.com/package/eslint
3 changes: 1 addition & 2 deletions bin/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,13 @@ if (useStdIn) {
}
}));
} else if (init) {
var configInit = require("../lib/config-initializer");
var configInit = require("../lib/config/config-initializer");
configInit.initializeConfig(function(err) {
if (err) {
exitCode = 1;
console.error(err.message);
console.error(err.stack);
} else {
console.log("Successfully created .eslintrc file in " + process.cwd());
exitCode = 0;
}
});
Expand Down
15 changes: 9 additions & 6 deletions docs/developer-guide/nodejs-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@ The most important method on `linter` is `verify()`, which initiates linting of

* `code` - the source code to lint (a string or instance of `SourceCode`).
* `config` - a configuration object.
* `filename` - (optional) the filename to associate with the source code.
* `saveState` - (optional) set to true to maintain the internal state of `linter` after linting (mostly used for testing purposes).
* `options` - (optional) Additional options for this run.
* `filename` - (optional) the filename to associate with the source code.
* `saveState` - (optional) set to true to maintain the internal state of `linter` after linting (mostly used for testing purposes).
* `allowInlineConfig` - (optional) set to `false` to disable inline comments from changing eslint rules.

You can call `verify()` like this:

Expand All @@ -40,7 +42,7 @@ var messages = linter.verify("var foo;", {
rules: {
semi: 2
}
}, "foo.js");
}, { filename: "foo.js" });

// or using SourceCode

Expand All @@ -53,7 +55,7 @@ var messages = linter.verify(code, {
rules: {
semi: 2
}
}, "foo.js");
}, { filename: "foo.js" });
```

The `verify()` method returns an array of objects containing information about the linting warnings and errors. Here's an example:
Expand Down Expand Up @@ -95,7 +97,7 @@ var messages = linter.verify("var foo = bar;", {
rules: {
semi: 2
}
}, "foo.js");
}, { filename: "foo.js" });

var code = linter.getSourceCode();

Expand Down Expand Up @@ -123,14 +125,15 @@ The `CLIEngine` is a constructor, and you can create a new instance by passing i
* `fix` - True indicates that fixes should be applied to the text when possible.
* `ignore` - False disables use of `.eslintignore` (default: true). Corresponds to `--no-ignore`.
* `ignorePath` - The ignore file to use instead of `.eslintignore` (default: null). Corresponds to `--ignore-path`.
* `ignorePattern` - Glob patterns for paths to ignore. String or array of strings.
* `baseConfig` - Set to false to disable use of base config. Could be set to an object to override default base config as well.
* `rulePaths` - An array of directories to load custom rules from (default: empty array). Corresponds to `--rulesdir`.
* `rules` - An object of rules to use (default: null). Corresponds to `--rule`.
* `useEslintrc` - Set to false to disable use of `.eslintrc` files (default: true). Corresponds to `--no-eslintrc`.
* `parser` - Specify the parser to be used (default: `espree`). Corresponds to `--parser`.
* `cache` - Operate only on changed files (default: `false`). Corresponds to `--cache`.
* `cacheFile` - Name of the file where the cache will be stored (default: `.eslintcache`). Corresponds to `--cache-file`. Deprecated: use `cacheLocation` instead.
* `cacheLocation` - Name of the file or directory where the cache will be stored (default: `.estlintcache`). Correspond to `--cache-location`
* `cacheLocation` - Name of the file or directory where the cache will be stored (default: `.eslintcache`). Correspond to `--cache-location`

For example:

Expand Down
2 changes: 2 additions & 0 deletions docs/developer-guide/working-with-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ The main method you'll use is `context.report()`, which publishes a warning or e
* `data` - (optional) placeholder data for `message`.
* `fix` - (optional) a function that applies a fix to resolve the problem.

Note that at least one of `node` or `loc` is required.

The simplest example is to use just `node` and `message`:

```js
Expand Down
18 changes: 7 additions & 11 deletions docs/rules/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Rules

Rules in ESLint are divided into several categories to help you better understand their value. Though none are enabled by default, you can turn on rules that ESLint recommends by specifying your configuration to inherit from `eslint:recommended`. The rules that will be enabled when you inherit from `eslint:recommended` are indicated below as "(recommended)". For more information on how to configure rules and inherit from `eslint:recommended`, please see the [configuration documentation](../user-guide/configuring.md).
Rules in ESLint are divided into several categories to help you better understand their value. All rules are disabled by default. ESLint recommends some rules to catch common problems, and you can use these recommended rules by including `extends: "eslint:recommended"` in your configuration file. The rules that will be enabled when you inherit from `eslint:recommended` are indicated below as "(recommended)". For more information on how to configure rules and use `extends`, please see the [configuration documentation](../user-guide/configuring.md).

Some rules are fixable using the `--fix` command line flag. Those rules are marked as "(fixable)" below.

Expand Down Expand Up @@ -158,11 +158,16 @@ These rules are purely matters of style and are quite subjective.
* [key-spacing](key-spacing.md) - enforce spacing between keys and values in object literal properties
* [linebreak-style](linebreak-style.md) - disallow mixed 'LF' and 'CRLF' as linebreaks
* [lines-around-comment](lines-around-comment.md) - enforce empty lines around comments
* [max-depth](max-depth.md) - specify the maximum depth that blocks can be nested
* [max-len](max-len.md) - specify the maximum length of a line in your program
* [max-nested-callbacks](max-nested-callbacks.md) - specify the maximum depth callbacks can be nested
* [max-params](max-params.md) - limits the number of parameters that can be used in the function declaration.
* [max-statements](max-statements.md) - specify the maximum number of statement allowed in a function
* [new-cap](new-cap.md) - require a capital letter for constructors
* [new-parens](new-parens.md) - disallow the omission of parentheses when invoking a constructor with no arguments
* [newline-after-var](newline-after-var.md) - require or disallow an empty newline after variable declarations
* [no-array-constructor](no-array-constructor.md) - disallow use of the `Array` constructor
* [no-bitwise](no-bitwise.md) - disallow use of bitwise operators
* [no-continue](no-continue.md) - disallow use of the `continue` statement
* [no-inline-comments](no-inline-comments.md) - disallow comments inline after code
* [no-lonely-if](no-lonely-if.md) - disallow `if` as the only statement in an `else` block
Expand All @@ -171,6 +176,7 @@ These rules are purely matters of style and are quite subjective.
* [no-negated-condition](no-negated-condition.md) - disallow negated conditions
* [no-nested-ternary](no-nested-ternary.md) - disallow nested ternary expressions
* [no-new-object](no-new-object.md) - disallow the use of the `Object` constructor
* [no-plusplus](no-plusplus.md) - disallow use of unary operators, `++` and `--`
* [no-restricted-syntax](no-restricted-syntax.md) - disallow use of certain syntax in code
* [no-spaced-func](no-spaced-func.md) - disallow space between function identifier and application (fixable)
* [no-ternary](no-ternary.md) - disallow the use of ternary operators
Expand Down Expand Up @@ -222,16 +228,6 @@ These rules are only relevant to ES6 environments.
* [prefer-template](prefer-template.md) - suggest using template literals instead of strings concatenation
* [require-yield](require-yield.md) - disallow generator functions that do not have `yield`

## Legacy

The following rules are included for compatibility with [JSHint](http://jshint.com/) and [JSLint](http://jslint.com/). While the names of the rules may not match up with the JSHint/JSLint counterpart, the functionality is the same.

* [max-depth](max-depth.md) - specify the maximum depth that blocks can be nested
* [max-len](max-len.md) - specify the maximum length of a line in your program
* [max-params](max-params.md) - limits the number of parameters that can be used in the function declaration.
* [max-statements](max-statements.md) - specify the maximum number of statement allowed in a function
* [no-bitwise](no-bitwise.md) - disallow use of bitwise operators
* [no-plusplus](no-plusplus.md) - disallow use of unary operators, `++` and `--`

## Removed

Expand Down
2 changes: 1 addition & 1 deletion docs/rules/indent.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Level of indentation denotes the multiple of the indent specified. Example:
* Indent of tabs with SwitchCase set to 2 will indent `SwitchCase` with 2 tabs with respect to switch.


2 space indentation with enabled switch cases validation
2 space indentation with enabled switch cases indentation

```json
"indent": [2, 2, {"SwitchCase": 1}]
Expand Down
4 changes: 4 additions & 0 deletions docs/rules/no-implicit-coercion.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ var b = ~foo.indexOf(".");
var n = +foo;
var n = 1 * foo;
var s = "" + foo;
foo += "";
```

Those can be replaced with the following code:
Expand All @@ -21,6 +22,7 @@ var b = foo.indexOf(".") !== -1;
var n = Number(foo);
var n = Number(foo);
var s = String(foo);
foo = String(foo);
```

## Rule Details
Expand Down Expand Up @@ -96,6 +98,8 @@ The following patterns are considered problems:
/*eslint no-implicit-coercion: 2*/

var n = "" + foo; /*error use `String(foo)` instead.*/

foo += ""; /*error use `foo = String(foo)` instead.*/
```

The following patterns are not considered problems:
Expand Down
1 change: 1 addition & 0 deletions docs/rules/no-undef-init.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ The following patterns are not considered problems:

var foo;
let bar;
const baz = undefined;
```

## When Not To Use It
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-underscore-dangle.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var file = __filename;


```js
/*eslint no-underscore-dangle: [2, { "allow": ["foo_", "_bar"] }*/
/*eslint no-underscore-dangle: [2, { "allow": ["foo_", "_bar"] }]*/

var foo_;
foo._bar();
Expand Down
3 changes: 1 addition & 2 deletions docs/rules/no-unused-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ myFunc(function foo() {

### Exporting Variables

In some environments you may use `var` to create a global variable that may be used by other scripts. You can
use the `/* exported variableName */` comment block to indicate that this variable may be used elsewhere.
In environments outside of CommonJS or ECMAScript modules, you may use `var` to create a global variable that may be used by other scripts. You can use the `/* exported variableName */` comment block to indicate that this variable is being exported and therefore should not be considered unused. Note that `/* exported */` has no effect when used with the `node` or `commonjs` environments or when `ecmaFeatures.modules` is true.

### Options

Expand Down
57 changes: 53 additions & 4 deletions docs/rules/radix.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,39 @@ var num = parseInt("071", 10); // 71

ECMAScript 5 changed the behavior of `parseInt()` so that it no longer autodetects octal literals and instead treats them as decimal literals. However, the differences between hexadecimal and decimal interpretation of the first parameter causes many developers to continue using the radix parameter to ensure the string is interpreted in the intended way.

On the other hand, if the code is targeting only ES5-compliant environments passing the radix `10` may be redundant. In such a case you might want to disallow using such a radix.

## Rule Details

This rule is aimed at preventing the unintended conversion of a string to a number of a different base than intended.
This rule is aimed at preventing the unintended conversion of a string to a number of a different base than intended or at preventing the redundant `10` radix if targeting modern environments only.

### Options

There are two options for this rule:

* `"always"` enforces providing a radix (default)
* `"as-needed"` disallows providing the `10` radix

Depending on your coding conventions, you can choose either option by specifying it in your configuration:

```json
"radix": [2, "always"]
```

#### always

The following patterns are considered problems:

```js
/*eslint radix: 2*/

var num = parseInt("071"); /*error Missing radix parameter.*/
var num = parseInt("071"); /*error Missing radix parameter.*/

var num = parseInt(someValue); /*error Missing radix parameter.*/
var num = parseInt(someValue); /*error Missing radix parameter.*/

var num = parseInt("071", "abc"); /*error Invalid radix parameter.*/

var num = parseInt(); /*error Missing parameters.*/
```

The following patterns are not considered problems:
Expand All @@ -37,12 +58,40 @@ The following patterns are not considered problems:

var num = parseInt("071", 10);

var num = parseInt("071", 8);

var num = parseFloat(someValue);
```

#### as-needed

The following patterns are considered problems:

```js
/*eslint radix: [2. "as-needed"] */

var num = parseInt("071", 10); /*error Redundant radix parameter.*/

var num = parseInt("071", "abc"); /*error Invalid radix parameter.*/

var num = parseInt(); /*error Missing parameters.*/
```

The following patterns are not considered problems:

```js
/*eslint radix: [2. "as-needed"] */

var num = parseInt("071");

var num = parseInt("071", 8);

var num = parseFloat(someValue);
```

## When Not To Use It

If you are certain of the first argument's format, then the second argument is unnecessary and you can safely turn this rule off.
If you don't want to enforce either presence or omission of the `10` radix value you can turn this rule off.

## Further Reading

Expand Down
Loading