Skip to content

Commit

Permalink
docs: update docs for v9.0.0-alpha.0 (#17929)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic committed Dec 30, 2023
1 parent 903ee60 commit 2a8eea8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 188 deletions.
2 changes: 1 addition & 1 deletion docs/package.json
@@ -1,7 +1,7 @@
{
"name": "docs-eslint",
"private": true,
"version": "8.56.0",
"version": "9.0.0-alpha.0",
"description": "",
"main": "index.js",
"keywords": [],
Expand Down
2 changes: 1 addition & 1 deletion docs/src/_data/rule_versions.json
Expand Up @@ -330,4 +330,4 @@
"space-unary-word-ops": "0.10.0",
"spaced-line-comment": "1.0.0-rc-1"
}
}
}
4 changes: 2 additions & 2 deletions docs/src/use/formatters/html-formatter-example.html
Expand Up @@ -118,14 +118,14 @@
<div id="overview" class="bg-2">
<h1>ESLint Report</h1>
<div>
<span>9 problems (5 errors, 4 warnings)</span> - Generated on Fri Dec 15 2023 22:54:05 GMT+0000 (Coordinated Universal Time)
<span>9 problems (5 errors, 4 warnings)</span> - Generated on Sat Dec 30 2023 01:21:43 GMT+0100 (Central European Standard Time)
</div>
</div>
<table>
<tbody>
<tr class="bg-2" data-group="f-0">
<th colspan="4">
[+] /var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js
[+] C:\projects\eslint\fullOfProblems.js
<span>9 problems (5 errors, 4 warnings)</span>
</th>
</tr>
Expand Down
187 changes: 3 additions & 184 deletions docs/src/use/formatters/index.md
Expand Up @@ -14,17 +14,10 @@ You can specify a formatter using the `--format` or `-f` flag in the CLI. For ex

The built-in formatter options are:

