diff --git a/_data/rules.yml b/_data/rules.yml
index dc1f21ac2d..18640da387 100644
--- a/_data/rules.yml
+++ b/_data/rules.yml
@@ -15,7 +15,7 @@ categories:
- description: disallow using an async function as a Promise executor
fixable: false
name: no-async-promise-executor
- recommended: false
+ recommended: true
- description: disallow `await` inside of loops
fixable: false
name: no-await-in-loop
@@ -31,7 +31,7 @@ categories:
- description: disallow the use of `console`
fixable: false
name: no-console
- recommended: true
+ recommended: false
- description: disallow constant expressions in conditions
fixable: false
name: no-constant-condition
@@ -101,7 +101,7 @@ categories:
character class syntax
fixable: false
name: no-misleading-character-class
- recommended: false
+ recommended: true
- description: disallow calling global object properties as functions
fixable: false
name: no-obj-calls
@@ -109,7 +109,7 @@ categories:
- description: disallow calling some `Object.prototype` methods directly on objects
fixable: false
name: no-prototype-builtins
- recommended: false
+ recommended: true
- description: disallow multiple spaces in regular expressions
fixable: true
name: no-regex-spaces
@@ -145,7 +145,7 @@ categories:
`await` or `yield`
fixable: false
name: require-atomic-updates
- recommended: false
+ recommended: true
- description: require calls to `isNaN()` when checking for `NaN`
fixable: false
name: use-isnan
@@ -226,7 +226,7 @@ categories:
- description: >-
disallow division operators explicitly at the beginning of regular
expressions
- fixable: false
+ fixable: true
name: no-div-regex
recommended: false
- description: disallow `else` blocks after `return` statements in `if` statements
@@ -404,7 +404,7 @@ categories:
- description: disallow unnecessary `catch` clauses
fixable: false
name: no-useless-catch
- recommended: false
+ recommended: true
- description: disallow unnecessary concatenation of literals or template literals
fixable: false
name: no-useless-concat
@@ -428,7 +428,7 @@ categories:
- description: disallow `with` statements
fixable: false
name: no-with
- recommended: false
+ recommended: true
- description: enforce using named capture group in regular expression
fixable: false
name: prefer-named-capture-group
@@ -500,7 +500,7 @@ categories:
- description: disallow identifiers from shadowing restricted names
fixable: false
name: no-shadow-restricted-names
- recommended: false
+ recommended: true
- description: >-
disallow the use of undeclared variables unless mentioned in `/*global
*/` comments
@@ -755,7 +755,9 @@ categories:
fixable: false
name: new-cap
recommended: false
- - description: require parentheses when invoking a constructor with no arguments
+ - description: >-
+ enforce or disallow parentheses when invoking a constructor with no
+ arguments
fixable: true
name: new-parens
recommended: false
diff --git a/_data/sponsors.json b/_data/sponsors.json
index 3369d90b16..1bfc9de68e 100644
--- a/_data/sponsors.json
+++ b/_data/sponsors.json
@@ -5,28 +5,35 @@
"url": "http://salesforce.com",
"image": "https://images.opencollective.com/salesforce/logo.png",
"monthlyDonation": 100000,
- "totalDonations": 200000
+ "totalDonations": 300000
},
{
"name": "Airbnb",
"url": "https://www.airbnb.com/",
"image": "https://images.opencollective.com/airbnb/logo.png",
"monthlyDonation": 100000,
- "totalDonations": 401000
+ "totalDonations": 501000
},
{
"name": "Facebook Open Source",
"url": "https://code.facebook.com/projects/",
"image": "https://images.opencollective.com/fbopensource/logo.png",
"monthlyDonation": 100000,
- "totalDonations": 400000
+ "totalDonations": 500000
},
{
"name": "Badoo",
"url": "https://badoo.com/team?utm_source=eslint",
"image": "https://images.opencollective.com/badoo/logo.png",
"monthlyDonation": 100000,
- "totalDonations": 400000
+ "totalDonations": 500000
+ },
+ {
+ "name": "Shopify",
+ "url": "https://www.shopify.com",
+ "image": "https://images.opencollective.com/shopify/logo.png",
+ "monthlyDonation": 100000,
+ "totalDonations": 200000
}
],
"silver": [
@@ -35,7 +42,7 @@
"url": "https://www.ampproject.org/",
"image": "https://images.opencollective.com/amp/logo.png",
"monthlyDonation": 50000,
- "totalDonations": 200000
+ "totalDonations": 250000
}
],
"bronze": [
@@ -44,34 +51,41 @@
"url": "https://usave.co.uk/utilities/broadband/",
"image": "https://images.opencollective.com/usave/logo.png",
"monthlyDonation": 20000,
- "totalDonations": 40000
+ "totalDonations": 60000
},
{
"name": "TekHattan",
"url": "https://tekhattan.com",
"image": "https://images.opencollective.com/tekhattan/logo.png",
"monthlyDonation": 20000,
- "totalDonations": 40000
+ "totalDonations": 60000
},
{
"name": "Faithlife",
"url": "https://faithlife.com/ref/about",
"image": "https://images.opencollective.com/faithlife/logo.png",
"monthlyDonation": 20000,
- "totalDonations": 80000
+ "totalDonations": 100000
},
{
"name": "ThemeIsle",
"url": "https://themeisle.com",
"image": "https://images.opencollective.com/themeisle/logo.png",
"monthlyDonation": 20000,
- "totalDonations": 40000
+ "totalDonations": 60000
},
{
"name": "Marfeel",
"url": "https://www.marfeel.com/",
"image": "https://images.opencollective.com/marfeel/logo.png",
"monthlyDonation": 20000,
+ "totalDonations": 60000
+ },
+ {
+ "name": "clay",
+ "url": "https://clay.global",
+ "image": "https://images.opencollective.com/clayglobal/logo.png",
+ "monthlyDonation": 20000,
"totalDonations": 40000
},
{
@@ -79,21 +93,21 @@
"url": "https://discordapp.com",
"image": "https://images.opencollective.com/discordapp/logo.png",
"monthlyDonation": 20000,
- "totalDonations": 20000
+ "totalDonations": 40000
},
{
"name": "JSHeroes ",
"url": "https://jsheroes.io/",
"image": "https://images.opencollective.com/jsheroes1/logo.png",
"monthlyDonation": 20000,
- "totalDonations": 60000
+ "totalDonations": 80000
},
{
"name": "Fire Stick Tricks",
"url": "http://www.firesticktricks.com",
"image": "https://images.opencollective.com/fire-stick-tricks/logo.png",
"monthlyDonation": 20000,
- "totalDonations": 40000
+ "totalDonations": 60000
}
],
"backers": [
@@ -102,180 +116,187 @@
"url": "https://www.neovation.com",
"image": "https://images.opencollective.com/neovationcorp/logo.png",
"monthlyDonation": 2500,
- "totalDonations": 10000
+ "totalDonations": 12500
},
{
"name": "Sebastian Software GmbH",
"url": "http://sebastian-software.de/",
"image": "https://images.opencollective.com/sebastiansoft/logo.png",
"monthlyDonation": 2500,
- "totalDonations": 7500
+ "totalDonations": 10000
},
{
"name": "Summit",
"url": "https://www.summit.co.uk/",
"image": "https://images.opencollective.com/summitmedia/logo.png",
"monthlyDonation": 1000,
- "totalDonations": 4000
+ "totalDonations": 5000
},
{
"name": "Benjamin Piouffle",
"url": "https://benjamin.piouffle.com",
"image": "https://images.opencollective.com/betree/avatar.png",
"monthlyDonation": 1000,
- "totalDonations": 3600
+ "totalDonations": 4600
},
{
"name": "Sergey Bondar",
"url": null,
"image": "https://images.opencollective.com/marapper/avatar.png",
"monthlyDonation": 600,
- "totalDonations": 2400
+ "totalDonations": 3000
},
{
- "name": "Simon Korzun",
- "url": "http://korzun.com",
- "image": "https://images.opencollective.com/simon-korzun/avatar.png",
- "monthlyDonation": 500,
- "totalDonations": 2000
- },
- {
- "name": "Pawel Grzybek",
- "url": "https://pawelgrzybek.com/",
- "image": "https://images.opencollective.com/pawelgrzybek/avatar.png",
+ "name": "Dan Foley",
+ "url": "http://cantremember.com",
+ "image": "https://images.opencollective.com/cantremember/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 2000
+ "totalDonations": 2500
},
{
"name": "Kevin Lamping",
"url": "http://klamp.in",
"image": "https://images.opencollective.com/klamping/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 2000
+ "totalDonations": 2500
},
{
"name": "Matan Kushner",
"url": "http://matchai.me",
"image": "https://images.opencollective.com/matchai/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 2500
+ "totalDonations": 3000
},
{
"name": "Thomas Hermann",
"url": null,
"image": "https://images.opencollective.com/novascreen/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 2000
+ "totalDonations": 2500
},
{
"name": "Joseph Percy",
"url": null,
"image": "https://images.opencollective.com/joseph-percy/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 2000
+ "totalDonations": 2500
},
{
"name": "Alexey Raspopov",
"url": "https://alexeyraspopov.com",
"image": "https://images.opencollective.com/alexeyraspopov/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 2000
+ "totalDonations": 2500
},
{
"name": "Jarrod Davis",
"url": "https://jarrodldavis.com/",
"image": "https://images.opencollective.com/jarrodldavis/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 2000
+ "totalDonations": 2500
},
{
"name": "Gavin Mogan",
"url": "https://www.gavinmogan.com",
"image": "https://images.opencollective.com/gavinmogan/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 2000
+ "totalDonations": 2500
},
{
"name": "Mariusz Nowak",
"url": "https://medikoo.com",
"image": "https://images.opencollective.com/medikoo/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 2000
+ "totalDonations": 2500
},
{
- "name": "Jordan Harband",
- "url": "https://twitter.com/LJHarb",
- "image": "https://images.opencollective.com/ljharb/avatar.png",
+ "name": "Simon Korzun",
+ "url": "http://korzun.com",
+ "image": "https://images.opencollective.com/simon-korzun/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 2000
+ "totalDonations": 2500
},
{
- "name": "Dan Foley",
- "url": "http://cantremember.com",
- "image": "https://images.opencollective.com/cantremember/avatar.png",
+ "name": "Jordan Harband",
+ "url": "https://twitter.com/LJHarb",
+ "image": "https://images.opencollective.com/ljharb/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 2000
+ "totalDonations": 2500
},
{
"name": "Maisonette Inc",
"url": "https://www.maisonette.com",
"image": "https://images.opencollective.com/maisonetteworld/logo.png",
"monthlyDonation": 500,
- "totalDonations": 2000
+ "totalDonations": 2500
},
{
"name": "Martin K.",
"url": "https://kluska.cz",
"image": "https://images.opencollective.com/martin-kluska/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 2000
+ "totalDonations": 2500
},
{
"name": "Third Iron",
"url": "https://thirdiron.com",
"image": "https://images.opencollective.com/third_iron/logo.png",
"monthlyDonation": 500,
- "totalDonations": 2000
+ "totalDonations": 2500
},
{
"name": "Chih-Hsuan Fan",
"url": "https://pymaster.tw",
"image": "https://images.opencollective.com/pc035860/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 2000
+ "totalDonations": 2500
},
{
"name": "Ivan Miskovic",
"url": "https://twitter.com/ivanandsickle",
"image": "https://images.opencollective.com/ivanandsickle/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 1500
+ "totalDonations": 2000
},
{
- "name": "Andrew Rota",
- "url": "https://twitter.com/andrewrota",
- "image": "https://images.opencollective.com/andrewrota/avatar.png",
+ "name": "Nubz Ltd",
+ "url": "http://nubz.com",
+ "image": "https://images.opencollective.com/nubz/logo.png",
"monthlyDonation": 500,
- "totalDonations": 1500
+ "totalDonations": 2500
},
{
- "name": "AJ Klein",
- "url": "https://twitter.com/jumbleofideas",
- "image": "https://images.opencollective.com/aj-klein/avatar.png",
+ "name": "Will McAuliff",
+ "url": "https://twitter.com/womcauliff",
+ "image": "https://images.opencollective.com/womcauliff/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 1500
+ "totalDonations": 2000
},
{
- "name": "Mikko Piuhola",
+ "name": "Misaka Network, Inc.",
+ "url": "https://www.misaka.io/dns/?utm_source=opencollective",
+ "image": "https://images.opencollective.com/misaka/logo.png",
+ "monthlyDonation": 500,
+ "totalDonations": 1000
+ },
+ {
+ "name": "Oliver Sieweke",
"url": null,
- "image": "https://images.opencollective.com/mikko-piuhola/avatar.png",
+ "image": "https://images.opencollective.com/oliver-sieweke/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 1500
+ "totalDonations": 1000
},
{
- "name": "Nubz Ltd",
- "url": "http://nubz.com",
- "image": "https://images.opencollective.com/nubz/logo.png",
+ "name": "Andrew Rota",
+ "url": "https://twitter.com/andrewrota",
+ "image": "https://images.opencollective.com/andrewrota/avatar.png",
+ "monthlyDonation": 500,
+ "totalDonations": 2000
+ },
+ {
+ "name": "AJ Klein",
+ "url": "https://twitter.com/jumbleofideas",
+ "image": "https://images.opencollective.com/aj-klein/avatar.png",
"monthlyDonation": 500,
"totalDonations": 2000
},
@@ -284,28 +305,28 @@
"url": "https://www.quora.com/profile/Alexandre-Morgaut",
"image": "https://images.opencollective.com/alexandre-morgaut/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 1000
+ "totalDonations": 1500
},
{
"name": "Eric Lanehart",
"url": "http://pushred.co",
"image": "https://images.opencollective.com/pushred/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 1500
- },
- {
- "name": "Will McAuliff",
- "url": "https://twitter.com/womcauliff",
- "image": "https://images.opencollective.com/womcauliff/avatar.png",
- "monthlyDonation": 500,
- "totalDonations": 1500
+ "totalDonations": 2000
},
{
"name": "Jb Landry",
"url": "https://jblandry.info",
"image": "https://images.opencollective.com/jblandry/avatar.png",
"monthlyDonation": 500,
- "totalDonations": 1000
+ "totalDonations": 1500
+ },
+ {
+ "name": "qnyp",
+ "url": "https://qnyp.com",
+ "image": "https://images.opencollective.com/qnyp/logo.png",
+ "monthlyDonation": 200,
+ "totalDonations": 2200
}
]
}
\ No newline at end of file
diff --git a/_posts/2019-05-10-eslint-v6.0.0-alpha.1-released.md b/_posts/2019-05-10-eslint-v6.0.0-alpha.1-released.md
new file mode 100644
index 0000000000..febf2f72ed
--- /dev/null
+++ b/_posts/2019-05-10-eslint-v6.0.0-alpha.1-released.md
@@ -0,0 +1,112 @@
+---
+layout: post
+title: ESLint v6.0.0-alpha.1 released
+tags:
+ - release
+ - major
+---
+# ESLint v6.0.0-alpha.1 released
+
+We just pushed ESLint v6.0.0-alpha.1, which is a new prerelease for ESLint v6. This release adds some new features and fixes several bugs found in the previous release. This release also has some breaking changes, so please read the following closely.
+
+## Highlights
+
+Most of the highlights of this release are breaking changes, and are discussed further in the [migration guide](/docs/6.0.0/user-guide/migrating-to-6.0.0).
+
+New breaking changes in this prerelease include:
+
+* [Some config-loading bugs have been fixed](/docs/6.0.0/user-guide/migrating-to-6.0.0#-overrides-in-an-extended-config-file-can-now-be-overridden-by-a-parent-config-file). This change involved some refactoring to how config files are processed internally. Please let us know if you encounter any problems relating to configuration in this release.
+* [`eslint:recommended` has been updated](/docs/6.0.0/user-guide/migrating-to-6.0.0#-eslintrecommended-has-been-updated)
+* [`no-redeclare` has been made stricter](/docs/6.0.0/user-guide/migrating-to-6.0.0#no-redeclare-updates)
+
+### Installing
+
+Since this is a pre-release version, you will not automatically be upgraded by npm. You must specify the `next` tag when installing:
+
+```
+npm i eslint@next --save-dev
+```
+
+You can also specify the version directly:
+
+```
+npm i eslint@6.0.0-alpha.1 --save-dev
+```
+
+### Migration Guide
+
+If you're upgrading from ESLint v5.x, we recommend looking at the [migration guide](/docs/6.0.0/user-guide/migrating-to-6.0.0), which describes the changes in great detail along with the steps you should take to address them. We expect that most users should be able to upgrade without any build changes, but the migration guide should be a useful resource if you encounter problems.
+
+
+## Breaking Changes
+
+
+* [`6ae21a4`](https://github.com/eslint/eslint/commit/6ae21a4bfe5a1566f787fbad798182a524b96d28) Breaking: fix config loading (fixes [#11510](https://github.com/eslint/eslint/issues/11510), fixes [#11559](https://github.com/eslint/eslint/issues/11559), fixes [#11586](https://github.com/eslint/eslint/issues/11586)) ([#11546](https://github.com/eslint/eslint/issues/11546)) (Toru Nagashima)
+* [`0fc8e62`](https://github.com/eslint/eslint/commit/0fc8e62818bc8d0a0a804b59c6110818844df5f3) Breaking: eslint:recommended changes (fixes [#10768](https://github.com/eslint/eslint/issues/10768)) ([#11518](https://github.com/eslint/eslint/issues/11518)) (薛定谔的猫)
+* [`20364cc`](https://github.com/eslint/eslint/commit/20364cc4f7fe0423adce0dd44fb24fc48e1cae4b) Breaking: make [no-redeclare](/docs/rules/no-redeclare) stricter (fixes [#11370](https://github.com/eslint/eslint/issues/11370), fixes [#11405](https://github.com/eslint/eslint/issues/11405)) ([#11509](https://github.com/eslint/eslint/issues/11509)) (Toru Nagashima)
+
+
+
+
+## Features
+
+
+* [`21dd211`](https://github.com/eslint/eslint/commit/21dd2116c70b93aa8dd50d2b15e202724b11486a) New: add --resolve-plugins-relative-to flag ([#11696](https://github.com/eslint/eslint/issues/11696)) (Teddy Katz)
+
+
+
+
+
+
+## Bug Fixes
+
+
+* [`252efd3`](https://github.com/eslint/eslint/commit/252efd337b1441debb6d2cc8f51a625549b2c535) Fix: delete unnecessary duplicated question (fixes [#11617](https://github.com/eslint/eslint/issues/11617)) ([#11618](https://github.com/eslint/eslint/issues/11618)) (HelloRusk)
+* [`1a3a88d`](https://github.com/eslint/eslint/commit/1a3a88df2f952c34631d8e1d83de47178826fce0) Fix: Curly rule incorrectly flagging lexical declarations (fixes [#11663](https://github.com/eslint/eslint/issues/11663)) ([#11675](https://github.com/eslint/eslint/issues/11675)) (Brian Kurek)
+* [`f47d72c`](https://github.com/eslint/eslint/commit/f47d72ce2f2edb80cd38810894b9d4bda896bb29) Fix: not set ecmaVersion to 6 when sourceType=module (fixes [#9687](https://github.com/eslint/eslint/issues/9687)) ([#11649](https://github.com/eslint/eslint/issues/11649)) (薛定谔的猫)
+* [`9484e9e`](https://github.com/eslint/eslint/commit/9484e9ea188ff70683c3112e397c7fddcc3f8095) Fix: ignore return statements in dead code (fixes [#11647](https://github.com/eslint/eslint/issues/11647)) ([#11688](https://github.com/eslint/eslint/issues/11688)) (Toru Nagashima)
+* [`aae6f65`](https://github.com/eslint/eslint/commit/aae6f6525557ba06e73f051511646056313fcf91) Fix: don't use deprecated API ([#11689](https://github.com/eslint/eslint/issues/11689)) (Toru Nagashima)
+* [`e4400b5`](https://github.com/eslint/eslint/commit/e4400b5a02602bba7f67ea4cb874c231903c546a) Fix: [require-atomic-updates](/docs/rules/require-atomic-updates) false positive (fixes [#11194](https://github.com/eslint/eslint/issues/11194), fixes [#11687](https://github.com/eslint/eslint/issues/11687)) ([#11224](https://github.com/eslint/eslint/issues/11224)) (Toru Nagashima)
+* [`776b0fe`](https://github.com/eslint/eslint/commit/776b0fe3d93da958517ac7752682091f22eb30b4) Fix: update rule message of [no-throw-literal](/docs/rules/no-throw-literal) (fixes [#11637](https://github.com/eslint/eslint/issues/11637)) ([#11638](https://github.com/eslint/eslint/issues/11638)) (Pig Fang)
+* [`67c08b6`](https://github.com/eslint/eslint/commit/67c08b67509c54acd96aab2cec22efb53bfe6265) Fix: consider comments in [object-curly-spacing](/docs/rules/object-curly-spacing) (fixes [#11656](https://github.com/eslint/eslint/issues/11656)) ([#11657](https://github.com/eslint/eslint/issues/11657)) (Pig Fang)
+* [`b6d41cb`](https://github.com/eslint/eslint/commit/b6d41cbe28a8b28b1c1d9aa36cb4c349c73f6f1d) Fix: check token before using in [no-cond-assign](/docs/rules/no-cond-assign) (fixes [#11611](https://github.com/eslint/eslint/issues/11611)) ([#11619](https://github.com/eslint/eslint/issues/11619)) (Pig Fang)
+* [`1dfe077`](https://github.com/eslint/eslint/commit/1dfe077b7e47c6090277eb984e08bd472bb5595e) Fix: autofix of [no-unneeded-ternary](/docs/rules/no-unneeded-ternary) made syntax error (fixes [#11579](https://github.com/eslint/eslint/issues/11579)) ([#11616](https://github.com/eslint/eslint/issues/11616)) (Toru Nagashima)
+
+
+
+
+## Documentation
+
+
+* [`e84b6f8`](https://github.com/eslint/eslint/commit/e84b6f8b171ba4266164688f76d5ee45d278e5c2) Docs: fix example in [object-curly-newline](/docs/rules/object-curly-newline) docs ([#11633](https://github.com/eslint/eslint/issues/11633)) (golopot)
+* [`483239e`](https://github.com/eslint/eslint/commit/483239ec74a0c13529fc99547a784b749f41dd54) Docs: updated ImportDeclaration in docs-rules-[indent](/docs/rules/indent) ([#11679](https://github.com/eslint/eslint/issues/11679)) (Alok Takshak)
+* [`4b3b036`](https://github.com/eslint/eslint/commit/4b3b036d6240cdbc2d52e670de36b1117f5f34d7) Docs: replace `var` with `const` in code examples ([#11655](https://github.com/eslint/eslint/issues/11655)) (Niyaz Akhmetov)
+* [`f2e7828`](https://github.com/eslint/eslint/commit/f2e78281d057f38b18cc160e81ed1bb54a5b9565) Docs: Fix Node 6 LTS EOL date ([#11676](https://github.com/eslint/eslint/issues/11676)) (James Ross)
+* [`adc6585`](https://github.com/eslint/eslint/commit/adc6585ce074e03fc8a842e8ebc5b082a0ed0b65) Docs: update status of breaking changes in migration guide ([#11652](https://github.com/eslint/eslint/issues/11652)) (Teddy Katz)
+* [`eef71e4`](https://github.com/eslint/eslint/commit/eef71e455e67040168c8df8a6c9c2b4fbe805a50) Docs: add missing items to migration guide ([#11628](https://github.com/eslint/eslint/issues/11628)) (Teddy Katz)
+* [`bebd079`](https://github.com/eslint/eslint/commit/bebd0793eaf122b013cca501ff2c6b0fc05d5493) Docs: fix grammar mistake in [no-caller](/docs/rules/no-caller) docs ([#11623](https://github.com/eslint/eslint/issues/11623)) (Daniel Lemay)
+
+
+
+
+
+
+## Build Related
+
+
+* [`f62a451`](https://github.com/eslint/eslint/commit/f62a4510b007172c7160f007a6ec2aa2c9a80dd7) Build: add node 12 ([#11648](https://github.com/eslint/eslint/issues/11648)) (薛定谔的猫)
+
+
+
+
+## Chores
+
+
+* [`f42d0af`](https://github.com/eslint/eslint/commit/f42d0afd89874b459fce1eb1998247d53f9aa42b) Chore: lazy loading for rules ([#11705](https://github.com/eslint/eslint/issues/11705)) (Toru Nagashima)
+* [`f5bae78`](https://github.com/eslint/eslint/commit/f5bae78c19d5359f67969a2ff344025082e253f4) Chore: fix CLIEngine tests when os.tmpdir is a symlink ([#11697](https://github.com/eslint/eslint/issues/11697)) (Teddy Katz)
+* [`e4a08ba`](https://github.com/eslint/eslint/commit/e4a08bae82788136b6899262cb8b9ed4fe7964e6) Chore: update eslint-plugin-node to 9.0.0 ([#11670](https://github.com/eslint/eslint/issues/11670)) (Toru Nagashima)
+* [`7f290a9`](https://github.com/eslint/eslint/commit/7f290a9044ca795884ac2e495cd31b2a35f109a6) Chore: add eslint as a devDependeny ([#11654](https://github.com/eslint/eslint/issues/11654)) (Toru Nagashima)
+* [`139fd2f`](https://github.com/eslint/eslint/commit/139fd2f1254bcc524738f8c2645e0847df95e0d0) Chore: add markdownlint-cli ([#11653](https://github.com/eslint/eslint/issues/11653)) (Toru Nagashima)
+* [`8b4dba6`](https://github.com/eslint/eslint/commit/8b4dba606f8306f8ad0a37e2174a6e3236f7ebe7) Chore: Add linting to git commit ([#11556](https://github.com/eslint/eslint/issues/11556)) (Nicholas C. Zakas)
+
+
diff --git a/_posts/2019-05-25-eslint-v6.0.0-alpha.2-released.md b/_posts/2019-05-25-eslint-v6.0.0-alpha.2-released.md
new file mode 100644
index 0000000000..962996a64f
--- /dev/null
+++ b/_posts/2019-05-25-eslint-v6.0.0-alpha.2-released.md
@@ -0,0 +1,105 @@
+---
+layout: post
+title: ESLint v6.0.0-alpha.2 released
+tags:
+ - release
+ - major
+---
+# ESLint v6.0.0-alpha.2 released
+
+We just pushed ESLint v6.0.0-alpha.2, which is a new prerelease for ESLint v6. This release adds some new features and fixes several bugs found in the previous release. This release also has some breaking changes, so please read the following closely.
+
+
+
+
+## Highlights
+
+1. Configuration using glob patterns now supports `extends` and nested `overrides`
+1. Using multiple processors is now supported
+
+### Installing
+
+Since this is a pre-release version, you will not automatically be upgraded by npm. You must specify the `next` tag when installing:
+
+```
+npm i eslint@next --save-dev
+```
+
+You can also specify the version directly:
+
+```
+npm i eslint@6.0.0-alpha.2 --save-dev
+```
+
+### Migration Guide
+
+If you're upgrading from ESLint v5.x, we recommend looking at the [migration guide](/docs/6.0.0/user-guide/migrating-to-6.0.0), which describes the changes in great detail along with the steps you should take to address them. We expect that most users should be able to upgrade without any build changes, but the migration guide should be a useful resource if you encounter problems.
+
+
+
+
+## Breaking Changes
+
+
+* [`2d32a9e`](https://github.com/eslint/eslint/commit/2d32a9e8dd10a5927576bd50d184876c775da4af) Breaking: stricter rule config validating (fixes [#9505](https://github.com/eslint/eslint/issues/9505)) ([#11742](https://github.com/eslint/eslint/issues/11742)) (薛定谔的猫)
+
+
+
+
+## Features
+
+
+* [`b5fa149`](https://github.com/eslint/eslint/commit/b5fa1491d2371a721e4b5029e797ae98fd30fed2) New: multiple processors support (fixes [#11035](https://github.com/eslint/eslint/issues/11035), fixes [#11725](https://github.com/eslint/eslint/issues/11725)) ([#11552](https://github.com/eslint/eslint/issues/11552)) (Toru Nagashima)
+* [`54e6eda`](https://github.com/eslint/eslint/commit/54e6edaa2f881aab530fa14e63d92e5e0e2ca55c) New: extends in glob-based config (fixes [#8813](https://github.com/eslint/eslint/issues/8813)) ([#11554](https://github.com/eslint/eslint/issues/11554)) (Toru Nagashima)
+
+
+
+
+## Enhancements
+
+
+* [`cf9cce8`](https://github.com/eslint/eslint/commit/cf9cce81aa68e9bc23840530cb33f4c3f551fb1e) Update: Add never option for [new-parens](/docs/rules/new-parens) (refs [#10034](https://github.com/eslint/eslint/issues/10034)) ([#11379](https://github.com/eslint/eslint/issues/11379)) (pfgithub)
+* [`71716eb`](https://github.com/eslint/eslint/commit/71716eba3155266d777b994a38af524952e97696) Update: add fixer for [no-div-regex](/docs/rules/no-div-regex) rule (fixes [#11355](https://github.com/eslint/eslint/issues/11355)) ([#11744](https://github.com/eslint/eslint/issues/11744)) (joe-re)
+* [`53f7f4c`](https://github.com/eslint/eslint/commit/53f7f4cf8d8b66a1911db56e4f72764388a21cc4) Update: Uniform messages for the rules in "[complexity](/docs/rules/complexity)" section ([#11759](https://github.com/eslint/eslint/issues/11759)) (Igor Novozhilov)
+
+
+
+
+## Bug Fixes
+
+
+* [`f9790ca`](https://github.com/eslint/eslint/commit/f9790ca1baec1275f3c946586766a5713258ac32) Fix: typo: missing word in docs ([#11750](https://github.com/eslint/eslint/issues/11750)) (Dimitri Mitropoulos)
+* [`5dad0b1`](https://github.com/eslint/eslint/commit/5dad0b1d80c9cf380c49f46266c35d461d3cecad) Fix: Unignoring directories in .eslintignore (fixes [#11684](https://github.com/eslint/eslint/issues/11684)) ([#11685](https://github.com/eslint/eslint/issues/11685)) (Mykola Bilochub)
+* [`7c8e86b`](https://github.com/eslint/eslint/commit/7c8e86bf2c900cec7cd1dfd529a8c77cc81ef34c) Fix: wrong 'plugin-missing' error on Node.js 12 (fixes [#11720](https://github.com/eslint/eslint/issues/11720)) ([#11722](https://github.com/eslint/eslint/issues/11722)) (Toru Nagashima)
+
+
+
+
+## Documentation
+
+
+* [`45bd336`](https://github.com/eslint/eslint/commit/45bd336e647a6fa8a502488e5cbd27ba02712083) Docs: add about RuleTester's parser to migration guide (fixes [#11728](https://github.com/eslint/eslint/issues/11728)) ([#11761](https://github.com/eslint/eslint/issues/11761)) (Toru Nagashima)
+* [`1374be4`](https://github.com/eslint/eslint/commit/1374be44f7ec4b8c913c52cc84debc4012c4f3ea) Docs: add table of contents in readme ([#11765](https://github.com/eslint/eslint/issues/11765)) (薛定谔的猫)
+* [`e45cc3f`](https://github.com/eslint/eslint/commit/e45cc3f3dc44f3a5b6b713a1bf5ce6e46d87ca49) Docs: updated [no-proto](/docs/rules/no-proto) rule (fixes [#11743](https://github.com/eslint/eslint/issues/11743)) ([#11746](https://github.com/eslint/eslint/issues/11746)) (Francesco Trotta)
+* [`4625090`](https://github.com/eslint/eslint/commit/462509058e46770cf70307cf8dba279f0e73b967) Docs: small fix about the migration guide ([#11729](https://github.com/eslint/eslint/issues/11729)) (Toru Nagashima)
+
+
+
+
+
+
+
+
+## Chores
+
+
+* [`9b87fee`](https://github.com/eslint/eslint/commit/9b87fee9dc7b1d99a50b924cb6b81255ebb5c4a2) Chore: Fix formatter documentation generation ([#11767](https://github.com/eslint/eslint/issues/11767)) (Ilya Volodin)
+* [`f116208`](https://github.com/eslint/eslint/commit/f11620848733a3a6f58811d9bb2c3e748d6135ac) Chore: Fix site generation script for releases ([#11766](https://github.com/eslint/eslint/issues/11766)) (Ilya Volodin)
+* [`0a801d7`](https://github.com/eslint/eslint/commit/0a801d702dc41dae7eac0c802b822493ddc3ac41) Chore: improve perf test ([#11756](https://github.com/eslint/eslint/issues/11756)) (薛定谔的猫)
+* [`ec105b2`](https://github.com/eslint/eslint/commit/ec105b24f7e036ecdc4267f018529ac3765e29d5) Chore: typo in JSDoc on timing.display's return value ([#11755](https://github.com/eslint/eslint/issues/11755)) (Dimitri Mitropoulos)
+* [`15c6c63`](https://github.com/eslint/eslint/commit/15c6c6374c0425d5402142d012a541fa208bc9da) Chore: eslint-config-eslint require node >= 8 ([#11718](https://github.com/eslint/eslint/issues/11718)) (薛定谔的猫)
+* [`219aecb`](https://github.com/eslint/eslint/commit/219aecb78bc646d44bad27dc775a9b3d3dc58232) Chore: restructure files ([#11555](https://github.com/eslint/eslint/issues/11555)) (Toru Nagashima)
+* [`67c671f`](https://github.com/eslint/eslint/commit/67c671fdc1c8b08cb8d263a9bb2151e3108c88b4) Chore: ignore deprecated rules in fuzz tests ([#11710](https://github.com/eslint/eslint/issues/11710)) (Pig Fang)
+* [`af81cb3`](https://github.com/eslint/eslint/commit/af81cb3ecc5e6bf43a6a2d8f326103350513a1b8) Chore: make fuzzer produce minimal reproducible examples of bugs ([#11700](https://github.com/eslint/eslint/issues/11700)) (Teddy Katz)
+
+
diff --git a/docs/6.0.0/developer-guide/architecture.md b/docs/6.0.0/developer-guide/architecture.md
index 21c66490d8..a9d2a3e3db 100644
--- a/docs/6.0.0/developer-guide/architecture.md
+++ b/docs/6.0.0/developer-guide/architecture.md
@@ -8,14 +8,19 @@ edit_link: https://github.com/eslint/eslint/edit/master/docs/developer-guide/arc
# Architecture
+
+
At a high level, there are a few key parts to ESLint:
* `bin/eslint.js` - this is the file that actually gets executed with the command line utility. It's a dumb wrapper that does nothing more than bootstrap ESLint, passing the command line arguments to `cli`. This is intentionally small so as not to require heavy testing.
+* `lib/api.js` - this is the entry point of `require("eslint")`. This file exposes an object that contains public classes `Linter`, `CLIEngine`, `RuleTester`, and `SourceCode`.
* `lib/cli.js` - this is the heart of the ESLint CLI. It takes an array of arguments and then uses `eslint` to execute the commands. By keeping this as a separate utility, it allows others to effectively call ESLint from within another Node.js program as if it were done on the command line. The main call is `cli.execute()`. This is also the part that does all the file reading, directory traversing, input, and output.
-* `lib/linter.js` - this is the core Linter class that does code verifying based on configuration options. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly.
-* `lib/api.js` - this exposes an object that contains Linter, CLIEngine, RuleTester, and SourceCode.
-* `lib/testers/rule-tester.js` - this is a wrapper around Mocha, so that rules can be unit tested. This class lets us write consistently formatted tests for each rule that is implemented and be confident that each of the rules work. The RuleTester interface was modeled after Mocha and works with Mocha's global testing methods. RuleTester can also be modified to work with other testing frameworks.
-* `lib/util/source-code.js` - this contains a SourceCode class that is used to represent the parsed source code. It takes in source code and the Program node of the AST representing the code.
+* `lib/init/` - this module contains `--init` functionality that set up a configuration file for end users.
+* `lib/cli-engine/` - this module is `CLIEngine` class that finds source code files and configuration files then does code verifying with the `Linter` class. This includes the loading logic of configuration files, parsers, plugins, and formatters.
+* `lib/linter/` - this module is the core `Linter` class that does code verifying based on configuration options. This file does no file I/O and does not interact with the `console` at all. For other Node.js programs that have JavaScript text to verify, they would be able to use this interface directly.
+* `lib/rule-tester/` - this module is `RuleTester` class that is a wrapper around Mocha so that rules can be unit tested. This class lets us write consistently formatted tests for each rule that is implemented and be confident that each of the rules work. The RuleTester interface was modeled after Mocha and works with Mocha's global testing methods. RuleTester can also be modified to work with other testing frameworks.
+* `lib/source-code/` - this module is `SourceCode` class that is used to represent the parsed source code. It takes in source code and the Program node of the AST representing the code.
+* `lib/rules/` - this contains built-in rules that verify source code.
## The `cli` object
@@ -39,15 +44,14 @@ This object may not:
## The `CLIEngine` object
-The `CLIEngine` type represents the core functionality of the CLI except that it reads nothing from the command line and doesn't output anything by default. Instead, it accepts many (but not all) of the arguments that are passed into the CLI. It reads both configuration and source files as well as managing the environment that is passed into the `eslint` object.
+The `CLIEngine` type represents the core functionality of the CLI except that it reads nothing from the command line and doesn't output anything by default. Instead, it accepts many (but not all) of the arguments that are passed into the CLI. It reads both configuration and source files as well as managing the environment that is passed into the `Linter` object.
The main method of the `CLIEngine` is `executeOnFiles()`, which accepts an array of file and directory names to run the linter on.
This object's responsibilities include:
-* Managing the execution environment for `eslint`
+* Managing the execution environment for `Linter`
* Reading from the file system
-* Loading rule definitions
* Reading configuration information from config files (including `.eslintrc` and `package.json`)
This object may not:
@@ -57,11 +61,11 @@ This object may not:
* Output to the console
* Use formatters
-## The `eslint` object
+## The `Linter` object
-The main method of the `eslint` object is `verify()` and accepts two arguments: the source text to verify and a configuration object (the baked configuration of the given configuration file plus command line options). The method first parses the given text with `espree` (or whatever the configured parser is) and retrieves the AST. The AST is produced with both line/column and range locations which are useful for reporting location of issues and retrieving the source text related to an AST node, respectively.
+The main method of the `Linter` object is `verify()` and accepts two arguments: the source text to verify and a configuration object (the baked configuration of the given configuration file plus command line options). The method first parses the given text with `espree` (or whatever the configured parser is) and retrieves the AST. The AST is produced with both line/column and range locations which are useful for reporting location of issues and retrieving the source text related to an AST node, respectively.
-Once the AST is available, `estraverse` is used to traverse the AST from top to bottom. At each node, the `eslint` object emits an event that has the same name as the node type (i.e., "Identifier", "WithStatement", etc.). On the way back up the subtree, an event is emitted with the AST type name and suffixed with ":exit", such as "Identifier:exit" - this allows rules to take action both on the way down and on the way up in the traversal. Each event is emitted with the appropriate AST node available.
+Once the AST is available, `estraverse` is used to traverse the AST from top to bottom. At each node, the `Linter` object emits an event that has the same name as the node type (i.e., "Identifier", "WithStatement", etc.). On the way back up the subtree, an event is emitted with the AST type name and suffixed with ":exit", such as "Identifier:exit" - this allows rules to take action both on the way down and on the way up in the traversal. Each event is emitted with the appropriate AST node available.
This object's responsibilities include:
diff --git a/docs/6.0.0/developer-guide/architecture/dependency.svg b/docs/6.0.0/developer-guide/architecture/dependency.svg
new file mode 100644
index 0000000000..3b0c74c9b9
--- /dev/null
+++ b/docs/6.0.0/developer-guide/architecture/dependency.svg
@@ -0,0 +1,52 @@
+
\ No newline at end of file
diff --git a/docs/6.0.0/developer-guide/nodejs-api.md b/docs/6.0.0/developer-guide/nodejs-api.md
index e26a5b78f7..fcc956094a 100644
--- a/docs/6.0.0/developer-guide/nodejs-api.md
+++ b/docs/6.0.0/developer-guide/nodejs-api.md
@@ -46,9 +46,9 @@ While ESLint is designed to be run on the command line, it's possible to use ESL
The `SourceCode` type represents the parsed source code that ESLint executes on. It's used internally in ESLint and is also available so that already-parsed code can be used. You can create a new instance of `SourceCode` by passing in the text string representing the code and an abstract syntax tree (AST) in [ESTree](https://github.com/estree/estree) format (including location information, range information, comments, and tokens):
```js
-var SourceCode = require("eslint").SourceCode;
+const SourceCode = require("eslint").SourceCode;
-var code = new SourceCode("var foo = bar;", ast);
+const code = new SourceCode("var foo = bar;", ast);
```
The `SourceCode` constructor throws an error if the AST is missing any of the required information.
@@ -57,9 +57,9 @@ The `SourceCode` constructor strips Unicode BOM.
Please note the AST also should be parsed from stripped text.
```js
-var SourceCode = require("eslint").SourceCode;
+const SourceCode = require("eslint").SourceCode;
-var code = new SourceCode("\uFEFFvar foo = bar;", ast);
+const code = new SourceCode("\uFEFFvar foo = bar;", ast);
assert(code.hasBOM === true);
assert(code.text === "var foo = bar;");
@@ -70,12 +70,12 @@ assert(code.text === "var foo = bar;");
This is a static function on `SourceCode` that is used to split the source code text into an array of lines.
```js
-var SourceCode = require("eslint").SourceCode;
+const SourceCode = require("eslint").SourceCode;
-var code = "var a = 1;\nvar b = 2;"
+const code = "var a = 1;\nvar b = 2;"
// split code into an array
-var codeLines = SourceCode.splitLines(code);
+const codeLines = SourceCode.splitLines(code);
/*
Value of codeLines will be
@@ -91,8 +91,8 @@ var codeLines = SourceCode.splitLines(code);
The `Linter` object does the actual evaluation of the JavaScript code. It doesn't do any filesystem operations, it simply parses and reports on the code. In particular, the `Linter` object does not process configuration objects or files. You can retrieve instances of `Linter` like this:
```js
-var Linter = require("eslint").Linter;
-var linter = new Linter();
+const Linter = require("eslint").Linter;
+const linter = new Linter();
```
### Linter#verify
@@ -104,8 +104,10 @@ The most important method on `Linter` is `verify()`, which initiates linting of
* **Note**: If you want to lint text and have your configuration be read and processed, use CLIEngine's [`executeOnFiles`](#cliengineexecuteonfiles) or [`executeOnText`](#cliengineexecuteontext) instead.
* `options` - (optional) Additional options for this run.
* `filename` - (optional) the filename to associate with the source code.
- * `preprocess` - (optional) A function that accepts a string containing source text, and returns an array of strings containing blocks of code to lint. Also see: [Processors in Plugins](/docs/developer-guide/working-with-plugins#processors-in-plugins)
- * `postprocess` - (optional) A function that accepts an array of problem lists (one list of problems for each block of code from `preprocess`), and returns a one-dimensional array of problems containing problems for the original, unprocessed text. Also see: [Processors in Plugins](/docs/developer-guide/working-with-plugins#processors-in-plugins)
+ * `preprocess` - (optional) A function that [Processors in Plugins](/docs/developer-guide/working-with-plugins#processors-in-plugins) documentation describes as the `preprocess` method.
+ * `postprocess` - (optional) A function that [Processors in Plugins](/docs/developer-guide/working-with-plugins#processors-in-plugins) documentation describes as the `postprocess` method.
+ * `filterCodeBlock` - (optional) A function that decides which code blocks the linter should adopt. The function receives two arguments. The first argument is the virtual filename of a code block. The second argument is the text of the code block. If the function returned `true` then the linter adopts the code block. If the function was omitted, the linter adopts only `*.js` code blocks. If you provided a `filterCodeBlock` function, it overrides this default behavior, so the linter doesn't adopt `*.js` code blocks automatically.
+ * `disableFixes` - (optional) when set to `true`, the linter doesn't make the `fix` property of the lint result.
* `allowInlineConfig` - (optional) set to `false` to disable inline comments from changing ESLint rules.
* `reportUnusedDisableDirectives` - (optional) when set to `true`, adds reported errors for unused `eslint-disable` directives when no problems would be reported in the disabled area anyway.
@@ -114,10 +116,10 @@ If the third argument is a string, it is interpreted as the `filename`.
You can call `verify()` like this:
```js
-var Linter = require("eslint").Linter;
-var linter = new Linter();
+const Linter = require("eslint").Linter;
+const linter = new Linter();
-var messages = linter.verify("var foo;", {
+const messages = linter.verify("var foo;", {
rules: {
semi: 2
}
@@ -125,13 +127,13 @@ var messages = linter.verify("var foo;", {
// or using SourceCode
-var Linter = require("eslint").Linter,
+const Linter = require("eslint").Linter,
linter = new Linter(),
SourceCode = require("eslint").SourceCode;
-var code = new SourceCode("var foo = bar;", ast);
+const code = new SourceCode("var foo = bar;", ast);
-var messages = linter.verify(code, {
+const messages = linter.verify(code, {
rules: {
semi: 2
}
@@ -173,16 +175,16 @@ Linting message objects have a deprecated `source` property. This property **wil
You can also get an instance of the `SourceCode` object used inside of `linter` by using the `getSourceCode()` method:
```js
-var Linter = require("eslint").Linter;
-var linter = new Linter();
+const Linter = require("eslint").Linter;
+const linter = new Linter();
-var messages = linter.verify("var foo = bar;", {
+const messages = linter.verify("var foo = bar;", {
rules: {
semi: 2
}
}, { filename: "foo.js" });
-var code = linter.getSourceCode();
+const code = linter.getSourceCode();
console.log(code.text); // "var foo = bar;"
```
@@ -194,10 +196,10 @@ In this way, you can retrieve the text and AST used for the last run of `linter.
This method is similar to verify except that it also runs autofixing logic, similar to the `--fix` flag on the command line. The result object will contain the autofixed code, along with any remaining linting messages for the code that were not autofixed.
```js
-var Linter = require("eslint").Linter;
-var linter = new Linter();
+const Linter = require("eslint").Linter;
+const linter = new Linter();
-var messages = linter.verifyAndFix("var foo", {
+const messages = linter.verifyAndFix("var foo", {
rules: {
semi: 2
}
@@ -321,9 +323,9 @@ Linter.version; // => '4.5.0'
The `eslint.linter` object (deprecated) is an instance of the `Linter` class as defined [above](#linter). `eslint.linter` exists for backwards compatibility, but we do not recommend using it because any mutations to it are shared among every module that uses `eslint`. Instead, please create your own instance of `eslint.Linter`.
```js
-var linter = require("eslint").linter;
+const linter = require("eslint").linter;
-var messages = linter.verify("var foo;", {
+const messages = linter.verify("var foo;", {
rules: {
semi: 2
}
@@ -339,7 +341,7 @@ The primary Node.js API is `CLIEngine`, which is the underlying utility that run
You can get a reference to the `CLIEngine` by doing the following:
```js
-var CLIEngine = require("eslint").CLIEngine;
+const CLIEngine = require("eslint").CLIEngine;
```
The `CLIEngine` is a constructor, and you can create a new instance by passing in the options you want to use. The available options are:
@@ -363,6 +365,7 @@ The `CLIEngine` is a constructor, and you can create a new instance by passing i
* `parserOptions` - An object containing parser options (default: empty object). Corresponds to `--parser-options`.
* `plugins` - An array of plugins to load (default: empty array). Corresponds to `--plugin`.
* `reportUnusedDisableDirectives` - When set to `true`, adds reported errors for unused `eslint-disable` directives when no problems would be reported in the disabled area anyway (default: false). Corresponds to `--report-unused-disable-directives`.
+* `resolvePluginsRelativeTo` - Determines the folder where plugins should be resolved from. Should be used when an integration installs plugins and uses those plugins to lint code on behalf of the end user. Corresponds to `--resolve-plugins-relative-to`.
* `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`.
@@ -374,9 +377,9 @@ To programmatically set `.eslintrc.*` options not supported above (such as `exte
For example:
```js
-var CLIEngine = require("eslint").CLIEngine;
+const CLIEngine = require("eslint").CLIEngine;
-var cli = new CLIEngine({
+const cli = new CLIEngine({
baseConfig: {
extends: ["eslint-config-shared"],
settings: {
@@ -404,9 +407,9 @@ Note: Currently `CLIEngine` does not validate options passed to it, but may star
If you want to lint one or more files, use the `executeOnFiles()` method. This method accepts a single argument, which is an array of files and/or directories to traverse for files. You can pass the same values as you would using the ESLint command line interface, such as `"."` to search all JavaScript files in the current directory. Here's an example:
```js
-var CLIEngine = require("eslint").CLIEngine;
+const CLIEngine = require("eslint").CLIEngine;
-var cli = new CLIEngine({
+const cli = new CLIEngine({
envs: ["browser", "mocha"],
useEslintrc: false,
rules: {
@@ -415,7 +418,7 @@ var cli = new CLIEngine({
});
// lint myfile.js and all files in lib/
-var report = cli.executeOnFiles(["myfile.js", "lib/"]);
+const report = cli.executeOnFiles(["myfile.js", "lib/"]);
```
The return value is an object containing the results of the linting operation. Here's an example of a report object:
@@ -452,9 +455,9 @@ The return value is an object containing the results of the linting operation. H
You can also pass `fix: true` when instantiating the `CLIEngine` in order to have it figure out what fixes can be applied.
```js
-var CLIEngine = require("eslint").CLIEngine;
+const CLIEngine = require("eslint").CLIEngine;
-var cli = new CLIEngine({
+const cli = new CLIEngine({
envs: ["browser", "mocha"],
fix: true, // difference from last example
useEslintrc: false,
@@ -465,7 +468,7 @@ var cli = new CLIEngine({
});
// lint myfile.js and all files in lib/
-var report = cli.executeOnFiles(["myfile.js", "lib/"]);
+const report = cli.executeOnFiles(["myfile.js", "lib/"]);
```
```js
@@ -559,13 +562,13 @@ Once you get a report object, it's up to you to determine how to output the resu
You can pass filesystem-style or glob patterns to ESLint and have it function properly. In order to achieve this, ESLint must resolve non-glob patterns into glob patterns before determining which files to execute on. The `resolveFileGlobPatterns()` methods uses the current settings from `CLIEngine` to resolve non-glob patterns into glob patterns. Pass an array of patterns that might be passed to the ESLint CLI and it will return an array of glob patterns that mean the same thing. Here's an example:
```js
-var CLIEngine = require("eslint").CLIEngine;
+const CLIEngine = require("eslint").CLIEngine;
-var cli = new CLIEngine({
+const cli = new CLIEngine({
});
// pass an array of patterns
-var globPatterns = cli.resolveFileGlobPatterns(["."]);
+const globPatterns = cli.resolveFileGlobPatterns(["."]);
console.log(globPatterns[i]); // ["**/*.js"]
```
@@ -574,9 +577,9 @@ console.log(globPatterns[i]); // ["**/*.js"]
If you want to retrieve a configuration object for a given file, use the `getConfigForFile()` method. This method accepts one argument, a file path, and returns an object represented the calculated configuration of the file. Here's an example:
```js
-var CLIEngine = require("eslint").CLIEngine;
+const CLIEngine = require("eslint").CLIEngine;
-var cli = new CLIEngine({
+const cli = new CLIEngine({
envs: ["browser", "mocha"],
useEslintrc: false,
rules: {
@@ -584,16 +587,16 @@ var cli = new CLIEngine({
}
});
-var config = cli.getConfigForFile("myfile.js");
+const config = cli.getConfigForFile("myfile.js");
```
Once you have the configuration information, you can pass it into the `linter` object:
```js
-var CLIEngine = require("eslint").CLIEngine,
+const CLIEngine = require("eslint").CLIEngine,
linter = require("eslint").linter;
-var cli = new CLIEngine({
+const cli = new CLIEngine({
envs: ["browser", "mocha"],
useEslintrc: false,
rules: {
@@ -601,9 +604,9 @@ var cli = new CLIEngine({
}
});
-var config = cli.getConfigForFile("myfile.js");
+const config = cli.getConfigForFile("myfile.js");
-var messages = linter.verify('var foo;', config);
+const messages = linter.verify('var foo;', config);
```
### CLIEngine#executeOnText()
@@ -611,9 +614,9 @@ var messages = linter.verify('var foo;', config);
If you already have some text to lint, then you can use the `executeOnText()` method to lint that text. The linter will assume that the text is a file in the current working directory, and so will still obey any `.eslintrc` and `.eslintignore` files that may be present. Here's an example:
```js
-var CLIEngine = require("eslint").CLIEngine;
+const CLIEngine = require("eslint").CLIEngine;
-var cli = new CLIEngine({
+const cli = new CLIEngine({
envs: ["browser", "mocha"],
useEslintrc: false,
rules: {
@@ -623,7 +626,7 @@ var cli = new CLIEngine({
// lint the supplied text and optionally set
// a filename that is displayed in the report
-var report = cli.executeOnText("var foo = 'bar';", "foo.js");
+const report = cli.executeOnText("var foo = 'bar';", "foo.js");
```
The `report` returned from `executeOnText()` is in the same format as from `executeOnFiles()`, but there is only ever one result in `report.results`.
@@ -635,8 +638,8 @@ If a filename in the optional second parameter matches a file that is configured
Loads a plugin from configuration object with specified name. Name can include plugin prefix ("eslint-plugin-")
```js
-var CLIEngine = require("eslint").CLIEngine;
-var cli = new CLIEngine({
+const CLIEngine = require("eslint").CLIEngine;
+const cli = new CLIEngine({
ignore: true
});
cli.addPlugin("eslint-plugin-processor", {
@@ -658,14 +661,14 @@ cli.addPlugin("eslint-plugin-processor", {
Checks if a given path is ignored by ESLint.
```js
-var CLIEngine = require("eslint").CLIEngine;
+const CLIEngine = require("eslint").CLIEngine;
-var cli = new CLIEngine({
+const cli = new CLIEngine({
ignore: true,
ignorePath: ".customIgnoreFile"
});
-var isIgnored = cli.isPathIgnored("foo/bar.js");
+const isIgnored = cli.isPathIgnored("foo/bar.js");
```
### CLIEngine#getFormatter()
@@ -688,9 +691,9 @@ Retrieves a formatter, which you can then use to format a report object. The arg
or the full path to a JavaScript file containing a custom formatter. You can also omit the argument to retrieve the default formatter.
```js
-var CLIEngine = require("eslint").CLIEngine;
+const CLIEngine = require("eslint").CLIEngine;
-var cli = new CLIEngine({
+const cli = new CLIEngine({
envs: ["browser", "mocha"],
useEslintrc: false,
rules: {
@@ -699,14 +702,14 @@ var cli = new CLIEngine({
});
// lint myfile.js and all files in lib/
-var report = cli.executeOnFiles(["myfile.js", "lib/"]);
+const report = cli.executeOnFiles(["myfile.js", "lib/"]);
// get the default formatter
-var formatter = cli.getFormatter();
+const formatter = cli.getFormatter();
// Also could do...
-// var formatter = cli.getFormatter("compact");
-// var formatter = cli.getFormatter("./my/formatter.js");
+// const formatter = cli.getFormatter("compact");
+// const formatter = cli.getFormatter("./my/formatter.js");
// output to console
console.log(formatter(report.results));
@@ -716,7 +719,7 @@ console.log(formatter(report.results));
```js
// get the default formatter by calling the static function
-var formatter = CLIEngine.getFormatter();
+const formatter = CLIEngine.getFormatter();
```
**Important:** You must pass in the `results` property of the report. Passing in `report` directly will result in an error.
@@ -726,9 +729,9 @@ var formatter = CLIEngine.getFormatter();
This is a static function on `CLIEngine`. It can be used to filter out all the non error messages from the report object.
```js
-var CLIEngine = require("eslint").CLIEngine;
+const CLIEngine = require("eslint").CLIEngine;
-var cli = new CLIEngine({
+const cli = new CLIEngine({
envs: ["browser", "mocha"],
useEslintrc: false,
rules: {
@@ -737,10 +740,10 @@ var cli = new CLIEngine({
});
// lint myfile.js and all files in lib/
-var report = cli.executeOnFiles(["myfile.js", "lib/"]);
+const report = cli.executeOnFiles(["myfile.js", "lib/"]);
// only get the error messages
-var errorReport = CLIEngine.getErrorResults(report.results)
+const errorReport = CLIEngine.getErrorResults(report.results)
```
**Important:** You must pass in the `results` property of the report. Passing in `report` directly will result in an error.
@@ -750,9 +753,9 @@ var errorReport = CLIEngine.getErrorResults(report.results)
This is a static function on `CLIEngine` that is used to output fixes from `report` to disk. It does by looking for files that have an `output` property in their results. Here's an example:
```js
-var CLIEngine = require("eslint").CLIEngine;
+const CLIEngine = require("eslint").CLIEngine;
-var cli = new CLIEngine({
+const cli = new CLIEngine({
envs: ["browser", "mocha"],
fix: true,
useEslintrc: false,
@@ -762,7 +765,7 @@ var cli = new CLIEngine({
});
// lint myfile.js and all files in lib/
-var report = cli.executeOnFiles(["myfile.js", "lib/"]);
+const report = cli.executeOnFiles(["myfile.js", "lib/"]);
// output fixes to disk
CLIEngine.outputFixes(report);
diff --git a/docs/6.0.0/developer-guide/working-with-plugins.md b/docs/6.0.0/developer-guide/working-with-plugins.md
index 16776a1723..78a018be13 100644
--- a/docs/6.0.0/developer-guide/working-with-plugins.md
+++ b/docs/6.0.0/developer-guide/working-with-plugins.md
@@ -62,15 +62,16 @@ You can also create plugins that would tell ESLint how to process files other th
```js
module.exports = {
processors: {
-
- // assign to the file extension you want (.js, .jsx, .html, etc.)
- ".ext": {
+ "processor-name": {
// takes text of the file and filename
preprocess: function(text, filename) {
// here, you can strip out any non-JS content
// and split into multiple strings to lint
- return [string]; // return an array of strings to lint
+ return [ // return an array of code blocks to lint
+ { text: code1, filename: "0.js" },
+ { text: code2, filename: "1.js" },
+ ];
},
// takes a Message[][] and filename
@@ -80,7 +81,7 @@ module.exports = {
// to the text that was returned in array from preprocess() method
// you need to return a one-dimensional array of the messages you want to keep
- return messages[0];
+ return [].concat(...messages);
},
supportsAutofix: true // (optional, defaults to false)
@@ -89,9 +90,13 @@ module.exports = {
};
```
-The `preprocess` method takes the file contents and filename as arguments, and returns an array of strings to lint. The strings will be linted separately but still be registered to the filename. It's up to the plugin to decide if it needs to return just one part, or multiple pieces. For example in the case of processing `.html` files, you might want to return just one item in the array by combining all scripts, but for `.md` file where each JavaScript block might be independent, you can return multiple items.
+**The `preprocess` method** takes the file contents and filename as arguments, and returns an array of code blocks to lint. The code blocks will be linted separately but still be registered to the filename.
+
+A code block has two properties `text` and `filename`; the `text` property is the content of the block and the `filename` property is the name of the block. Name of the block can be anything, but should include the file extension, that would tell the linter how to process the current block. The linter will check [`--ext` CLI option](../user-guide/command-line-interface#--ext) to see if the current block should be linted, and resolve `overrides` configs to check how to process the current block.
+
+It's up to the plugin to decide if it needs to return just one part, or multiple pieces. For example in the case of processing `.html` files, you might want to return just one item in the array by combining all scripts, but for `.md` file where each JavaScript block might be independent, you can return multiple items.
-The `postprocess` method takes a two-dimensional array of arrays of lint messages and the filename. Each item in the input array corresponds to the part that was returned from the `preprocess` method. The `postprocess` method must adjust the locations of all errors to correspond to locations in the original, unprocessed code, and aggregate them into a single flat array and return it.
+**The `postprocess` method** takes a two-dimensional array of arrays of lint messages and the filename. Each item in the input array corresponds to the part that was returned from the `preprocess` method. The `postprocess` method must adjust the locations of all errors to correspond to locations in the original, unprocessed code, and aggregate them into a single flat array and return it.
Reported problems have the following location information:
@@ -125,6 +130,41 @@ By default, ESLint will not perform autofixes when a processor is used, even whe
You can have both rules and processors in a single plugin. You can also have multiple processors in one plugin.
To support multiple extensions, add each one to the `processors` element and point them to the same object.
+#### Specifying Processor in Config Files
+
+To use a processor, add its ID to a `processor` section in the config file. Processor ID is a concatenated string of plugin name and processor name with a slash as a separator. This can also be added to a `overrides` section of the config, to specify which processors should handle which files.
+
+For example:
+
+```yml
+plugins:
+ - a-plugin
+overrides:
+ - files: "*.md"
+ processor: a-plugin/markdown
+```
+
+See [Specifying Processor](../user-guide/configuring#specifying-processor) for details.
+
+#### File Extension-named Processor
+
+If a processor name starts with `.`, ESLint handles the processor as a **file extension-named processor** especially and applies the processor to the kind of files automatically. People don't need to specify the file extension-named processors in their config files.
+
+For example:
+
+```js
+module.exports = {
+ processors: {
+ // This processor will be applied to `*.md` files automatically.
+ // Also, people can use this processor as "plugin-id/.md" explicitly.
+ ".md": {
+ preprocess(text, filename) { /* ... */ },
+ postprocess(messageLists, filename) { /* ... */ }
+ }
+ }
+}
+```
+
### Configs in Plugins
You can bundle configurations inside a plugin by specifying them under the `configs` key. This can be useful when you want to provide not just code style, but also some custom rules to support it. Multiple configurations are supported per plugin. Note that it is not possible to specify a default configuration for a given plugin and that users must specify in their configuration file when they want to use one.
diff --git a/docs/6.0.0/developer-guide/working-with-rules.md b/docs/6.0.0/developer-guide/working-with-rules.md
index 3c3244a53e..53fb5a5398 100644
--- a/docs/6.0.0/developer-guide/working-with-rules.md
+++ b/docs/6.0.0/developer-guide/working-with-rules.md
@@ -145,7 +145,7 @@ Additionally, the `context` object has the following methods:
* If the node is an `ImportSpecifier`, `ImportDefaultSpecifier`, or `ImportNamespaceSpecifier`, the declared variable is returned.
* Otherwise, if the node does not declare any variables, an empty array is returned.
* `getFilename()` - returns the filename associated with the source.
-* `getScope()` - returns the [scope](./scope-manager-interface#scope-interface) of the currently-traversed node. This information can be used track references to variables.
+* `getScope()` - returns the [scope](./scope-manager-interface#scope-interface) of the currently-traversed node. This information can be used to track references to variables.
* `getSourceCode()` - returns a [`SourceCode`](#contextgetsourcecode) object that you can use to work with the source that was passed to ESLint.
* `markVariableAsUsed(name)` - marks a variable with the given name in the current scope as used. This affects the [no-unused-vars](../rules/no-unused-vars) rule. Returns `true` if a variable with the given name was found and marked as used, otherwise `false`.
* `report(descriptor)` - reports a problem in the code (see the [dedicated section](#contextreport)).
@@ -177,6 +177,13 @@ This method returns the scope which has the following types:
**※2** Only if the `for` statement defines the iteration variable as a block-scoped variable (E.g., `for (let i = 0;;) {}`).
**※3** The scope of the closest ancestor node which has own scope. If the closest ancestor node has multiple scopes then it chooses the innermost scope (E.g., the `Program` node has a `global` scope and a `module` scope if `Program#sourceType` is `"module"`. The innermost scope is the `module` scope.).
+The returned value is a [`Scope` object](scope-manager-interface) defined by the `eslint-scope` package. The `Variable` objects of global variables have some additional properties.
+
+* `variable.writeable` (`boolean | undefined`) ... If `true`, this global variable can be assigned arbitrary value. If `false`, this global variable is read-only.
+* `variable.eslintExplicitGlobal` (`boolean | undefined`) ... If `true`, this global variable was defined by a `/* globals */` directive comment in the source code file.
+* `variable.eslintExplicitGlobalComments` (`Comment[] | undefined`) ... The array of `/* globals */` directive comments which defined this global variable in the source code file. This property is `undefined` if there are no `/* globals */` directive comments.
+* `variable.eslintImplicitGlobalSetting` (`"readonly" | "writable" | undefined`) ... The configured value in config files. This can be different from `variable.writeable` if there are `/* globals */` directive comments.
+
### context.report()
The main method you'll use is `context.report()`, which publishes a warning or error (depending on the configuration being used). This method accepts a single argument, which is an object containing the following properties:
diff --git a/docs/6.0.0/rules/indent.md b/docs/6.0.0/rules/indent.md
index 7d606826b1..9f9a426682 100644
--- a/docs/6.0.0/rules/indent.md
+++ b/docs/6.0.0/rules/indent.md
@@ -571,7 +571,7 @@ var foo = { bar: 1,
Examples of **correct** code for this rule with the `4, { "ImportDeclaration": 1 }` option (the default):
```js
-/*eslint indent: ["error", 4, { ImportDeclaration: 1 }]*/
+/*eslint indent: ["error", 4, { "ImportDeclaration": 1 }]*/
import { foo,
bar,
@@ -585,10 +585,10 @@ import {
} from 'qux';
```
-Examples of **incorrect** code for this rule with the `4, { ImportDeclaration: "first" }` option:
+Examples of **incorrect** code for this rule with the `4, { "ImportDeclaration": "first" }` option:
```js
-/*eslint indent: ["error", 4, { ImportDeclaration: "first" }]*/
+/*eslint indent: ["error", 4, { "ImportDeclaration": "first" }]*/
import { foo,
bar,
@@ -596,10 +596,10 @@ import { foo,
} from 'qux';
```
-Examples of **correct** code for this rule with the `4, { ImportDeclaration: "first" }` option:
+Examples of **correct** code for this rule with the `4, { "ImportDeclaration": "first" }` option:
```js
-/*eslint indent: ["error", 4, { ImportDeclaration: "first" }]*/
+/*eslint indent: ["error", 4, { "ImportDeclaration": "first" }]*/
import { foo,
bar,
diff --git a/docs/6.0.0/rules/new-parens.md b/docs/6.0.0/rules/new-parens.md
index 649a9e2530..e53ec29a6e 100644
--- a/docs/6.0.0/rules/new-parens.md
+++ b/docs/6.0.0/rules/new-parens.md
@@ -6,7 +6,7 @@ rule_type: layout
---
-# require parentheses when invoking a constructor with no arguments (new-parens)
+# Require parentheses when invoking a constructor with no arguments (new-parens)
(fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.
@@ -18,9 +18,18 @@ var person = new Person;
## Rule Details
-This rule requires parentheses when invoking a constructor with no arguments using the `new` keyword in order to increase code clarity.
+This rule can enforce or disallow parentheses when invoking a constructor with no arguments using the `new` keyword.
-Examples of **incorrect** code for this rule:
+## Options
+
+This rule takes one option.
+
+- `"always"` enforces parenthesis after a new constructor with no arguments (default)
+- `"never"` enforces no parenthesis after a new constructor with no arguments
+
+### always
+
+Examples of **incorrect** code for this rule with the `"always"` option:
```js
/*eslint new-parens: "error"*/
@@ -29,7 +38,7 @@ var person = new Person;
var person = new (Person);
```
-Examples of **correct** code for this rule:
+Examples of **correct** code for this rule with the `"always"` option:
```js
/*eslint new-parens: "error"*/
@@ -38,6 +47,27 @@ var person = new Person();
var person = new (Person)();
```
+### never
+
+Examples of **incorrect** code for this rule with the `"never"` option:
+
+```js
+/*eslint new-parens: ["error", "never"]*/
+
+var person = new Person();
+var person = new (Person)();
+```
+
+Examples of **correct** code for this rule with the `"never"` option:
+
+```js
+/*eslint new-parens: ["error", "never"]*/
+
+var person = new Person;
+var person = (new Person);
+var person = new Person("Name");
+```
+
## Version
This rule was introduced in ESLint 0.0.6.
diff --git a/docs/6.0.0/rules/no-async-promise-executor.md b/docs/6.0.0/rules/no-async-promise-executor.md
index 1fb54ae11b..be059b897e 100644
--- a/docs/6.0.0/rules/no-async-promise-executor.md
+++ b/docs/6.0.0/rules/no-async-promise-executor.md
@@ -8,6 +8,8 @@ rule_type: problem
# disallow using an async function as a Promise executor (no-async-promise-executor)
+(recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule.
+
The `new Promise` constructor accepts an *executor* function as an argument, which has `resolve` and `reject` parameters that can be used to control the state of the created Promise. For example:
```js
diff --git a/docs/6.0.0/rules/no-caller.md b/docs/6.0.0/rules/no-caller.md
index d52c39540b..77dd16c5b0 100644
--- a/docs/6.0.0/rules/no-caller.md
+++ b/docs/6.0.0/rules/no-caller.md
@@ -18,7 +18,7 @@ function foo() {
## Rule Details
-This rule is aimed at discouraging the use of deprecated and sub-optimal code, but disallowing the use of `arguments.caller` and `arguments.callee`. As such, it will warn when `arguments.caller` and `arguments.callee` are used.
+This rule is aimed at discouraging the use of deprecated and sub-optimal code by disallowing the use of `arguments.caller` and `arguments.callee`. As such, it will warn when `arguments.caller` and `arguments.callee` are used.
Examples of **incorrect** code for this rule:
diff --git a/docs/6.0.0/rules/no-console.md b/docs/6.0.0/rules/no-console.md
index 885b56ff24..879944ce08 100644
--- a/docs/6.0.0/rules/no-console.md
+++ b/docs/6.0.0/rules/no-console.md
@@ -8,8 +8,6 @@ rule_type: suggestion
# disallow the use of `console` (no-console)
-(recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule.
-
In JavaScript that is designed to be executed in the browser, it's considered a best practice to avoid using methods on `console`. Such messages are considered to be for debugging purposes and therefore not suitable to ship to the client. In general, calls using `console` should be stripped before being pushed to production.
```js
diff --git a/docs/6.0.0/rules/no-div-regex.md b/docs/6.0.0/rules/no-div-regex.md
index 52c8d136fb..82f3d0f5e9 100644
--- a/docs/6.0.0/rules/no-div-regex.md
+++ b/docs/6.0.0/rules/no-div-regex.md
@@ -8,6 +8,8 @@ rule_type: suggestion
# Disallow Regular Expressions That Look Like Division (no-div-regex)
+(fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule.
+
Require regex literals to escape division operators.
```js
@@ -31,7 +33,7 @@ Examples of **correct** code for this rule:
```js
/*eslint no-div-regex: "error"*/
-function bar() { return /\=foo/; }
+function bar() { return /[=]foo/; }
```
## Related Rules
diff --git a/docs/6.0.0/rules/no-misleading-character-class.md b/docs/6.0.0/rules/no-misleading-character-class.md
index ceb93595c7..6e0585faf0 100644
--- a/docs/6.0.0/rules/no-misleading-character-class.md
+++ b/docs/6.0.0/rules/no-misleading-character-class.md
@@ -8,6 +8,8 @@ rule_type: problem
# Disallow characters which are made with multiple code points in character class syntax (no-misleading-character-class)
+(recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule.
+
Unicode includes the characters which are made with multiple code points.
RegExp character class syntax (`/[abc]/`) cannot handle characters which are made by multiple code points as a character; those characters will be dissolved to each code point. For example, `❇️` is made by `❇` (`U+2747`) and VARIATION SELECTOR-16 (`U+FE0F`). If this character is in RegExp character class, it will match to either `❇` (`U+2747`) or VARIATION SELECTOR-16 (`U+FE0F`) rather than `❇️`.
diff --git a/docs/6.0.0/rules/no-proto.md b/docs/6.0.0/rules/no-proto.md
index cf37413311..2bf325d117 100644
--- a/docs/6.0.0/rules/no-proto.md
+++ b/docs/6.0.0/rules/no-proto.md
@@ -8,11 +8,11 @@ rule_type: suggestion
# Disallow Use of `__proto__` (no-proto)
-`__proto__` property has been deprecated as of ECMAScript 3.1 and shouldn't be used in the code. Use `getPrototypeOf` method instead.
+`__proto__` property has been deprecated as of ECMAScript 3.1 and shouldn't be used in the code. Use `Object.getPrototypeOf` and `Object.setPrototypeOf` instead.
## Rule Details
-When an object is created `__proto__` is set to the original prototype property of the object’s constructor function. `getPrototypeOf` is the preferred method of getting "the prototype".
+When an object is created with the `new` operator, `__proto__` is set to the original "prototype" property of the object's constructor function. `Object.getPrototypeOf` is the preferred method of getting the object's prototype. To change an object's prototype, use `Object.setPrototypeOf`.
Examples of **incorrect** code for this rule:
@@ -22,6 +22,10 @@ Examples of **incorrect** code for this rule:
var a = obj.__proto__;
var a = obj["__proto__"];
+
+obj.__proto__ = b;
+
+obj["__proto__"] = b;
```
Examples of **correct** code for this rule:
@@ -30,11 +34,16 @@ Examples of **correct** code for this rule:
/*eslint no-proto: "error"*/
var a = Object.getPrototypeOf(obj);
+
+Object.setPrototypeOf(obj, b);
+
+var c = { __proto__: a };
```
## When Not To Use It
-If you need to support legacy browsers, you might want to turn this rule off, since support for `getPrototypeOf` is not yet universal.
+You might want to turn this rule off if you need to support legacy browsers which implement the
+`__proto__` property but not `Object.getPrototypeOf` or `Object.setPrototypeOf`.
## Further Reading
diff --git a/docs/6.0.0/rules/no-prototype-builtins.md b/docs/6.0.0/rules/no-prototype-builtins.md
index 9ca26680b7..7885314742 100644
--- a/docs/6.0.0/rules/no-prototype-builtins.md
+++ b/docs/6.0.0/rules/no-prototype-builtins.md
@@ -8,6 +8,8 @@ rule_type: problem
# Disallow use of Object.prototypes builtins directly (no-prototype-builtins)
+(recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule.
+
In ECMAScript 5.1, `Object.create` was added, which enables the creation of objects with a specified `[[Prototype]]`. `Object.create(null)` is a common pattern used to create objects that will be used as a Map. This can lead to errors when it is assumed that objects will have properties from `Object.prototype`. This rule prevents calling some `Object.prototype` methods directly from an object.
Additionally, objects can have properties that shadow the builtins on `Object.prototype`, potentially causing unintended behavior or denial-of-service security vulnerabilities. For example, it would be unsafe for a webserver to parse JSON input from a client and call `hasOwnProperty` directly on the resulting object, because a malicious client could send a JSON value like `{"hasOwnProperty": 1}` and cause the server to crash.
diff --git a/docs/6.0.0/rules/no-redeclare.md b/docs/6.0.0/rules/no-redeclare.md
index 1243f50c22..5c01f1a8fd 100644
--- a/docs/6.0.0/rules/no-redeclare.md
+++ b/docs/6.0.0/rules/no-redeclare.md
@@ -37,7 +37,7 @@ a = 10;
## Options
-This rule takes one optional argument, an object with a boolean property `"builtinGlobals"`. It defaults to `false`.
+This rule takes one optional argument, an object with a boolean property `"builtinGlobals"`. It defaults to `true`.
If set to `true`, this rule also checks redeclaration of built-in globals, such as `Object`, `Array`, `Number`...
### builtinGlobals
diff --git a/docs/6.0.0/rules/no-shadow-restricted-names.md b/docs/6.0.0/rules/no-shadow-restricted-names.md
index c467770aad..e44e85c7a3 100644
--- a/docs/6.0.0/rules/no-shadow-restricted-names.md
+++ b/docs/6.0.0/rules/no-shadow-restricted-names.md
@@ -8,6 +8,8 @@ rule_type: suggestion
# Disallow Shadowing of Restricted Names (no-shadow-restricted-names)
+(recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule.
+
ES5 §15.1.1 Value Properties of the Global Object (`NaN`, `Infinity`, `undefined`) as well as strict mode restricted identifiers `eval` and `arguments` are considered to be restricted names in JavaScript. Defining them to mean something else can have unintended consequences and confuse others reading the code. For example, there's nothing preventing you from writing:
```js
diff --git a/docs/6.0.0/rules/no-useless-catch.md b/docs/6.0.0/rules/no-useless-catch.md
index 739d013846..1aae63edf5 100644
--- a/docs/6.0.0/rules/no-useless-catch.md
+++ b/docs/6.0.0/rules/no-useless-catch.md
@@ -8,6 +8,8 @@ rule_type: suggestion
# Disallow unnecessary catch clauses (no-useless-catch)
+(recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule.
+
A `catch` clause that only rethrows the original error is redundant, and has no effect on the runtime behavior of the program. These redundant clauses can be a source of confusion and code bloat, so it's better to disallow these unnecessary `catch` clauses.
## Rule Details
diff --git a/docs/6.0.0/rules/no-with.md b/docs/6.0.0/rules/no-with.md
index 150ea5d5ba..ad64d534c1 100644
--- a/docs/6.0.0/rules/no-with.md
+++ b/docs/6.0.0/rules/no-with.md
@@ -8,6 +8,8 @@ rule_type: suggestion
# disallow `with` statements (no-with)
+(recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule.
+
The `with` statement is potentially problematic because it adds members of an object to the current scope, making it impossible to tell what a variable inside the block actually refers to.
## Rule Details
diff --git a/docs/6.0.0/rules/object-curly-newline.md b/docs/6.0.0/rules/object-curly-newline.md
index be936c4ee1..aece0d3851 100644
--- a/docs/6.0.0/rules/object-curly-newline.md
+++ b/docs/6.0.0/rules/object-curly-newline.md
@@ -343,23 +343,19 @@ let c = {foo: 1, bar: 2
};
let d = {
foo: 1, bar: 2};
-let e = {foo: 1,
- bar: 2};
-let f = {foo: function() {
+let e = {foo: function() {
dosomething();
}};
-let {g
+let {f
} = obj;
let {
- h} = obj;
-let {i, j
+ g} = obj;
+let {h, i
} = obj;
let {
- k, l} = obj;
-let {m,
- n} = obj;
-let {o = function() {
+ j, k} = obj;
+let {l = function() {
dosomething();
}} = obj;
```
@@ -395,13 +391,15 @@ let {i, j} = obj;
let {
k, l
} = obj;
+let {m,
+ n} = obj;
let {
- m,
- n
+ o,
+ p
} = obj;
-let {o = function() {dosomething();}} = obj;
+let {q = function() {dosomething();}} = obj;
let {
- p = function() {
+ r = function() {
dosomething();
}
} = obj;
diff --git a/docs/6.0.0/rules/require-atomic-updates.md b/docs/6.0.0/rules/require-atomic-updates.md
index 2d12021b73..706061dce6 100644
--- a/docs/6.0.0/rules/require-atomic-updates.md
+++ b/docs/6.0.0/rules/require-atomic-updates.md
@@ -8,6 +8,8 @@ rule_type: problem
# Disallow assignments that can lead to race conditions due to usage of `await` or `yield` (require-atomic-updates)
+(recommended) The `"extends": "eslint:recommended"` property in a configuration file enables this rule.
+
When writing asynchronous code, it is possible to create subtle race condition bugs. Consider the following example:
```js
diff --git a/docs/6.0.0/user-guide/README.md b/docs/6.0.0/user-guide/README.md
index 36e059a48c..31160d1618 100644
--- a/docs/6.0.0/user-guide/README.md
+++ b/docs/6.0.0/user-guide/README.md
@@ -34,3 +34,5 @@ If you were using a prior version of ESLint, you can get help with the transitio
- [migrating-to-2.0.0](migrating-to-2.0.0.md)
- [migrating-to-3.0.0](migrating-to-3.0.0.md)
- [migrating-to-4.0.0](migrating-to-4.0.0.md)
+- [migrating-to-5.0.0](migrating-to-5.0.0.md)
+- [migrating-to-6.0.0](migrating-to-6.0.0.md)
diff --git a/docs/6.0.0/user-guide/command-line-interface.md b/docs/6.0.0/user-guide/command-line-interface.md
index b63e18a988..37c502305e 100644
--- a/docs/6.0.0/user-guide/command-line-interface.md
+++ b/docs/6.0.0/user-guide/command-line-interface.md
@@ -45,6 +45,7 @@ Basic configuration:
--global [String] Define global variables
--parser String Specify the parser to be used
--parser-options Object Specify parser options
+ --resolve-plugins-relative-to path::String A folder where plugins should be resolved from, CWD by default
Specifying rules and plugins:
--rulesdir [path::String] Use additional rules from this directory
@@ -172,6 +173,13 @@ Examples:
echo '3 ** 4' | eslint --stdin --parser-options=ecmaVersion:6 # will fail with a parsing error
echo '3 ** 4' | eslint --stdin --parser-options=ecmaVersion:7 # succeeds, yay!
+#### `--resolve-plugins-relative-to`
+
+Changes the folder where plugins are resolved from. By default, plugins are resolved from the current working directory. This option should be used when plugins were installed by someone other than the end user. It should be set to the project directory of the project that has a dependency on the necessary plugins. For example:
+
+* When using a config file that is located outside of the current project (with the `--config` flag), if the config uses plugins which are installed locally to itself, `--resolve-plugins-relative-to` should be set to the directory containing the config file.
+* If an integration has dependencies on ESLint and a set of plugins, and the tool invokes ESLint on behalf of the user with a preset configuration, the tool should set `--resolve-plugins-relative-to` to the top-level directory of the tool.
+
### Specifying rules and plugins
#### `--rulesdir`
diff --git a/docs/6.0.0/user-guide/configuring.md b/docs/6.0.0/user-guide/configuring.md
index ef5b045056..b0f98ba153 100644
--- a/docs/6.0.0/user-guide/configuring.md
+++ b/docs/6.0.0/user-guide/configuring.md
@@ -88,6 +88,55 @@ The following parsers are compatible with ESLint:
Note when using a custom parser, the `parserOptions` configuration property is still required for ESLint to work properly with features not in ECMAScript 5 by default. Parsers are all passed `parserOptions` and may or may not use them to determine which features to enable.
+## Specifying Processor
+
+Plugins may provide processors. Processors can extract JavaScript code from another kind of files, then lets ESLint lint the JavaScript code. Or processors can convert JavaScript code in preprocessing for some purpose.
+
+To specify processors in a configuration file, use the `processor` key with the concatenated string of a plugin name and a processor name by a slash. For example, the following enables the processor `a-processor` that the plugin `a-plugin` provided:
+
+```json
+{
+ "plugins": ["a-plugin"],
+ "processor": "a-plugin/a-processor"
+}
+```
+
+To specify processors for a specific kind of files, use the combination of the `overrides` key and the `processor` key. For example, the following uses the processor `a-plugin/markdown` for `*.md` files.
+
+```json
+{
+ "plugins": ["a-plugin"],
+ "overrides": [
+ {
+ "files": ["*.md"],
+ "processor": "a-plugin/markdown"
+ }
+ ]
+}
+```
+
+Processors may make named code blocks such as `0.js` and `1.js`. ESLint handles such a named code block as a child file of the original file. You can specify additional configurations for named code blocks in the `overrides` section of the config. For example, the following disables `strict` rule for the named code blocks which end with `.js` in markdown files.
+
+```json
+{
+ "plugins": ["a-plugin"],
+ "overrides": [
+ {
+ "files": ["*.md"],
+ "processor": "a-plugin/markdown"
+ },
+ {
+ "files": ["**/*.md/*.js"],
+ "rules": {
+ "strict": "off"
+ }
+ }
+ ]
+}
+```
+
+ESLint checks the file extension of named code blocks then ignores those if [`--ext` CLI option](../user-guide/command-line-interface#--ext) didn't include the file extension. Be sure to specify the `--ext` option if you wanted to lint named code blocks other than `*.js`.
+
## Specifying Environments
An environment defines global variables that are predefined. The available environments are:
@@ -783,10 +832,11 @@ module.exports = {
### How it works
-* Glob pattern overrides can only be configured within config files (`.eslintrc.*` or `package.json`).
* The patterns are applied against the file path relative to the directory of the config file. For example, if your config file has the path `/Users/john/workspace/any-project/.eslintrc.js` and the file you want to lint has the path `/Users/john/workspace/any-project/lib/util.js`, then the pattern provided in `.eslintrc.js` will be executed against the relative path `lib/util.js`.
* Glob pattern overrides have higher precedence than the regular configuration in the same config file. Multiple overrides within the same config are applied in order. That is, the last override block in a config file always has the highest precedence.
-* A glob specific configuration works almost the same as any other ESLint config. Override blocks can contain any configuration options that are valid in a regular config, with the exception of `extends`, `overrides`, and `root`.
+* A glob specific configuration works almost the same as any other ESLint config. Override blocks can contain any configuration options that are valid in a regular config, with the exception of `root`.
+ * A glob specific configuration can have `extends` setting, but the `root` property in the extended configs is ignored.
+ * Nested `overrides` setting will be applied only if the glob patterns of both of the parent config and the child config matched. This is the same when the extended configs have `overrides` setting.
* Multiple glob patterns can be provided within a single override block. A file must match at least one of the supplied patterns for the configuration to apply.
* Override blocks can also specify patterns to exclude from matches. If a file matches any of the excluded patterns, the configuration won't apply.
diff --git a/docs/6.0.0/user-guide/formatters/html-formatter-example.html b/docs/6.0.0/user-guide/formatters/html-formatter-example.html
index 1067ca9559..9d84b97388 100644
--- a/docs/6.0.0/user-guide/formatters/html-formatter-example.html
+++ b/docs/6.0.0/user-guide/formatters/html-formatter-example.html
@@ -91,7 +91,7 @@
ESLint Report
- 9 problems (5 errors, 4 warnings) - Generated on Fri Apr 12 2019 23:07:15 GMT-0400 (Eastern Daylight Time)
+ 9 problems (5 errors, 4 warnings) - Generated on Sat May 25 2019 16:52:00 GMT-0400 (Eastern Daylight Time)
diff --git a/docs/6.0.0/user-guide/index.md b/docs/6.0.0/user-guide/index.md
index 9404d9ee5f..09faf45fd3 100644
--- a/docs/6.0.0/user-guide/index.md
+++ b/docs/6.0.0/user-guide/index.md
@@ -42,3 +42,5 @@ If you were using a prior version of ESLint, you can get help with the transitio
- [migrating-to-2.0.0](migrating-to-2.0.0)
- [migrating-to-3.0.0](migrating-to-3.0.0)
- [migrating-to-4.0.0](migrating-to-4.0.0)
+- [migrating-to-5.0.0](migrating-to-5.0.0)
+- [migrating-to-6.0.0](migrating-to-6.0.0)
diff --git a/docs/6.0.0/user-guide/migrating-to-6.0.0.md b/docs/6.0.0/user-guide/migrating-to-6.0.0.md
index caec32c49b..52d2859403 100644
--- a/docs/6.0.0/user-guide/migrating-to-6.0.0.md
+++ b/docs/6.0.0/user-guide/migrating-to-6.0.0.md
@@ -22,11 +22,16 @@ The lists below are ordered roughly by the number of users each change is expect
1. [The `comma-dangle` rule is now more strict by default](#comma-dangle-updates)
1. [The `no-confusing-arrow` rule is now more lenient by default](#no-confusing-arrow-updates)
1. [Overrides in a config file can now match dotfiles](#overrides-dotfiles)
+1. [Overrides in an extended config file can now be overridden by a parent config file](#overrides-precedence)
+1. [Configuration values for globals are now validated](#globals-validation)
1. [The deprecated `experimentalObjectRestSpread` option has been removed](#experimental-object-rest-spread)
+1. [User-provided regular expressions in rule options are parsed with the unicode flag](#unicode-regexes)
### Breaking changes for plugin/custom rule developers
1. [Plugin authors may need to update installation instructions](#plugin-documentation)
+1. [`RuleTester` now validates against invalid `default` keywords in rule schemas](#rule-tester-defaults)
+1. [`RuleTester` now requires an absolute path on `parser` option](#rule-tester-parser)
1. [The `eslintExplicitGlobalComment` scope analysis property has been removed](#eslintExplicitGlobalComment)
### Breaking changes for integration developers
@@ -38,7 +43,7 @@ The lists below are ordered roughly by the number of users each change is expect
## Node.js 6 is no longer supported
-As of April 2018, Node.js 6 will be at EOL and will no longer be receiving security updates. As a result, we have decided to drop support for it in ESLint v6. We now support the following versions of Node.js:
+As of April 2019, Node.js 6 will be at EOL and will no longer be receiving security updates. As a result, we have decided to drop support for it in ESLint v6. We now support the following versions of Node.js:
* Node.js 8 (8.10.0 and above)
* Node.js 10 (10.13.0 and above)
@@ -48,16 +53,13 @@ As of April 2018, Node.js 6 will be at EOL and will no longer be receiving secur
**Related issue(s):** [eslint/eslint#11546](https://github.com/eslint/eslint/issues/11456)
-## `eslint:recommended` has been updated
-
-**Note:** This update is planned, but has not been implemented in the latest alpha release yet.
+## `eslint:recommended` has been updated
The following rules have been added to the [`eslint:recommended`](https://eslint.org/docs/user-guide/configuring#using-eslintrecommended) config:
-
-
* [`no-async-promise-executor`](https://eslint.org/docs/rules/no-async-promise-executor) disallows using an `async` function as the argument to the `Promise` constructor, which is usually a bug.
* [`no-misleading-character-class`](https://eslint.org/docs/rules/no-misleading-character-class) reports character classes in regular expressions that might not behave as expected.
+* [`no-prototype-builtins`](https://eslint.org/docs/rules/no-prototype-builtins) reports method calls like `foo.hasOwnProperty("bar")` (which are a frequent source of bugs), and suggests that they be replaced with `Object.prototype.hasOwnProperty.call(foo, "bar")` instead.
* [`no-shadow-restricted-names`](https://eslint.org/docs/rules/no-shadow-restricted-names) disallows shadowing variables like `undefined` (e.g. with code like `let undefined = 5;`), since is likely to confuse readers.
* [`no-useless-catch`](https://eslint.org/docs/rules/no-useless-catch) reports `catch` clauses that are redundant and can be removed from the code without changing its behavior.
* [`no-with`](https://eslint.org/docs/rules/no-with) disallows use of the [`with` statement](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/with), which can make code difficult to understand and cause compatibility problems.
@@ -97,12 +99,12 @@ In rare cases (if you were relying on the previous behavior where `eslint:recomm
Previously, ESLint loaded plugins relative to the location of the ESLint package itself. As a result, we suggested that users with global ESLint installations should also install plugins globally, and users with local ESLint installations should install plugins locally. However, due to a design bug, this strategy caused ESLint to randomly fail to load plugins and shareable configs under certain circumstances, particularly when using package management tools like [`lerna`](https://github.com/lerna/lerna) and [Yarn Plug n' Play](https://yarnpkg.com/lang/en/docs/pnp/).
-As a rule of thumb: With ESLint v6, plugins should always be installed locally, even if ESLint was installed globally. More precisely, ESLint v6 always resolves plugins relative to the end user's project, and always resolves shareable configs and parsers relative to the location of the config file that imports them.
-
-
+As a rule of thumb: With ESLint v6, plugins should always be installed locally, even if ESLint was installed globally. More precisely, ESLint v6 resolves plugins relative to the end user's project by default, and always resolves shareable configs and parsers relative to the location of the config file that imports them.
**To address:** If you use a global installation of ESLint (e.g. installed with `npm install eslint --global`) along with plugins, you should install those plugins locally in the projects where you run ESLint. If your config file extends shareable configs and/or parsers, you should ensure that those packages are installed as dependencies of the project containing the config file.
+If you use a config file located outside of a local project (with the `--config` flag), consider installing the plugins as dependencies of that config file, and setting the [`--resolve-plugins-relative-to`](./command-line-interface#--resolve-plugins-relative-to) flag to the location of the config file.
+
**Related issue(s):** [eslint/eslint#10125](https://github.com/eslint/eslint/issues/10125), [eslint/rfcs#7](https://github.com/eslint/rfcs/pull/7)
## The default parser now validates options more strictly
@@ -111,7 +113,7 @@ As a rule of thumb: With ESLint v6, plugins should always be installed locally,
* The `ecmaVersion` parser option is set to something other than a number, such as the string `"2015"`. (Previously, a non-number option would simply be ignored.)
* The `sourceType: "module"` parser option is set while `ecmaVersion` is set to `5` or left unspecified. (Previously, setting `sourceType: "module"` would implicitly cause `ecmaVersion` to be set to a minimum of 2015, which could be surprising.)
-* Setting `sourceType` to anything other than `"script"` or `"module"` now causes an error to be thrown.
+* The `sourceType` is set to anything other than `"script"` or `"module"`.
**To address:** If your config sets `ecmaVersion` to something other than a number, you can restore the previous behavior by removing `ecmaVersion`. (However, you may want to double-check that your config is actually working as expected.) If your config sets `parserOptions: { sourceType: "module" }` without also setting `parserOptions.ecmaVersion`, you should add `parserOptions: { ecmaVersion: 2015 }` to restore the previous behavior.
@@ -119,8 +121,6 @@ As a rule of thumb: With ESLint v6, plugins should always be installed locally,
## The `no-redeclare` rule is now more strict by default
-**Note:** This update is planned, but has not been implemented in the latest alpha release yet.
-
The default options for the [`no-redeclare`](https://eslint.org/docs/rules/no-redeclare) rule have changed from `{ builtinGlobals: false }` to `{ builtinGlobals: true }`. Additionally, the `no-redeclare` rule will now report an error for globals enabled by comments like `/* global foo */` if those globals were already enabled through configuration anyway.
**To address:**
@@ -187,6 +187,57 @@ Due to a bug, the glob patterns in a `files` list in an `overrides` section of a
**Related issue(s):** [eslint/eslint#11201](https://github.com/eslint/eslint/issues/11201)
+## Overrides in an extended config file can now be overridden by a parent config file
+
+Due to a bug, it was previously the case that an `overrides` block in a shareable config had precedence over the top level of a parent config. For example, with the following config setup, the `semi` rule would end up enabled even though it was explicitly disabled in the end user's config:
+
+```js
+// .eslintrc.js
+module.exports = {
+ extends: ["foo"],
+ rules: {
+ semi: "off"
+ }
+};
+```
+
+```js
+// eslint-config-foo/index.js
+module.exports = {
+ overrides: {
+ files: ["*.js"],
+ rules: {
+ semi: "error"
+ }
+ }
+};
+```
+
+In ESLint v6.0.0, a parent config always has precedence over extended configs, even with `overrides` blocks.
+
+**To address:** We expect the impact of this issue to be very low because most shareable configs don't use `overrides` blocks. However, if you use a shareable config with `overrides` blocks, you might encounter a change in behavior due to something that is explicitly specified in your config but was inactive until now. If you would rather inherit the behavior from the shareable config, simply remove the corresponding entry from your own config. (In the example above, the previous behavior could be restored by removing `semi: "off"` from `.eslintrc.js`.)
+
+**Related issue(s):** [eslint/eslint#11510](https://github.com/eslint/eslint/issues/11510)
+
+## Configuration values for globals are now validated
+
+Previously, when configuring a set of global variables with an object, it was possible to use anything as the values of the object. An unknown value would be treated the same as `"writable"`.
+
+```js
+// .eslintrc.js
+module.exports = {
+ globals: {
+ foo: "readonly",
+ bar: "writable",
+ baz: "hello!" // ???
+ }
+};
+```
+
+With this change, any unknown values in a `globals` object result in a config validation error.
+
+**To address:** If you see config validation errors related to globals after updating, ensure that all values configured for globals are either `readonly`, `writable`, or `off`. (ESLint also accepts some alternate spellings and variants for compatibility.)
+
## The depreacted `experimentalObjectRestSpread` option has been removed
Previously, when using the default parser, a config could use the `experimentalObjectRestSpread` option to enable parsing support for object rest/spread properties:
@@ -217,23 +268,45 @@ If you're not sure which config file needs to be updated, it may be useful to ru
**Related issue(s):** [eslint/eslint#9990](https://github.com/eslint/eslint/issues/9990)
+## User-provided regular expressions in rule options are parsed with the unicode flag
+
+Rules like [`max-len`](/docs/rules/max-len) accept a string option which is interpreted as a regular expression. In ESLint v6.0.0, these regular expressions are interpreted with the [unicode flag](https://mathiasbynens.be/notes/es6-unicode-regex), which should exhibit more reasonable behavior when matching characters like astral symbols. Unicode regexes also validate escape sequences more strictly than non-unicode regexes.
+
+**To address:** If you get rule option validation errors after upgrading, ensure that any regular expressions in your rule options have no invalid escape sequences.
+
+**Related issue(s):** [eslint/eslint#11423](https://github.com/eslint/eslint/issues/11423)
+
---
## Plugin authors may need to update installation instructions
-If you maintain a plugin and provide installation instructions, you should ensure that the installation instructions are up to date with the [user-facing changes to how plugins are loaded](#package-loading-simplification). In particular, if your plugin was generated with the [`generator-eslint`](https://github.com/eslint/generator-eslint) package, it likely contains outdated instructions for how to use the plugin with global ESLint installations.)
+If you maintain a plugin and provide installation instructions, you should ensure that the installation instructions are up to date with the [user-facing changes to how plugins are loaded](#package-loading-simplification). In particular, if your plugin was generated with the [`generator-eslint`](https://github.com/eslint/generator-eslint) package, it likely contains outdated instructions for how to use the plugin with global ESLint installations.
**Related issue(s):** [eslint/rfcs#7](https://github.com/eslint/rfcs/pull/7)
-## The `eslintExplicitGlobalComment` scope analysis property has been removed
+## `RuleTester` now validates against invalid `default` keywords in rule schemas
+
+In some cases, rule schemas can use the `default` keyword to automatically specify default values for rule options. However, the `default` keyword is only effective in certain schema locations, and is ignored elsewhere, which creates a risk of bugs if a rule incorrectly expects a default value to be provided as a rule option. In ESLint v6.0.0, `RuleTester` will raise an error if a rule has an invalid `default` keyword in its schema.
+
+**To address:** If `RuleTester` starts reporting an error about an invalid default, you can remove the `default` property at the indicated location in your rule schema, and the rule will behave the same way. (If this happens, you might also want to verify that the rule behaves correctly when no option value is provided in that location.)
+
+**Related issue(s):** [eslint/eslint#11473](https://github.com/eslint/eslint/issues/11473)
+
+## `RuleTester` now requires an absolute path on `parser` option
-**Note:** This update is planned, but has not been implemented in the latest alpha release yet.
+To use custom parsers in tests, we could use `parser` property with a package name or file path. However, if a package name was given, it's unclear where the tester should load the parser package from because the tester doesn't know which files are running the tester. In ESLint v6.0.0, `RuleTester` disallows `parser` property with a package name.
+
+**To address:** If you use `parser` property with package names in test cases, update it with `require.resolve()` function to resolve the package name to the absolute path to the package.
+
+**Related issue(s):** [eslint/eslint#11728](https://github.com/eslint/eslint/issues/11728), [eslint/eslint#10125](https://github.com/eslint/eslint/issues/10125), [eslint/rfcs#7](https://github.com/eslint/rfcs/pull/7)
+
+## The `eslintExplicitGlobalComment` scope analysis property has been removed
Previously, ESLint would add an `eslintExplicitGlobalComment` property to `Variable` objects in scope analysis to indicate that a variable was introduced as a result of a `/* global */` comment. This property was undocumented, and the ESLint team was unable to find any usage of the property outside of ESLint core. The property has been removed in ESLint v6, and replaced with the `eslintExplicitGlobalComments` property, which can contain a list of all `/* global */` comments if a variable was declared with more than one of them.
**To address:** If you maintain a rule that uses the `eslintExplicitGlobalComment` property, update it to use the `eslintExplicitGlobalComments` property as a list instead.
-**Related issue(s):**: [eslint/rfcs#17](https://github.com/eslint/rfcs/pull/17)
+**Related issue(s):** [eslint/rfcs#17](https://github.com/eslint/rfcs/pull/17)
---