From 331cf62024b6c7ad4067c14c593f116576c3c861 Mon Sep 17 00:00:00 2001 From: ESLint Jenkins Date: Fri, 20 Oct 2023 17:00:04 -0400 Subject: [PATCH] 8.52.0 --- docs/package.json | 2 +- .../formatters/html-formatter-example.html | 2 +- docs/src/use/formatters/index.md | 757 +++++++++++++++++- package.json | 2 +- 4 files changed, 751 insertions(+), 12 deletions(-) diff --git a/docs/package.json b/docs/package.json index d24e203338c..fa9d7101dd4 100644 --- a/docs/package.json +++ b/docs/package.json @@ -1,7 +1,7 @@ { "name": "docs-eslint", "private": true, - "version": "8.51.0", + "version": "8.52.0", "description": "", "main": "index.js", "keywords": [], diff --git a/docs/src/use/formatters/html-formatter-example.html b/docs/src/use/formatters/html-formatter-example.html index 2981958fab7..05cbe6e08b3 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

- 9 problems (5 errors, 4 warnings) - Generated on Fri Oct 06 2023 16:14:35 GMT-0400 (Eastern Daylight Time) + 9 problems (5 errors, 4 warnings) - Generated on Fri Oct 20 2023 17:00:05 GMT-0400 (Eastern Daylight Time)
diff --git a/docs/src/use/formatters/index.md b/docs/src/use/formatters/index.md index ec6ce537ed7..95a930aa3f3 100644 --- a/docs/src/use/formatters/index.md +++ b/docs/src/use/formatters/index.md @@ -71,7 +71,7 @@ Outputs results to the [Checkstyle](https://checkstyle.sourceforge.io/) format. Example output: -```text +```xml ``` @@ -109,7 +109,7 @@ Outputs results to format compatible with the [JSLint Jenkins plugin](https://pl Example output: -```text +```xml ``` @@ -119,10 +119,595 @@ Outputs JSON-serialized results. The `json-with-metadata` provides the same lint Alternatively, you can use the [ESLint Node.js API](../../integrate/nodejs-api) to programmatically use ESLint. -Example output: +Example output (formatted for easier reading): -```text -{"results":[{"filePath":"/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js","messages":[{"ruleId":"no-unused-vars","severity":2,"message":"'addOne' is defined but never used.","line":1,"column":10,"nodeType":"Identifier","messageId":"unusedVar","endLine":1,"endColumn":16},{"ruleId":"use-isnan","severity":2,"message":"Use the isNaN function to compare with NaN.","line":2,"column":9,"nodeType":"BinaryExpression","messageId":"comparisonWithNaN","endLine":2,"endColumn":17},{"ruleId":"space-unary-ops","severity":2,"message":"Unexpected space before unary operator '++'.","line":3,"column":16,"nodeType":"UpdateExpression","messageId":"unexpectedBefore","endLine":3,"endColumn":20,"fix":{"range":[57,58],"text":""}},{"ruleId":"semi","severity":1,"message":"Missing semicolon.","line":3,"column":20,"nodeType":"ReturnStatement","messageId":"missingSemi","endLine":4,"endColumn":1,"fix":{"range":[60,60],"text":";"}},{"ruleId":"no-else-return","severity":1,"message":"Unnecessary 'else' after 'return'.","line":4,"column":12,"nodeType":"BlockStatement","messageId":"unexpected","endLine":6,"endColumn":6,"fix":{"range":[0,94],"text":"function addOne(i) {\n if (i != NaN) {\n return i ++\n } \n return\n \n}"}},{"ruleId":"indent","severity":1,"message":"Expected indentation of 8 spaces but found 6.","line":5,"column":1,"nodeType":"Keyword","messageId":"wrongIndentation","endLine":5,"endColumn":7,"fix":{"range":[74,80],"text":" "}},{"ruleId":"consistent-return","severity":2,"message":"Function 'addOne' expected a return value.","line":5,"column":7,"nodeType":"ReturnStatement","messageId":"missingReturnValue","endLine":5,"endColumn":13},{"ruleId":"semi","severity":1,"message":"Missing semicolon.","line":5,"column":13,"nodeType":"ReturnStatement","messageId":"missingSemi","endLine":6,"endColumn":1,"fix":{"range":[86,86],"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,"fatalErrorCount":0,"warningCount":4,"fixableErrorCount":2,"fixableWarningCount":4,"source":"function addOne(i) {\n if (i != NaN) {\n return i ++\n } else {\n return\n }\n};"}],"metadata":{"rulesMeta":{"no-else-return":{"type":"suggestion","docs":{"description":"Disallow `else` blocks after `return` statements in `if` statements","recommended":false,"url":"https://eslint.org/docs/latest/rules/no-else-return"},"schema":[{"type":"object","properties":{"allowElseIf":{"type":"boolean","default":true}},"additionalProperties":false}],"fixable":"code","messages":{"unexpected":"Unnecessary 'else' after 'return'."}},"indent":{"type":"layout","docs":{"description":"Enforce consistent indentation","recommended":false,"url":"https://eslint.org/docs/latest/rules/indent"},"fixable":"whitespace","schema":[{"oneOf":[{"enum":["tab"]},{"type":"integer","minimum":0}]},{"type":"object","properties":{"SwitchCase":{"type":"integer","minimum":0,"default":0},"VariableDeclarator":{"oneOf":[{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},{"type":"object","properties":{"var":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"let":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"const":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]}},"additionalProperties":false}]},"outerIIFEBody":{"oneOf":[{"type":"integer","minimum":0},{"enum":["off"]}]},"MemberExpression":{"oneOf":[{"type":"integer","minimum":0},{"enum":["off"]}]},"FunctionDeclaration":{"type":"object","properties":{"parameters":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"body":{"type":"integer","minimum":0}},"additionalProperties":false},"FunctionExpression":{"type":"object","properties":{"parameters":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"body":{"type":"integer","minimum":0}},"additionalProperties":false},"StaticBlock":{"type":"object","properties":{"body":{"type":"integer","minimum":0}},"additionalProperties":false},"CallExpression":{"type":"object","properties":{"arguments":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]}},"additionalProperties":false},"ArrayExpression":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"ObjectExpression":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"ImportDeclaration":{"oneOf":[{"type":"integer","minimum":0},{"enum":["first","off"]}]},"flatTernaryExpressions":{"type":"boolean","default":false},"offsetTernaryExpressions":{"type":"boolean","default":false},"ignoredNodes":{"type":"array","items":{"type":"string","not":{"pattern":":exit$"}}},"ignoreComments":{"type":"boolean","default":false}},"additionalProperties":false}],"messages":{"wrongIndentation":"Expected indentation of {{expected}} but found {{actual}}."}},"space-unary-ops":{"type":"layout","docs":{"description":"Enforce consistent spacing before or after unary operators","recommended":false,"url":"https://eslint.org/docs/latest/rules/space-unary-ops"},"fixable":"whitespace","schema":[{"type":"object","properties":{"words":{"type":"boolean","default":true},"nonwords":{"type":"boolean","default":false},"overrides":{"type":"object","additionalProperties":{"type":"boolean"}}},"additionalProperties":false}],"messages":{"unexpectedBefore":"Unexpected space before unary operator '{{operator}}'.","unexpectedAfter":"Unexpected space after unary operator '{{operator}}'.","unexpectedAfterWord":"Unexpected space after unary word operator '{{word}}'.","wordOperator":"Unary word operator '{{word}}' must be followed by whitespace.","operator":"Unary operator '{{operator}}' must be followed by whitespace.","beforeUnaryExpressions":"Space is required before unary expressions '{{token}}'."}},"semi":{"type":"layout","docs":{"description":"Require or disallow semicolons instead of ASI","recommended":false,"url":"https://eslint.org/docs/latest/rules/semi"},"fixable":"code","schema":{"anyOf":[{"type":"array","items":[{"enum":["never"]},{"type":"object","properties":{"beforeStatementContinuationChars":{"enum":["always","any","never"]}},"additionalProperties":false}],"minItems":0,"maxItems":2},{"type":"array","items":[{"enum":["always"]},{"type":"object","properties":{"omitLastInOneLineBlock":{"type":"boolean"},"omitLastInOneLineClassBody":{"type":"boolean"}},"additionalProperties":false}],"minItems":0,"maxItems":2}]},"messages":{"missingSemi":"Missing semicolon.","extraSemi":"Extra semicolon."}},"consistent-return":{"type":"suggestion","docs":{"description":"Require `return` statements to either always or never specify values","recommended":false,"url":"https://eslint.org/docs/latest/rules/consistent-return"},"schema":[{"type":"object","properties":{"treatUndefinedAsUnspecified":{"type":"boolean","default":false}},"additionalProperties":false}],"messages":{"missingReturn":"Expected to return a value at the end of {{name}}.","missingReturnValue":"{{name}} expected a return value.","unexpectedReturnValue":"{{name}} expected no return value."}}}}} +```json +{ + "results": [ + { + "filePath": "/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js", + "messages": [ + { + "ruleId": "no-unused-vars", + "severity": 2, + "message": "'addOne' is defined but never used.", + "line": 1, + "column": 10, + "nodeType": "Identifier", + "messageId": "unusedVar", + "endLine": 1, + "endColumn": 16 + }, + { + "ruleId": "use-isnan", + "severity": 2, + "message": "Use the isNaN function to compare with NaN.", + "line": 2, + "column": 9, + "nodeType": "BinaryExpression", + "messageId": "comparisonWithNaN", + "endLine": 2, + "endColumn": 17 + }, + { + "ruleId": "space-unary-ops", + "severity": 2, + "message": "Unexpected space before unary operator '++'.", + "line": 3, + "column": 16, + "nodeType": "UpdateExpression", + "messageId": "unexpectedBefore", + "endLine": 3, + "endColumn": 20, + "fix": { + "range": [ + 57, + 58 + ], + "text": "" + } + }, + { + "ruleId": "semi", + "severity": 1, + "message": "Missing semicolon.", + "line": 3, + "column": 20, + "nodeType": "ReturnStatement", + "messageId": "missingSemi", + "endLine": 4, + "endColumn": 1, + "fix": { + "range": [ + 60, + 60 + ], + "text": ";" + } + }, + { + "ruleId": "no-else-return", + "severity": 1, + "message": "Unnecessary 'else' after 'return'.", + "line": 4, + "column": 12, + "nodeType": "BlockStatement", + "messageId": "unexpected", + "endLine": 6, + "endColumn": 6, + "fix": { + "range": [ + 0, + 94 + ], + "text": "function addOne(i) {\n if (i != NaN) {\n return i ++\n } \n return\n \n}" + } + }, + { + "ruleId": "indent", + "severity": 1, + "message": "Expected indentation of 8 spaces but found 6.", + "line": 5, + "column": 1, + "nodeType": "Keyword", + "messageId": "wrongIndentation", + "endLine": 5, + "endColumn": 7, + "fix": { + "range": [ + 74, + 80 + ], + "text": " " + } + }, + { + "ruleId": "consistent-return", + "severity": 2, + "message": "Function 'addOne' expected a return value.", + "line": 5, + "column": 7, + "nodeType": "ReturnStatement", + "messageId": "missingReturnValue", + "endLine": 5, + "endColumn": 13 + }, + { + "ruleId": "semi", + "severity": 1, + "message": "Missing semicolon.", + "line": 5, + "column": 13, + "nodeType": "ReturnStatement", + "messageId": "missingSemi", + "endLine": 6, + "endColumn": 1, + "fix": { + "range": [ + 86, + 86 + ], + "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, + "fatalErrorCount": 0, + "warningCount": 4, + "fixableErrorCount": 2, + "fixableWarningCount": 4, + "source": "function addOne(i) {\n if (i != NaN) {\n return i ++\n } else {\n return\n }\n};" + } + ], + "metadata": { + "rulesMeta": { + "no-else-return": { + "type": "suggestion", + "docs": { + "description": "Disallow `else` blocks after `return` statements in `if` statements", + "recommended": false, + "url": "https://eslint.org/docs/latest/rules/no-else-return" + }, + "schema": [ + { + "type": "object", + "properties": { + "allowElseIf": { + "type": "boolean", + "default": true + } + }, + "additionalProperties": false + } + ], + "fixable": "code", + "messages": { + "unexpected": "Unnecessary 'else' after 'return'." + } + }, + "indent": { + "type": "layout", + "docs": { + "description": "Enforce consistent indentation", + "recommended": false, + "url": "https://eslint.org/docs/latest/rules/indent" + }, + "fixable": "whitespace", + "schema": [ + { + "oneOf": [ + { + "enum": [ + "tab" + ] + }, + { + "type": "integer", + "minimum": 0 + } + ] + }, + { + "type": "object", + "properties": { + "SwitchCase": { + "type": "integer", + "minimum": 0, + "default": 0 + }, + "VariableDeclarator": { + "oneOf": [ + { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "enum": [ + "first", + "off" + ] + } + ] + }, + { + "type": "object", + "properties": { + "var": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "enum": [ + "first", + "off" + ] + } + ] + }, + "let": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "enum": [ + "first", + "off" + ] + } + ] + }, + "const": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "enum": [ + "first", + "off" + ] + } + ] + } + }, + "additionalProperties": false + } + ] + }, + "outerIIFEBody": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "enum": [ + "off" + ] + } + ] + }, + "MemberExpression": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "enum": [ + "off" + ] + } + ] + }, + "FunctionDeclaration": { + "type": "object", + "properties": { + "parameters": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "enum": [ + "first", + "off" + ] + } + ] + }, + "body": { + "type": "integer", + "minimum": 0 + } + }, + "additionalProperties": false + }, + "FunctionExpression": { + "type": "object", + "properties": { + "parameters": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "enum": [ + "first", + "off" + ] + } + ] + }, + "body": { + "type": "integer", + "minimum": 0 + } + }, + "additionalProperties": false + }, + "StaticBlock": { + "type": "object", + "properties": { + "body": { + "type": "integer", + "minimum": 0 + } + }, + "additionalProperties": false + }, + "CallExpression": { + "type": "object", + "properties": { + "arguments": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "enum": [ + "first", + "off" + ] + } + ] + } + }, + "additionalProperties": false + }, + "ArrayExpression": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "enum": [ + "first", + "off" + ] + } + ] + }, + "ObjectExpression": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "enum": [ + "first", + "off" + ] + } + ] + }, + "ImportDeclaration": { + "oneOf": [ + { + "type": "integer", + "minimum": 0 + }, + { + "enum": [ + "first", + "off" + ] + } + ] + }, + "flatTernaryExpressions": { + "type": "boolean", + "default": false + }, + "offsetTernaryExpressions": { + "type": "boolean", + "default": false + }, + "ignoredNodes": { + "type": "array", + "items": { + "type": "string", + "not": { + "pattern": ":exit$" + } + } + }, + "ignoreComments": { + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + } + ], + "messages": { + "wrongIndentation": "Expected indentation of {{expected}} but found {{actual}}." + } + }, + "space-unary-ops": { + "type": "layout", + "docs": { + "description": "Enforce consistent spacing before or after unary operators", + "recommended": false, + "url": "https://eslint.org/docs/latest/rules/space-unary-ops" + }, + "fixable": "whitespace", + "schema": [ + { + "type": "object", + "properties": { + "words": { + "type": "boolean", + "default": true + }, + "nonwords": { + "type": "boolean", + "default": false + }, + "overrides": { + "type": "object", + "additionalProperties": { + "type": "boolean" + } + } + }, + "additionalProperties": false + } + ], + "messages": { + "unexpectedBefore": "Unexpected space before unary operator '{{operator}}'.", + "unexpectedAfter": "Unexpected space after unary operator '{{operator}}'.", + "unexpectedAfterWord": "Unexpected space after unary word operator '{{word}}'.", + "wordOperator": "Unary word operator '{{word}}' must be followed by whitespace.", + "operator": "Unary operator '{{operator}}' must be followed by whitespace.", + "beforeUnaryExpressions": "Space is required before unary expressions '{{token}}'." + } + }, + "semi": { + "type": "layout", + "docs": { + "description": "Require or disallow semicolons instead of ASI", + "recommended": false, + "url": "https://eslint.org/docs/latest/rules/semi" + }, + "fixable": "code", + "schema": { + "anyOf": [ + { + "type": "array", + "items": [ + { + "enum": [ + "never" + ] + }, + { + "type": "object", + "properties": { + "beforeStatementContinuationChars": { + "enum": [ + "always", + "any", + "never" + ] + } + }, + "additionalProperties": false + } + ], + "minItems": 0, + "maxItems": 2 + }, + { + "type": "array", + "items": [ + { + "enum": [ + "always" + ] + }, + { + "type": "object", + "properties": { + "omitLastInOneLineBlock": { + "type": "boolean" + }, + "omitLastInOneLineClassBody": { + "type": "boolean" + } + }, + "additionalProperties": false + } + ], + "minItems": 0, + "maxItems": 2 + } + ] + }, + "messages": { + "missingSemi": "Missing semicolon.", + "extraSemi": "Extra semicolon." + } + }, + "consistent-return": { + "type": "suggestion", + "docs": { + "description": "Require `return` statements to either always or never specify values", + "recommended": false, + "url": "https://eslint.org/docs/latest/rules/consistent-return" + }, + "schema": [ + { + "type": "object", + "properties": { + "treatUndefinedAsUnspecified": { + "type": "boolean", + "default": false + } + }, + "additionalProperties": false + } + ], + "messages": { + "missingReturn": "Expected to return a value at the end of {{name}}.", + "missingReturnValue": "{{name}} expected a return value.", + "unexpectedReturnValue": "{{name}} expected no return value." + } + } + } + } +} ``` ### json @@ -131,10 +716,164 @@ Outputs JSON-serialized results. The `json` formatter is useful when you want to Alternatively, you can use the [ESLint Node.js API](../../integrate/nodejs-api) to programmatically use ESLint. -Example output: +Example output (formatted for easier reading): -```text -[{"filePath":"/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js","messages":[{"ruleId":"no-unused-vars","severity":2,"message":"'addOne' is defined but never used.","line":1,"column":10,"nodeType":"Identifier","messageId":"unusedVar","endLine":1,"endColumn":16},{"ruleId":"use-isnan","severity":2,"message":"Use the isNaN function to compare with NaN.","line":2,"column":9,"nodeType":"BinaryExpression","messageId":"comparisonWithNaN","endLine":2,"endColumn":17},{"ruleId":"space-unary-ops","severity":2,"message":"Unexpected space before unary operator '++'.","line":3,"column":16,"nodeType":"UpdateExpression","messageId":"unexpectedBefore","endLine":3,"endColumn":20,"fix":{"range":[57,58],"text":""}},{"ruleId":"semi","severity":1,"message":"Missing semicolon.","line":3,"column":20,"nodeType":"ReturnStatement","messageId":"missingSemi","endLine":4,"endColumn":1,"fix":{"range":[60,60],"text":";"}},{"ruleId":"no-else-return","severity":1,"message":"Unnecessary 'else' after 'return'.","line":4,"column":12,"nodeType":"BlockStatement","messageId":"unexpected","endLine":6,"endColumn":6,"fix":{"range":[0,94],"text":"function addOne(i) {\n if (i != NaN) {\n return i ++\n } \n return\n \n}"}},{"ruleId":"indent","severity":1,"message":"Expected indentation of 8 spaces but found 6.","line":5,"column":1,"nodeType":"Keyword","messageId":"wrongIndentation","endLine":5,"endColumn":7,"fix":{"range":[74,80],"text":" "}},{"ruleId":"consistent-return","severity":2,"message":"Function 'addOne' expected a return value.","line":5,"column":7,"nodeType":"ReturnStatement","messageId":"missingReturnValue","endLine":5,"endColumn":13},{"ruleId":"semi","severity":1,"message":"Missing semicolon.","line":5,"column":13,"nodeType":"ReturnStatement","messageId":"missingSemi","endLine":6,"endColumn":1,"fix":{"range":[86,86],"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,"fatalErrorCount":0,"warningCount":4,"fixableErrorCount":2,"fixableWarningCount":4,"source":"function addOne(i) {\n if (i != NaN) {\n return i ++\n } else {\n return\n }\n};"}] +```json +[ + { + "filePath": "/var/lib/jenkins/workspace/Releases/eslint Release/eslint/fullOfProblems.js", + "messages": [ + { + "ruleId": "no-unused-vars", + "severity": 2, + "message": "'addOne' is defined but never used.", + "line": 1, + "column": 10, + "nodeType": "Identifier", + "messageId": "unusedVar", + "endLine": 1, + "endColumn": 16 + }, + { + "ruleId": "use-isnan", + "severity": 2, + "message": "Use the isNaN function to compare with NaN.", + "line": 2, + "column": 9, + "nodeType": "BinaryExpression", + "messageId": "comparisonWithNaN", + "endLine": 2, + "endColumn": 17 + }, + { + "ruleId": "space-unary-ops", + "severity": 2, + "message": "Unexpected space before unary operator '++'.", + "line": 3, + "column": 16, + "nodeType": "UpdateExpression", + "messageId": "unexpectedBefore", + "endLine": 3, + "endColumn": 20, + "fix": { + "range": [ + 57, + 58 + ], + "text": "" + } + }, + { + "ruleId": "semi", + "severity": 1, + "message": "Missing semicolon.", + "line": 3, + "column": 20, + "nodeType": "ReturnStatement", + "messageId": "missingSemi", + "endLine": 4, + "endColumn": 1, + "fix": { + "range": [ + 60, + 60 + ], + "text": ";" + } + }, + { + "ruleId": "no-else-return", + "severity": 1, + "message": "Unnecessary 'else' after 'return'.", + "line": 4, + "column": 12, + "nodeType": "BlockStatement", + "messageId": "unexpected", + "endLine": 6, + "endColumn": 6, + "fix": { + "range": [ + 0, + 94 + ], + "text": "function addOne(i) {\n if (i != NaN) {\n return i ++\n } \n return\n \n}" + } + }, + { + "ruleId": "indent", + "severity": 1, + "message": "Expected indentation of 8 spaces but found 6.", + "line": 5, + "column": 1, + "nodeType": "Keyword", + "messageId": "wrongIndentation", + "endLine": 5, + "endColumn": 7, + "fix": { + "range": [ + 74, + 80 + ], + "text": " " + } + }, + { + "ruleId": "consistent-return", + "severity": 2, + "message": "Function 'addOne' expected a return value.", + "line": 5, + "column": 7, + "nodeType": "ReturnStatement", + "messageId": "missingReturnValue", + "endLine": 5, + "endColumn": 13 + }, + { + "ruleId": "semi", + "severity": 1, + "message": "Missing semicolon.", + "line": 5, + "column": 13, + "nodeType": "ReturnStatement", + "messageId": "missingSemi", + "endLine": 6, + "endColumn": 1, + "fix": { + "range": [ + 86, + 86 + ], + "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, + "fatalErrorCount": 0, + "warningCount": 4, + "fixableErrorCount": 2, + "fixableWarningCount": 4, + "source": "function addOne(i) {\n if (i != NaN) {\n return i ++\n } else {\n return\n }\n};" + } +] ``` ### junit @@ -143,7 +882,7 @@ Outputs results to format compatible with the [JUnit Jenkins plugin](https://plu Example output: -```text +```xml diff --git a/package.json b/package.json index 14f86b846cf..45a42d1bf2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "eslint", - "version": "8.51.0", + "version": "8.52.0", "author": "Nicholas C. Zakas ", "description": "An AST-based pattern checker for JavaScript.", "bin": {