From fa00dd66171f5fe882701bf2cdb7d4874a5c50d1 Mon Sep 17 00:00:00 2001 From: ESLint Jenkins Date: Fri, 3 Jun 2022 17:39:17 -0400 Subject: [PATCH] Autogenerated new docs and demo at Fri Jun 03 2022 17:39:17 --- _posts/2022-06-03-eslint-v8.17.0-released.md | 70 +++++++++++++++++++ docs/developer-guide/code-path-analysis.md | 4 +- docs/developer-guide/nodejs-api.md | 4 +- docs/rules/eol-last.md | 4 +- docs/rules/key-spacing.md | 2 +- docs/rules/no-use-before-define.md | 54 +++++++++++++- docs/rules/prefer-exponentiation-operator.md | 2 +- .../formatters/html-formatter-example.html | 2 +- 8 files changed, 131 insertions(+), 11 deletions(-) create mode 100644 _posts/2022-06-03-eslint-v8.17.0-released.md diff --git a/_posts/2022-06-03-eslint-v8.17.0-released.md b/_posts/2022-06-03-eslint-v8.17.0-released.md new file mode 100644 index 00000000..96e85829 --- /dev/null +++ b/_posts/2022-06-03-eslint-v8.17.0-released.md @@ -0,0 +1,70 @@ +--- +layout: post +title: ESLint v8.17.0 released +teaser: "We just pushed ESLint v8.17.0, which is a minor release upgrade of ESLint. This release adds some new features and fixes several bugs found in the previous release." +image: release-notes-minor.png +categories: + - Release Notes +tags: + - Release +--- + + + + + + + + +## Features + + +* [`55319e1`](https://github.com/eslint/eslint/commit/55319e133f0862a008db3557d7350f154f2c784f) feat: fix [indent](/docs/rules/indent) bug with semicolon-first style ([#15951](https://github.com/eslint/eslint/issues/15951)) (Milos Djermanovic) +* [`f6d7920`](https://github.com/eslint/eslint/commit/f6d79209821241c8e03c183b5844a024da0efe8a) feat: add `allowNamedExports` option to [no-use-before-define](/docs/rules/no-use-before-define) ([#15953](https://github.com/eslint/eslint/issues/15953)) (Milos Djermanovic) + + + + + + +## Bug Fixes + + +* [`54c0953`](https://github.com/eslint/eslint/commit/54c09530c778eb4076d89777165d59db96c9acb5) fix: cleanup typos ([#15939](https://github.com/eslint/eslint/issues/15939)) (Nick Schonning) +* [`845a7af`](https://github.com/eslint/eslint/commit/845a7af90ce03b383c8f09654ac049fc161dbb9f) fix: typo ocatal -> octal ([#15940](https://github.com/eslint/eslint/issues/15940)) (Nick Schonning) + + + + +## Documentation + + +* [`b915018`](https://github.com/eslint/eslint/commit/b9150186bcc0f2732a69ab0ebd83a9b2fb2e6552) docs: Update website UI to latest ([#15944](https://github.com/eslint/eslint/issues/15944)) (Nicholas C. Zakas) +* [`f0bb609`](https://github.com/eslint/eslint/commit/f0bb6099668f54ae6f444126b90dbb1146248146) docs: Update Exponentiation operator MDN link ([#15960](https://github.com/eslint/eslint/issues/15960)) (Pranjal Jain) +* [`baa0153`](https://github.com/eslint/eslint/commit/baa01530469ec233fb60380a0960c1550f9d9a45) docs: Use correct past tense "left" instead of "leaved" ([#15950](https://github.com/eslint/eslint/issues/15950)) (Frederik Braun) +* [`1351a9b`](https://github.com/eslint/eslint/commit/1351a9b875aa32a8961a68457dde03ede9ef7c78) docs: Add Resources section to rule pages ([#15901](https://github.com/eslint/eslint/issues/15901)) (Nicholas C. Zakas) +* [`68cf0fb`](https://github.com/eslint/eslint/commit/68cf0fb7f645da5d992a5e749fc6c1311d30e75a) docs: cleanup typos ([#15936](https://github.com/eslint/eslint/issues/15936)) (Nick Schonning) +* [`13b62ae`](https://github.com/eslint/eslint/commit/13b62aeb710a68e5d838a4d3847c487af1ba9520) docs: use-dart-sass instead of node-sass ([#15912](https://github.com/eslint/eslint/issues/15912)) (Deepshika S) +* [`c81c5d6`](https://github.com/eslint/eslint/commit/c81c5d6ef1ba5808cca95ab965a162802af9b7cc) docs: add social media links ([#15920](https://github.com/eslint/eslint/issues/15920)) (Deepshika S) +* [`0d6a50b`](https://github.com/eslint/eslint/commit/0d6a50b41f2fe444fd222463adad48473eaf9b7d) docs: fix openjs link ([#15917](https://github.com/eslint/eslint/issues/15917)) (Amaresh S M) +* [`54910f5`](https://github.com/eslint/eslint/commit/54910f5a3bf6615f8ac03d33fd26fc1fa6dea21f) docs: display version in mobile view ([#15909](https://github.com/eslint/eslint/issues/15909)) (Amaresh S M) + + + + + + + + +## Chores + + +* [`da694b9`](https://github.com/eslint/eslint/commit/da694b9d7cb0247541bcabbf943d1289e0e30167) chore: avoid theme flashes ([#15927](https://github.com/eslint/eslint/issues/15927)) (Strek) +* [`f836743`](https://github.com/eslint/eslint/commit/f836743e95cb8ad3bdd4e88687dbe2f16bfade62) chore: Use build hook for docs deploy ([#15945](https://github.com/eslint/eslint/issues/15945)) (Nicholas C. Zakas) +* [`ce035e5`](https://github.com/eslint/eslint/commit/ce035e5fac632ba8d4f1860f92465f22d6b44d42) test: cleanup typos ([#15937](https://github.com/eslint/eslint/issues/15937)) (Nick Schonning) +* [`10249ad`](https://github.com/eslint/eslint/commit/10249ad1a961463b6b347be71c074951ab8e2652) chore: use addEventListener instead of addListener ([#15923](https://github.com/eslint/eslint/issues/15923)) (Amaresh S M) +* [`5f5c1fb`](https://github.com/eslint/eslint/commit/5f5c1fb1083573ea511d0dae7913651db0dca772) chore: lint eleventy config file ([#15904](https://github.com/eslint/eslint/issues/15904)) (Milos Djermanovic) +* [`8513d37`](https://github.com/eslint/eslint/commit/8513d37c725509c9e9ec1dbbc431f20d32632cf3) chore: update Rule typedefs ([#15915](https://github.com/eslint/eslint/issues/15915)) (Milos Djermanovic) +* [`55534f1`](https://github.com/eslint/eslint/commit/55534f1a7040fad94bb5726759fbb9acb60d1c24) test: ensure [no-restricted-imports](/docs/rules/no-restricted-imports) works with NodeJS imports ([#15907](https://github.com/eslint/eslint/issues/15907)) (Nick Mazuk) + + diff --git a/docs/developer-guide/code-path-analysis.md b/docs/developer-guide/code-path-analysis.md index 68348f3e..9d2841b8 100644 --- a/docs/developer-guide/code-path-analysis.md +++ b/docs/developer-guide/code-path-analysis.md @@ -100,10 +100,10 @@ module.exports = function(context) { }, /** - * This is called when a code path segment was leaved. + * This is called when a code path segment was left. * In this time, the segment does not have the next segments yet. * - * @param {CodePathSegment} segment - The leaved code path segment. + * @param {CodePathSegment} segment - The left code path segment. * @param {ASTNode} node - The current node. * @returns {void} */ diff --git a/docs/developer-guide/nodejs-api.md b/docs/developer-guide/nodejs-api.md index 105996ab..e3830321 100644 --- a/docs/developer-guide/nodejs-api.md +++ b/docs/developer-guide/nodejs-api.md @@ -289,7 +289,7 @@ This method loads a formatter. Formatters convert lint results to a human- or ma The path to the file you want to check. The following values are allowed: * `undefined`. In this case, loads the `"stylish"` built-in formatter. * A name of [built-in formatters][builtin-formatters]. - * A name of [third-party formatters][thirdparty-formatters]. For examples: + * A name of [third-party formatters][third-party-formatters]. For examples: * `"foo"` will load `eslint-formatter-foo`. * `"@foo"` will load `@foo/eslint-formatter`. * `"@foo/bar"` will load `@foo/eslint-formatter-bar`. @@ -954,7 +954,7 @@ ruleTester.run("my-rule", myRule, { [configuration object]: ../user-guide/configuring [builtin-formatters]: https://eslint.org/docs/user-guide/formatters/ -[thirdparty-formatters]: https://www.npmjs.com/search?q=eslintformatter +[third-party-formatters]: https://www.npmjs.com/search?q=eslintformatter [eslint]: #eslint-class [eslint-constructor]: #-new-eslintoptions [eslint-lintfiles]: #-eslintlintfilespatterns diff --git a/docs/rules/eol-last.md b/docs/rules/eol-last.md index 68f5e916..f6db572e 100644 --- a/docs/rules/eol-last.md +++ b/docs/rules/eol-last.md @@ -30,7 +30,7 @@ Examples of **incorrect** code for this rule: ```js /*eslint eol-last: ["error", "always"]*/ -function doSmth() { +function doSomething() { var foo = 2; } ``` @@ -40,7 +40,7 @@ Examples of **correct** code for this rule: ```js /*eslint eol-last: ["error", "always"]*/ -function doSmth() { +function doSomething() { var foo = 2; }\n ``` diff --git a/docs/rules/key-spacing.md b/docs/rules/key-spacing.md index 0f7e73c4..50b6b3c7 100644 --- a/docs/rules/key-spacing.md +++ b/docs/rules/key-spacing.md @@ -307,7 +307,7 @@ var obj = { "myObjectFunction": function() { // Do something // - }, // These are two separate groups, so no alignment between `myObjectFuction` and `one` + }, // These are two separate groups, so no alignment between `myObjectFunction` and `one` "one" : 1, "seven" : 7 // `one` and `seven` are in their own group, and therefore aligned } diff --git a/docs/rules/no-use-before-define.md b/docs/rules/no-use-before-define.md index f28a840c..4940a0ea 100644 --- a/docs/rules/no-use-before-define.md +++ b/docs/rules/no-use-before-define.md @@ -60,6 +60,9 @@ var b = 1; } } } + +export { foo }; +const foo = 1; ``` Examples of **correct** code for this rule: @@ -109,13 +112,21 @@ function g() { } } } + +const foo = 1; +export { foo }; ``` ## Options ```json { - "no-use-before-define": ["error", { "functions": true, "classes": true, "variables": true }] + "no-use-before-define": ["error", { + "functions": true, + "classes": true, + "variables": true, + "allowNamedExports": false + }] } ``` @@ -136,9 +147,13 @@ function g() { If this is `true`, the rule warns every reference to a variable before the variable declaration. Otherwise, the rule ignores a reference if the declaration is in an upper scope, while still reporting the reference if it's in the same scope as the declaration. Default is `true`. +* `allowNamedExports` (`boolean`) - + If this flag is set to `true`, the rule always allows references in `export {};` declarations. + These references are safe even if the variables are declared later in the code. + Default is `false`. This rule accepts `"nofunc"` string as an option. -`"nofunc"` is the same as `{ "functions": false, "classes": true, "variables": true }`. +`"nofunc"` is the same as `{ "functions": false, "classes": true, "variables": true, "allowNamedExports": false }`. ### functions @@ -268,6 +283,41 @@ const g = function() {} } ``` +### allowNamedExports + +Examples of **correct** code for the `{ "allowNamedExports": true }` option: + +```js +/*eslint no-use-before-define: ["error", { "allowNamedExports": true }]*/ + +export { a, b, f, C }; + +const a = 1; + +let b; + +function f () {} + +class C {} +``` + +Examples of **incorrect** code for the `{ "allowNamedExports": true }` option: + +```js +/*eslint no-use-before-define: ["error", { "allowNamedExports": true }]*/ + +export default a; +const a = 1; + +const b = c; +export const c = 1; + +export function foo() { + return d; +} +const d = 1; +``` + ## Version This rule was introduced in ESLint 0.0.9. diff --git a/docs/rules/prefer-exponentiation-operator.md b/docs/rules/prefer-exponentiation-operator.md index 4cf117f4..556fc594 100644 --- a/docs/rules/prefer-exponentiation-operator.md +++ b/docs/rules/prefer-exponentiation-operator.md @@ -4,7 +4,7 @@ layout: doc edit_link: https://github.com/eslint/eslint/edit/main/docs/src/rules/prefer-exponentiation-operator.md rule_type: suggestion further_reading: -- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Arithmetic_Operators#Exponentiation +- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Exponentiation - https://bugs.chromium.org/p/v8/issues/detail?id=5848 --- diff --git a/docs/user-guide/formatters/html-formatter-example.html b/docs/user-guide/formatters/html-formatter-example.html index 9c660276..be74433a 100644 --- a/docs/user-guide/formatters/html-formatter-example.html +++ b/docs/user-guide/formatters/html-formatter-example.html @@ -93,7 +93,7 @@

ESLint Report

- 9 problems (5 errors, 4 warnings) - Generated on Fri May 20 2022 18:37:22 GMT-0400 (Eastern Daylight Time) + 9 problems (5 errors, 4 warnings) - Generated on Fri Jun 03 2022 17:39:16 GMT-0400 (Eastern Daylight Time)