diff --git a/docs/package.json b/docs/package.json index 24d84f499f8..cb11570a689 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,7 +1,7 @@ { "name": "docs-eslint", "private": true, - "version": "9.0.0-alpha.2", + "version": "9.0.0-beta.0", "description": "", "main": "index.js", "keywords": [], diff --git a/docs/src/_data/rules.json b/docs/src/_data/rules.json index 90d297ff540..79374b96435 100644 --- a/docs/src/_data/rules.json +++ b/docs/src/_data/rules.json @@ -398,7 +398,7 @@ "description": "Require calls to `isNaN()` when checking for `NaN`", "recommended": true, "fixable": false, - "hasSuggestions": false + "hasSuggestions": true }, { "name": "valid-typeof", diff --git a/docs/src/_data/rules_meta.json b/docs/src/_data/rules_meta.json index 3b8101f1203..647481b3fe5 100644 --- a/docs/src/_data/rules_meta.json +++ b/docs/src/_data/rules_meta.json @@ -2594,6 +2594,7 @@ "fixable": "whitespace" }, "use-isnan": { + "hasSuggestions": true, "type": "problem", "docs": { "description": "Require calls to `isNaN()` when checking for `NaN`", diff --git a/docs/src/use/formatters/html-formatter-example.html b/docs/src/use/formatters/html-formatter-example.html index d26023346cf..9949da4e90f 100644 --- a/docs/src/use/formatters/html-formatter-example.html +++ b/docs/src/use/formatters/html-formatter-example.html @@ -118,7 +118,7 @@

ESLint Report

- 8 problems (4 errors, 4 warnings) - Generated on Fri Jan 26 2024 20:36:42 GMT+0000 (Coordinated Universal Time) + 8 problems (4 errors, 4 warnings) - Generated on Fri Feb 09 2024 23:53:44 GMT+0000 (Coordinated Universal Time)
diff --git a/docs/src/use/formatters/index.md b/docs/src/use/formatters/index.md index c7d3cb37a46..1c842b9d6c1 100644 --- a/docs/src/use/formatters/index.md +++ b/docs/src/use/formatters/index.md @@ -100,7 +100,31 @@ Example output (formatted for easier reading): "nodeType": "BinaryExpression", "messageId": "comparisonWithNaN", "endLine": 2, - "endColumn": 17 + "endColumn": 17, + "suggestions": [ + { + "messageId": "replaceWithIsNaN", + "fix": { + "range": [ + 29, + 37 + ], + "text": "!Number.isNaN(i)" + }, + "desc": "Replace with Number.isNaN." + }, + { + "messageId": "replaceWithCastingAndIsNaN", + "fix": { + "range": [ + 29, + 37 + ], + "text": "!Number.isNaN(Number(i))" + }, + "desc": "Replace with Number.isNaN cast to a Number." + } + ] }, { "ruleId": "space-unary-ops", @@ -684,7 +708,31 @@ Example output (formatted for easier reading): "nodeType": "BinaryExpression", "messageId": "comparisonWithNaN", "endLine": 2, - "endColumn": 17 + "endColumn": 17, + "suggestions": [ + { + "messageId": "replaceWithIsNaN", + "fix": { + "range": [ + 29, + 37 + ], + "text": "!Number.isNaN(i)" + }, + "desc": "Replace with Number.isNaN." + }, + { + "messageId": "replaceWithCastingAndIsNaN", + "fix": { + "range": [ + 29, + 37 + ], + "text": "!Number.isNaN(Number(i))" + }, + "desc": "Replace with Number.isNaN cast to a Number." + } + ] }, { "ruleId": "space-unary-ops", diff --git a/package.json b/package.json index 1280e74a92b..24a14e710cf 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint", - "version": "9.0.0-alpha.2", + "version": "9.0.0-beta.0", "author": "Nicholas C. Zakas ", "description": "An AST-based pattern checker for JavaScript.", "bin": {