Skip to content

Commit

Permalink
Merge branch 'main' into rfc-100-part2
Browse files Browse the repository at this point in the history
* main:
  chore: use jsdoc/no-multi-asterisks with allowWhitespace: true (eslint#17900)
  chore: fix getting scope in tests (eslint#17899)
  fix!: Parsing 'exported' comment using parseListConfig (eslint#17675)
  docs: updated examples of `max-lines` rule (eslint#17898)
  feat!: Remove valid-jsdoc and require-jsdoc (eslint#17694)
  • Loading branch information
bmish committed Dec 23, 2023
2 parents ae4e075 + 3826cdf commit 0aebc8a
Show file tree
Hide file tree
Showing 23 changed files with 322 additions and 3,253 deletions.
4 changes: 3 additions & 1 deletion conf/rule-type-list.json
Expand Up @@ -23,6 +23,8 @@
{ "removed": "space-in-brackets", "replacedBy": ["object-curly-spacing", "array-bracket-spacing"] },
{ "removed": "space-return-throw-case", "replacedBy": ["keyword-spacing"] },
{ "removed": "space-unary-word-ops", "replacedBy": ["space-unary-ops"] },
{ "removed": "spaced-line-comment", "replacedBy": ["spaced-comment"] }
{ "removed": "spaced-line-comment", "replacedBy": ["spaced-comment"] },
{ "removed": "valid-jsdoc", "replacedBy": [] },
{ "removed": "require-jsdoc", "replacedBy": [] }
]
}
4 changes: 2 additions & 2 deletions docs/src/_data/rules.json
Expand Up @@ -652,7 +652,7 @@
"description": "Disallow `Array` constructors",
"recommended": false,
"fixable": false,
"hasSuggestions": true
"hasSuggestions": false
},
{
"name": "no-bitwise",
Expand Down Expand Up @@ -680,7 +680,7 @@
"description": "Disallow the use of `console`",
"recommended": false,
"fixable": false,
"hasSuggestions": true
"hasSuggestions": false
},
{
"name": "no-continue",
Expand Down
21 changes: 0 additions & 21 deletions docs/src/_data/rules_meta.json
Expand Up @@ -2371,16 +2371,6 @@
"url": "https://eslint.org/docs/latest/rules/require-await"
}
},
"require-jsdoc": {
"type": "suggestion",
"docs": {
"description": "Require JSDoc comments",
"recommended": false,
"url": "https://eslint.org/docs/latest/rules/require-jsdoc"
},
"deprecated": true,
"replacedBy": []
},
"require-unicode-regexp": {
"type": "suggestion",
"docs": {
Expand Down Expand Up @@ -2602,17 +2592,6 @@
"url": "https://eslint.org/docs/latest/rules/use-isnan"
}
},
"valid-jsdoc": {
"type": "suggestion",
"docs": {
"description": "Enforce valid JSDoc comments",
"recommended": false,
"url": "https://eslint.org/docs/latest/rules/valid-jsdoc"
},
"fixable": "code",
"deprecated": true,
"replacedBy": []
},
"valid-typeof": {
"type": "problem",
"docs": {
Expand Down
20 changes: 10 additions & 10 deletions docs/src/rules/max-lines.md
Expand Up @@ -33,12 +33,12 @@ This rule has a number or object option:

### max

Examples of **incorrect** code for this rule with a max value of `2`:
Examples of **incorrect** code for this rule with a max value of `3`:

::: incorrect

```js
/*eslint max-lines: ["error", 2]*/
/*eslint max-lines: ["error", 3]*/
var a,
b,
c;
Expand All @@ -49,7 +49,7 @@ var a,
::: incorrect

```js
/*eslint max-lines: ["error", 2]*/
/*eslint max-lines: ["error", 3]*/

var a,
b,c;
Expand All @@ -60,20 +60,20 @@ var a,
::: incorrect

```js
/*eslint max-lines: ["error", 2]*/
/*eslint max-lines: ["error", 3]*/
// a comment
var a,
b,c;
```

:::

Examples of **correct** code for this rule with a max value of `2`:
Examples of **correct** code for this rule with a max value of `3`:

::: correct

```js
/*eslint max-lines: ["error", 2]*/
/*eslint max-lines: ["error", 3]*/
var a,
b, c;
```
Expand All @@ -83,7 +83,7 @@ var a,
::: correct

```js
/*eslint max-lines: ["error", 2]*/
/*eslint max-lines: ["error", 3]*/

var a, b, c;
```
Expand All @@ -93,7 +93,7 @@ var a, b, c;
::: correct

```js
/*eslint max-lines: ["error", 2]*/
/*eslint max-lines: ["error", 3]*/
// a comment
var a, b, c;
```
Expand All @@ -107,7 +107,7 @@ Examples of **incorrect** code for this rule with the `{ "skipBlankLines": true
::: incorrect

```js
/*eslint max-lines: ["error", {"max": 2, "skipBlankLines": true}]*/
/*eslint max-lines: ["error", {"max": 3, "skipBlankLines": true}]*/

var a,
b,
Expand All @@ -121,7 +121,7 @@ Examples of **correct** code for this rule with the `{ "skipBlankLines": true }`
::: correct

```js
/*eslint max-lines: ["error", {"max": 2, "skipBlankLines": true}]*/
/*eslint max-lines: ["error", {"max": 3, "skipBlankLines": true}]*/

var a,
b, c;
Expand Down
5 changes: 3 additions & 2 deletions docs/src/rules/require-jsdoc.md
Expand Up @@ -5,8 +5,9 @@ related_rules:
- valid-jsdoc
---


This rule was [**deprecated**](https://eslint.org/blog/2018/11/jsdoc-end-of-life) in ESLint v5.10.0.
:::important
This rule was removed in ESLint v9.0.0 and replaced by the [`eslint-plugin-jsdoc`](https://github.com/gajus/eslint-plugin-jsdoc) equivalent.
:::

[JSDoc](http://usejsdoc.org) is a JavaScript API documentation generator. It uses specially-formatted comments inside of code to generate API documentation automatically. For example, this is what a JSDoc comment looks like for a function:

Expand Down
6 changes: 3 additions & 3 deletions docs/src/rules/valid-jsdoc.md
Expand Up @@ -7,9 +7,9 @@ further_reading:
- https://jsdoc.app
---



This rule was [**deprecated**](https://eslint.org/blog/2018/11/jsdoc-end-of-life) in ESLint v5.10.0.
:::important
This rule was removed in ESLint v9.0.0 and replaced by the [`eslint-plugin-jsdoc`](https://github.com/gajus/eslint-plugin-jsdoc) equivalent.
:::

[JSDoc](http://usejsdoc.org) generates application programming interface (API) documentation from specially-formatted comments in JavaScript code. For example, this is a JSDoc comment for a function:

Expand Down
6 changes: 4 additions & 2 deletions docs/src/use/rule-deprecation.md
Expand Up @@ -7,10 +7,12 @@ Balancing the trade-offs of improving a tool and the frustration these changes c

The ESLint team is committed to making upgrading as easy and painless as possible. To that end, the team has agreed upon the following set of guidelines for deprecating rules in the future. The goal of these guidelines is to allow for improvements and changes to be made without breaking existing configurations.

* Rules will never be removed from ESLint.
* Rules will never be removed from ESLint unless one of the following is true:
* The rule has been replaced by another core rule.
* A plugin exists with a functionally equivalent rule.
* Rules will be deprecated as needed, and marked as such in all documentation.
* After a rule has been deprecated, the team will no longer do any work on it. This includes bug fixes, enhancements, and updates to the rule's documentation. Issues and pull requests related to deprecated rule will not be accepted and will be closed.

Since deprecated rules will never be removed, you can continue to use them indefinitely if they are working for you. However, keep in mind that deprecated rules will effectively be unmaintained.
You can continue to use deprecated rules indefinitely if they are working for you. However, keep in mind that deprecated rules will effectively be unmaintained and may be removed at some point.

We hope that by following these guidelines we will be able to continue improving and working to make ESLint the best tool it can be while causing as little disruption to our users as possible during the process.
2 changes: 1 addition & 1 deletion lib/linter/config-comment-parser.js
Expand Up @@ -40,7 +40,7 @@ module.exports = class ConfigCommentParser {

/**
* Parses a list of "name:string_value" or/and "name" options divided by comma or
* whitespace. Used for "global" and "exported" comments.
* whitespace. Used for "global" comments.
* @param {string} string The string to parse.
* @param {Comment} comment The comment node which has the string.
* @returns {Object} Result map object of names and string values, or null values if no value was provided
Expand Down
2 changes: 1 addition & 1 deletion lib/linter/linter.js
Expand Up @@ -392,7 +392,7 @@ function getDirectiveComments(sourceCode, ruleMapper, warnInlineConfig) {
}

case "exported":
Object.assign(exportedVariables, commentParser.parseStringConfig(directiveValue, comment));
Object.assign(exportedVariables, commentParser.parseListConfig(directiveValue, comment));
break;

case "globals":
Expand Down
2 changes: 0 additions & 2 deletions lib/rules/index.js
Expand Up @@ -273,7 +273,6 @@ module.exports = new LazyLoadingRuleMap(Object.entries({
radix: () => require("./radix"),
"require-atomic-updates": () => require("./require-atomic-updates"),
"require-await": () => require("./require-await"),
"require-jsdoc": () => require("./require-jsdoc"),
"require-unicode-regexp": () => require("./require-unicode-regexp"),
"require-yield": () => require("./require-yield"),
"rest-spread-spacing": () => require("./rest-spread-spacing"),
Expand All @@ -296,7 +295,6 @@ module.exports = new LazyLoadingRuleMap(Object.entries({
"template-tag-spacing": () => require("./template-tag-spacing"),
"unicode-bom": () => require("./unicode-bom"),
"use-isnan": () => require("./use-isnan"),
"valid-jsdoc": () => require("./valid-jsdoc"),
"valid-typeof": () => require("./valid-typeof"),
"vars-on-top": () => require("./vars-on-top"),
"wrap-iife": () => require("./wrap-iife"),
Expand Down
122 changes: 0 additions & 122 deletions lib/rules/require-jsdoc.js

This file was deleted.

0 comments on commit 0aebc8a

Please sign in to comment.