Skip to content

Commit

Permalink
Merge branch 'main' into duplicate-test-cases
Browse files Browse the repository at this point in the history
* main:
  docs: Update note about ECMAScript support (eslint#17991)
  chore: update `markdownlint` to `v0.33.0` (eslint#17995)
  docs: Update release blog post template (eslint#17994)
  docs: Add sections on non-npm plugin configuration (eslint#17984)
  9.0.0-alpha.1
  Build: changelog update for 9.0.0-alpha.1
  chore: package.json update for @eslint/js release
  • Loading branch information
bmish committed Jan 16, 2024
2 parents 85b5070 + b4abfea commit a208201
Show file tree
Hide file tree
Showing 13 changed files with 134 additions and 81 deletions.
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,36 @@
v9.0.0-alpha.1 - January 12, 2024

* [`c5e50ee`](https://github.com/eslint/eslint/commit/c5e50ee65cf22871770b1d4d438b9056c577f646) chore: package.json update for @eslint/js release (Jenkins)
* [`1bf2520`](https://github.com/eslint/eslint/commit/1bf2520c4166aa55596417bf44c567555bc65fba) chore: Split Docs CI from core CI (#17897) (Nicholas C. Zakas)
* [`6d11f3d`](https://github.com/eslint/eslint/commit/6d11f3dac1b76188d7fda6e772e89b5c3945ac4d) fix: Ensure config keys are printed for config errors (#17980) (Nicholas C. Zakas)
* [`320787e`](https://github.com/eslint/eslint/commit/320787e661beb979cf063d0f8333654f94ef9efd) chore: delete relative-module-resolver.js (#17981) (Francesco Trotta)
* [`96307da`](https://github.com/eslint/eslint/commit/96307da837c407c9a1275124b65ca29c07ffd5e4) docs: migration guide entry for `no-inner-declarations` (#17977) (Tanuj Kanti)
* [`40be60e`](https://github.com/eslint/eslint/commit/40be60e0186cdde76219df4e8e628125df2912d8) docs: Update README (GitHub Actions Bot)
* [`a630edd`](https://github.com/eslint/eslint/commit/a630edd809894dc38752705bb5954d847987f031) feat: maintain latest ecma version in ESLint (#17958) (Milos Djermanovic)
* [`701f1af`](https://github.com/eslint/eslint/commit/701f1afbee34e458b56d2dfa36d9153d6aebea3a) feat!: no-inner-declaration new default behaviour and option (#17885) (Tanuj Kanti)
* [`b4e0503`](https://github.com/eslint/eslint/commit/b4e0503a56beea1222be266cc6b186d89410d1f2) feat: add `no-useless-assignment` rule (#17625) (Yosuke Ota)
* [`806f708`](https://github.com/eslint/eslint/commit/806f70878e787f2c56aaa42a3e7adb61bc015278) fix: `no-misleading-character-class` edge cases with granular errors (#17970) (Milos Djermanovic)
* [`287c4b7`](https://github.com/eslint/eslint/commit/287c4b7d498746b43392ee4fecd6904a9cd4b30b) feat: `no-misleading-character-class` granular errors (#17515) (Josh Goldberg ✨)
* [`d31c180`](https://github.com/eslint/eslint/commit/d31c180312260d1a286cc8162907b6a33368edc9) docs: fix number of code-path events on custom rules page (#17969) (Richard Hunter)
* [`1529ab2`](https://github.com/eslint/eslint/commit/1529ab288ec815b2690864e04dd6d0a1f0b537c6) docs: reorder entries in v9 migration guide (#17967) (Milos Djermanovic)
* [`bde5105`](https://github.com/eslint/eslint/commit/bde51055530d4a71bd9f48c90ed7de9c0b767d86) fix!: handle `--output-file` for empty output when saving to disk (#17957) (Nitin Kumar)
* [`9507525`](https://github.com/eslint/eslint/commit/95075251fb3ce35aaf7eadbd1d0a737106c13ec6) docs: Explain how to combine configs (#17947) (Nicholas C. Zakas)
* [`7c78576`](https://github.com/eslint/eslint/commit/7c785769fd177176966de7f6c1153480f7405000) docs: Add more removed `context` methods to migrate to v9 guide (#17951) (Milos Djermanovic)
* [`07107a5`](https://github.com/eslint/eslint/commit/07107a5904c2580243971c8ad7f26a04738b712e) fix!: upgrade eslint-scope@8.0.0 (#17942) (Milos Djermanovic)
* [`3ee0f6c`](https://github.com/eslint/eslint/commit/3ee0f6ca5d756da647e4e76bf3daa82a5905a792) fix!: no-unused-vars `varsIgnorePattern` behavior with catch arguments (#17932) (Tanuj Kanti)
* [`4926f33`](https://github.com/eslint/eslint/commit/4926f33b96faf07a64aceec5f1f4882f4faaf4b5) refactor: use `Object.hasOwn()` (#17948) (Milos Djermanovic)
* [`df200e1`](https://github.com/eslint/eslint/commit/df200e147705eb62f94b99c170554327259c65d4) refactor: use `Array.prototype.at()` to get last elements (#17949) (Milos Djermanovic)
* [`51f8bc8`](https://github.com/eslint/eslint/commit/51f8bc836bf0b13dad3a897ae84259bcdaed2431) fix!: configuration comments with just severity should retain options (#17945) (Milos Djermanovic)
* [`3a877d6`](https://github.com/eslint/eslint/commit/3a877d68d0151679f8bf1cabc39746778754b3dd) docs: Update removed CLI flags migration (#17939) (Nicholas C. Zakas)
* [`750b8df`](https://github.com/eslint/eslint/commit/750b8dff6df02a500e12cb78390fd14814c82e5b) chore: update dependency glob to v10 (#17917) (renovate[bot])
* [`c2bf27d`](https://github.com/eslint/eslint/commit/c2bf27def29ef1ca7f5bfe20c1306bf78087ea29) build: update docs files when publishing prereleases (#17940) (Milos Djermanovic)
* [`d191bdd`](https://github.com/eslint/eslint/commit/d191bdd67214c33e65bd605e616ca7cc947fd045) feat!: Remove CodePath#currentSegments (#17936) (Milos Djermanovic)
* [`4a9cd1e`](https://github.com/eslint/eslint/commit/4a9cd1ea1cd0c115b98d07d1b6018ca918a9c73f) docs: Update Linter API for v9 (#17937) (Milos Djermanovic)
* [`74794f5`](https://github.com/eslint/eslint/commit/74794f53a6bc88b67653c737f858cfdf35b1c73d) chore: removed unused eslintrc modules (#17938) (Milos Djermanovic)
* [`10ed29c`](https://github.com/eslint/eslint/commit/10ed29c0c4505dbac3bb05b0e3d61f329b99f747) chore: remove unused dependency rimraf (#17934) (Francesco Trotta)
* [`2a8eea8`](https://github.com/eslint/eslint/commit/2a8eea8e5847f4103d90d667a2b08edf9795545f) docs: update docs for v9.0.0-alpha.0 (#17929) (Milos Djermanovic)
* [`903ee60`](https://github.com/eslint/eslint/commit/903ee60ea910aee344df7edb66874f80e4b6ed31) ci: use `--force` flag when installing eslint (#17921) (Milos Djermanovic)

v9.0.0-alpha.0 - December 29, 2023

* [`7f0ba51`](https://github.com/eslint/eslint/commit/7f0ba51bcef3e6fbf972ceb20403238f0e1f0ea9) docs: show `NEXT` in version selectors (#17911) (Milos Djermanovic)
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [confi

### What ECMAScript versions does ESLint support?

ESLint has full support for ECMAScript 3, 5 (default), 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, and 2023. You can set your desired ECMAScript syntax (and other settings, like global variables or your target environments) through [configuration](https://eslint.org/docs/latest/use/configure).
ESLint has full support for ECMAScript 3, 5, and every year from 2015 up until the most recent stage 4 specification (the default). You can set your desired ECMAScript syntax and other settings (like global variables) through [configuration](https://eslint.org/docs/latest/use/configure).

### What about experimental features?

Expand Down
2 changes: 1 addition & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "docs-eslint",
"private": true,
"version": "9.0.0-alpha.0",
"version": "9.0.0-alpha.1",
"description": "",
"main": "index.js",
"keywords": [],
Expand Down
9 changes: 6 additions & 3 deletions docs/src/_data/rule_versions.json
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,8 @@
"logical-assignment-operators": "8.24.0",
"no-empty-static-block": "8.27.0",
"no-new-native-nonconstructor": "8.27.0",
"no-object-constructor": "8.50.0"
"no-object-constructor": "8.50.0",
"no-useless-assignment": "9.0.0-alpha.1"
},
"removed": {
"generator-star": "1.0.0-rc-1",
Expand All @@ -328,6 +329,8 @@
"space-in-brackets": "1.0.0-rc-1",
"space-return-throw-case": "2.0.0-beta.3",
"space-unary-word-ops": "0.10.0",
"spaced-line-comment": "1.0.0-rc-1"
"spaced-line-comment": "1.0.0-rc-1",
"require-jsdoc": "9.0.0-alpha.0",
"valid-jsdoc": "9.0.0-alpha.0"
}
}
}
7 changes: 7 additions & 0 deletions docs/src/_data/rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,13 @@
"fixable": false,
"hasSuggestions": false
},
{
"name": "no-useless-assignment",
"description": "Disallow variable assignments when the value is not used",
"recommended": false,
"fixable": false,
"hasSuggestions": false
},
{
"name": "no-useless-backreference",
"description": "Disallow useless backreferences in regular expressions",
Expand Down
8 changes: 8 additions & 0 deletions docs/src/_data/rules_meta.json
Original file line number Diff line number Diff line change
Expand Up @@ -1962,6 +1962,14 @@
"url": "https://eslint.org/docs/latest/rules/no-use-before-define"
}
},
"no-useless-assignment": {
"type": "problem",
"docs": {
"description": "Disallow variable assignments when the value is not used",
"recommended": false,
"url": "https://eslint.org/docs/latest/rules/no-useless-assignment"
}
},
"no-useless-backreference": {
"type": "problem",
"docs": {
Expand Down
28 changes: 14 additions & 14 deletions docs/src/extend/scope-manager-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -358,13 +358,13 @@ Those members are defined but not used in ESLint.

| type | node |
|:---------------------------|:-----|
| `"CatchClause"` | `CatchClause`
| `"ClassName"` | `ClassDeclaration` or `ClassExpression`
| `"FunctionName"` | `FunctionDeclaration` or `FunctionExpression`
| `"ImplicitGlobalVariable"` | `Program`
| `"ImportBinding"` | `ImportSpecifier`, `ImportDefaultSpecifier`, or `ImportNamespaceSpecifier`
| `"Parameter"` | `FunctionDeclaration`, `FunctionExpression`, or `ArrowFunctionExpression`
| `"Variable"` | `VariableDeclarator`
| `"CatchClause"` | `CatchClause` |
| `"ClassName"` | `ClassDeclaration` or `ClassExpression` |
| `"FunctionName"` | `FunctionDeclaration` or `FunctionExpression` |
| `"ImplicitGlobalVariable"` | `Program` |
| `"ImportBinding"` | `ImportSpecifier`, `ImportDefaultSpecifier`, or `ImportNamespaceSpecifier` |
| `"Parameter"` | `FunctionDeclaration`, `FunctionExpression`, or `ArrowFunctionExpression` |
| `"Variable"` | `VariableDeclarator` |

#### parent

Expand All @@ -373,13 +373,13 @@ Those members are defined but not used in ESLint.

| type | parent |
|:---------------------------|:-------|
| `"CatchClause"` | `null`
| `"ClassName"` | `null`
| `"FunctionName"` | `null`
| `"ImplicitGlobalVariable"` | `null`
| `"ImportBinding"` | `ImportDeclaration`
| `"Parameter"` | `null`
| `"Variable"` | `VariableDeclaration`
| `"CatchClause"` | `null` |
| `"ClassName"` | `null` |
| `"FunctionName"` | `null` |
| `"ImplicitGlobalVariable"` | `null` |
| `"ImportBinding"` | `ImportDeclaration` |
| `"Parameter"` | `null` |
| `"Variable"` | `VariableDeclaration` |

### Deprecated members

Expand Down
48 changes: 48 additions & 0 deletions docs/src/use/configure/plugins.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,54 @@ export default [
When creating a namespace for a plugin, the convention is to use the npm package name without the `eslint-plugin-` prefix. In the preceding example, `eslint-plugin-example` is assigned a namespace of `example`.
:::

### Configure a Local Plugin

Plugins don't need to be published to npm for use with ESLint. You can also load plugins directly from a file, as in this example:

```js
// eslint.config.js
import local from "./my-local-plugin.js";

export default [
{
plugins: {
local
},
rules: {
"local/rule1": "warn"
}
}
];
```

Here, the namespace `local` is used, but you can also use any name you'd like instead.

### Configure a Virtual Plugin

Plugin definitions can be created virtually directly in your config. For example, suppose you have a rule contained in a file called `my-rule.js` that you'd like to enable in your config. You can define a virtual plugin to do so, as in this example:

```js
// eslint.config.js
import myRule from "./rules/my-rule.js";

export default [
{
plugins: {
local: {
rules: {
"my-rule": myRule
}
}
},
rules: {
"local/my-rule": "warn"
}
}
];
```

Here, the namespace `local` is used to define a virtual plugin. The rule `myRule` is then assigned a name of `my-rule` inside of the virtual plugin's `rules` object. (See [Create Plugins](../../extend/plugins) for the complete format of a plugin.) You can then reference the rule as `local/my-rule` to configure it.

## Use Plugin Rules

You can use specific rules included in a plugin. To do this, specify the plugin
Expand Down
15 changes: 3 additions & 12 deletions docs/src/use/formatters/html-formatter-example.html
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@
<div id="overview" class="bg-2">
<h1>ESLint Report</h1>
<div>
<span>9 problems (5 errors, 4 warnings)</span> - Generated on Sat Dec 30 2023 01:21:43 GMT+0100 (Central European Standard Time)
<span>8 problems (4 errors, 4 warnings)</span> - Generated on Fri Jan 12 2024 20:48:30 GMT+0000 (Coordinated Universal Time)
</div>
</div>
<table>
<tbody>
<tr class="bg-2" data-group="f-0">
<th colspan="4">
[+] C:\projects\eslint\fullOfProblems.js
<span>9 problems (5 errors, 4 warnings)</span>
[+] /var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js
<span>8 problems (4 errors, 4 warnings)</span>
</th>
</tr>
<tr style="display: none;" class="f-0">
Expand Down Expand Up @@ -201,15 +201,6 @@ <h1>ESLint Report</h1>
</td>
</tr>

<tr style="display: none;" class="f-0">
<td>7:2</td>
<td class="clr-2">Error</td>
<td>Unnecessary semicolon.</td>
<td>
<a href="" target="_blank" rel="noopener noreferrer">no-extra-semi</a>
</td>
</tr>

</tbody>
</table>
<script type="text/javascript">
Expand Down
55 changes: 9 additions & 46 deletions docs/src/use/formatters/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ Example output (formatted for easier reading):
{
"results": [
{
"filePath": "C:\\projects\\eslint\\fullOfProblems.js",
"filePath": "/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js",
"messages": [
{
"ruleId": "no-unused-vars",
Expand Down Expand Up @@ -202,31 +202,13 @@ Example output (formatted for easier reading):
],
"text": ";"
}
},
{
"ruleId": "no-extra-semi",
"severity": 2,
"message": "Unnecessary semicolon.",
"line": 7,
"column": 2,
"nodeType": "EmptyStatement",
"messageId": "unexpected",
"endLine": 7,
"endColumn": 3,
"fix": {
"range": [
93,
95
],
"text": "}"
}
}
],
"suppressedMessages": [],
"errorCount": 5,
"errorCount": 4,
"fatalErrorCount": 0,
"warningCount": 4,
"fixableErrorCount": 2,
"fixableErrorCount": 1,
"fixableWarningCount": 4,
"source": "function addOne(i) {\n if (i != NaN) {\n return i ++\n } else {\n return\n }\n};"
}
Expand Down Expand Up @@ -680,7 +662,7 @@ Example output (formatted for easier reading):
```json
[
{
"filePath": "C:\\projects\\eslint\\fullOfProblems.js",
"filePath": "/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js",
"messages": [
{
"ruleId": "no-unused-vars",
Expand Down Expand Up @@ -804,31 +786,13 @@ Example output (formatted for easier reading):
],
"text": ";"
}
},
{
"ruleId": "no-extra-semi",
"severity": 2,
"message": "Unnecessary semicolon.",
"line": 7,
"column": 2,
"nodeType": "EmptyStatement",
"messageId": "unexpected",
"endLine": 7,
"endColumn": 3,
"fix": {
"range": [
93,
95
],
"text": "}"
}
}
],
"suppressedMessages": [],
"errorCount": 5,
"errorCount": 4,
"fatalErrorCount": 0,
"warningCount": 4,
"fixableErrorCount": 2,
"fixableErrorCount": 1,
"fixableWarningCount": 4,
"source": "function addOne(i) {\n if (i != NaN) {\n return i ++\n } else {\n return\n }\n};"
}
Expand All @@ -843,7 +807,7 @@ Example output:

```text
C:\projects\eslint\fullOfProblems.js
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js
1:10 error 'addOne' is defined but never used no-unused-vars
2:9 error Use the isNaN function to compare with NaN use-isnan
3:16 error Unexpected space before unary operator '++' space-unary-ops
Expand All @@ -852,9 +816,8 @@ C:\projects\eslint\fullOfProblems.js
5:1 warning Expected indentation of 8 spaces but found 6 indent
5:7 error Function 'addOne' expected a return value consistent-return
5:13 warning Missing semicolon semi
7:2 error Unnecessary semicolon no-extra-semi
9 problems (5 errors, 4 warnings)
2 errors and 4 warnings potentially fixable with the `--fix` option.
8 problems (4 errors, 4 warnings)
1 error and 4 warnings potentially fixable with the `--fix` option.
```
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "eslint",
"version": "9.0.0-alpha.0",
"version": "9.0.0-alpha.1",
"author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
"description": "An AST-based pattern checker for JavaScript.",
"bin": {
Expand Down Expand Up @@ -135,7 +135,7 @@
"load-perf": "^0.2.0",
"markdown-it": "^12.2.0",
"markdown-it-container": "^3.0.0",
"markdownlint": "^0.32.0",
"markdownlint": "^0.33.0",
"markdownlint-cli": "^0.38.0",
"marked": "^4.0.8",
"memfs": "^3.0.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@eslint/js",
"version": "9.0.0-alpha.0",
"version": "9.0.0-alpha.1",
"description": "ESLint JavaScript language implementation",
"main": "./src/index.js",
"scripts": {},
Expand Down
2 changes: 1 addition & 1 deletion templates/blogpost.md.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ npm i eslint@<%- version %> --save-dev
### Migration Guide
As there are a lot of changes, we've created a [migration guide](/docs/<%- prereleaseMajorVersion %>/use/migrating-to-<%- prereleaseMajorVersion %>) describing 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.
As there are a lot of changes, we've created a [migration guide](/docs/next/use/migrate-to-<%- prereleaseMajorVersion %>) describing the breaking 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.
<% } %>
Expand Down

0 comments on commit a208201

Please sign in to comment.