* [checkstyle](#checkstyle)
* [compact](#compact)
* [html](#html)
* [jslint-xml](#jslint-xml)
* [json-with-metadata](#json-with-metadata)
* [json](#json)
* [junit](#junit)
* [stylish](#stylish)
* [tap](#tap)
* [unix](#unix)
* [visualstudio](#visualstudio)

## Example Source

Expand Down Expand Up @@ -65,36 +58,6 @@ npx eslint --format <Add formatter here> fullOfProblems.js

## Built-In Formatter Options

### checkstyle

Outputs results to the [Checkstyle](https://checkstyle.sourceforge.io/) format.

Example output:

```xml
<?xml version="1.0" encoding="utf-8"?><checkstyle version="4.3"><file name="/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js"><error line="1" column="10" severity="error" message="&apos;addOne&apos; is defined but never used. (no-unused-vars)" source="eslint.rules.no-unused-vars" /><error line="2" column="9" severity="error" message="Use the isNaN function to compare with NaN. (use-isnan)" source="eslint.rules.use-isnan" /><error line="3" column="16" severity="error" message="Unexpected space before unary operator &apos;++&apos;. (space-unary-ops)" source="eslint.rules.space-unary-ops" /><error line="3" column="20" severity="warning" message="Missing semicolon. (semi)" source="eslint.rules.semi" /><error line="4" column="12" severity="warning" message="Unnecessary &apos;else&apos; after &apos;return&apos;. (no-else-return)" source="eslint.rules.no-else-return" /><error line="5" column="1" severity="warning" message="Expected indentation of 8 spaces but found 6. (indent)" source="eslint.rules.indent" /><error line="5" column="7" severity="error" message="Function &apos;addOne&apos; expected a return value. (consistent-return)" source="eslint.rules.consistent-return" /><error line="5" column="13" severity="warning" message="Missing semicolon. (semi)" source="eslint.rules.semi" /><error line="7" column="2" severity="error" message="Unnecessary semicolon. (no-extra-semi)" source="eslint.rules.no-extra-semi" /></file></checkstyle>
```

### compact

Human-readable output format. Mimics the default output of JSHint.

Example output:

```text
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js: line 1, col 10, Error - 'addOne' is defined but never used. (no-unused-vars)
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js: line 2, col 9, Error - Use the isNaN function to compare with NaN. (use-isnan)
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js: line 3, col 16, Error - Unexpected space before unary operator '++'. (space-unary-ops)
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js: line 3, col 20, Warning - Missing semicolon. (semi)
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js: line 4, col 12, Warning - Unnecessary 'else' after 'return'. (no-else-return)
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js: line 5, col 1, Warning - Expected indentation of 8 spaces but found 6. (indent)
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js: line 5, col 7, Error - Function 'addOne' expected a return value. (consistent-return)
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js: line 5, col 13, Warning - Missing semicolon. (semi)
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js: line 7, col 2, Error - Unnecessary semicolon. (no-extra-semi)
9 problems
```

### html

Outputs results to HTML. The `html` formatter is useful for visual presentation in the browser.
Expand All @@ -103,16 +66,6 @@ Example output:

<iframe src="html-formatter-example.html" width="100%" height="460px"></iframe>

### jslint-xml

Outputs results to format compatible with the [JSLint Jenkins plugin](https://plugins.jenkins.io/jslint/).

Example output:

```xml
<?xml version="1.0" encoding="utf-8"?><jslint><file name="/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js"><issue line="1" char="10" evidence="" reason="&apos;addOne&apos; is defined but never used. (no-unused-vars)" /><issue line="2" char="9" evidence="" reason="Use the isNaN function to compare with NaN. (use-isnan)" /><issue line="3" char="16" evidence="" reason="Unexpected space before unary operator &apos;++&apos;. (space-unary-ops)" /><issue line="3" char="20" evidence="" reason="Missing semicolon. (semi)" /><issue line="4" char="12" evidence="" reason="Unnecessary &apos;else&apos; after &apos;return&apos;. (no-else-return)" /><issue line="5" char="1" evidence="" reason="Expected indentation of 8 spaces but found 6. (indent)" /><issue line="5" char="7" evidence="" reason="Function &apos;addOne&apos; expected a return value. (consistent-return)" /><issue line="5" char="13" evidence="" reason="Missing semicolon. (semi)" /><issue line="7" char="2" evidence="" reason="Unnecessary semicolon. (no-extra-semi)" /></file></jslint>
```

### json-with-metadata

Outputs JSON-serialized results. The `json-with-metadata` provides the same linting results as the [`json`](#json) formatter with additional metadata about the rules applied. The linting results are included in the `results` property and the rules metadata is included in the `metadata` property.
Expand All @@ -125,7 +78,7 @@ Example output (formatted for easier reading):
{
"results": [
{
"filePath": "/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js",
"filePath": "C:\\projects\\eslint\\fullOfProblems.js",
"messages": [
{
"ruleId": "no-unused-vars",
Expand Down Expand Up @@ -727,7 +680,7 @@ Example output (formatted for easier reading):
```json
[
{
"filePath": "/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js",
"filePath": "C:\\projects\\eslint\\fullOfProblems.js",
"messages": [
{
"ruleId": "no-unused-vars",
Expand Down Expand Up @@ -882,30 +835,6 @@ Example output (formatted for easier reading):
]
```

### junit

Outputs results to format compatible with the [JUnit Jenkins plugin](https://plugins.jenkins.io/junit/).

Example output:

```xml
<?xml version="1.0" encoding="utf-8"?>
<testsuites>
<testsuite package="org.eslint" time="0" tests="9" errors="9" name="/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js">
<testcase time="0" name="org.eslint.no-unused-vars" classname="/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems"><failure message="&apos;addOne&apos; is defined but never used."><![CDATA[line 1, col 10, Error - &apos;addOne&apos; is defined but never used. (no-unused-vars)]]></failure></testcase>
<testcase time="0" name="org.eslint.use-isnan" classname="/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems"><failure message="Use the isNaN function to compare with NaN."><![CDATA[line 2, col 9, Error - Use the isNaN function to compare with NaN. (use-isnan)]]></failure></testcase>
<testcase time="0" name="org.eslint.space-unary-ops" classname="/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems"><failure message="Unexpected space before unary operator &apos;++&apos;."><![CDATA[line 3, col 16, Error - Unexpected space before unary operator &apos;++&apos;. (space-unary-ops)]]></failure></testcase>
<testcase time="0" name="org.eslint.semi" classname="/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems"><failure message="Missing semicolon."><![CDATA[line 3, col 20, Warning - Missing semicolon. (semi)]]></failure></testcase>
<testcase time="0" name="org.eslint.no-else-return" classname="/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems"><failure message="Unnecessary &apos;else&apos; after &apos;return&apos;."><![CDATA[line 4, col 12, Warning - Unnecessary &apos;else&apos; after &apos;return&apos;. (no-else-return)]]></failure></testcase>
<testcase time="0" name="org.eslint.indent" classname="/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems"><failure message="Expected indentation of 8 spaces but found 6."><![CDATA[line 5, col 1, Warning - Expected indentation of 8 spaces but found 6. (indent)]]></failure></testcase>
<testcase time="0" name="org.eslint.consistent-return" classname="/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems"><failure message="Function &apos;addOne&apos; expected a return value."><![CDATA[line 5, col 7, Error - Function &apos;addOne&apos; expected a return value. (consistent-return)]]></failure></testcase>
<testcase time="0" name="org.eslint.semi" classname="/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems"><failure message="Missing semicolon."><![CDATA[line 5, col 13, Warning - Missing semicolon. (semi)]]></failure></testcase>
<testcase time="0" name="org.eslint.no-extra-semi" classname="/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems"><failure message="Unnecessary semicolon."><![CDATA[line 7, col 2, Error - Unnecessary semicolon. (no-extra-semi)]]></failure></testcase>
</testsuite>
</testsuites>

```

### stylish

Human-readable output format. This is the default formatter.
Expand All @@ -914,7 +843,7 @@ Example output:

```text
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js
C:\projects\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 @@ -929,113 +858,3 @@ Example output:
2 errors and 4 warnings potentially fixable with the `--fix` option.
```

### tap

Outputs results to the [Test Anything Protocol (TAP)](https://testanything.org/) specification format.

Example output:

```text
TAP version 13
1..1
not ok 1 - /var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js
---
message: '''addOne'' is defined but never used.'
severity: error
data:
line: 1
column: 10
ruleId: no-unused-vars
messages:
- message: Use the isNaN function to compare with NaN.
severity: error
data:
line: 2
column: 9
ruleId: use-isnan
- message: Unexpected space before unary operator '++'.
severity: error
data:
line: 3
column: 16
ruleId: space-unary-ops
- message: Missing semicolon.
severity: warning
data:
line: 3
column: 20
ruleId: semi
- message: Unnecessary 'else' after 'return'.
severity: warning
data:
line: 4
column: 12
ruleId: no-else-return
- message: Expected indentation of 8 spaces but found 6.
severity: warning
data:
line: 5
column: 1
ruleId: indent
- message: Function 'addOne' expected a return value.
severity: error
data:
line: 5
column: 7
ruleId: consistent-return
- message: Missing semicolon.
severity: warning
data:
line: 5
column: 13
ruleId: semi
- message: Unnecessary semicolon.
severity: error
data:
line: 7
column: 2
ruleId: no-extra-semi
...
```

### unix

Outputs results to a format similar to many commands in UNIX-like systems. Parsable with tools such as [grep](https://www.gnu.org/software/grep/manual/grep.html), [sed](https://www.gnu.org/software/sed/manual/sed.html), and [awk](https://www.gnu.org/software/gawk/manual/gawk.html).

Example output:

```text
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js:1:10: 'addOne' is defined but never used. [Error/no-unused-vars]
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js:2:9: Use the isNaN function to compare with NaN. [Error/use-isnan]
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js:3:16: Unexpected space before unary operator '++'. [Error/space-unary-ops]
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js:3:20: Missing semicolon. [Warning/semi]
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js:4:12: Unnecessary 'else' after 'return'. [Warning/no-else-return]
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js:5:1: Expected indentation of 8 spaces but found 6. [Warning/indent]
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js:5:7: Function 'addOne' expected a return value. [Error/consistent-return]
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js:5:13: Missing semicolon. [Warning/semi]
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js:7:2: Unnecessary semicolon. [Error/no-extra-semi]
9 problems
```

### visualstudio

Outputs results to format compatible with the integrated terminal of the [Visual Studio](https://visualstudio.microsoft.com/) IDE. When using Visual Studio, you can click on the linting results in the integrated terminal to go to the issue in the source code.

Example output:

```text
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js(1,10): error no-unused-vars : 'addOne' is defined but never used.
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js(2,9): error use-isnan : Use the isNaN function to compare with NaN.
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js(3,16): error space-unary-ops : Unexpected space before unary operator '++'.
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js(3,20): warning semi : Missing semicolon.
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js(4,12): warning no-else-return : Unnecessary 'else' after 'return'.
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js(5,1): warning indent : Expected indentation of 8 spaces but found 6.
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js(5,7): error consistent-return : Function 'addOne' expected a return value.
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js(5,13): warning semi : Missing semicolon.
/var/lib/jenkins/workspace/eslint Release/eslint/fullOfProblems.js(7,2): error no-extra-semi : Unnecessary semicolon.
9 problems
```

0 comments on commit 2a8eea8

Please sign in to comment.