You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/src/extend/custom-formatters.md
+1-27Lines changed: 1 addition & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -44,7 +44,7 @@ The remainder of this section contains reference information on how to work with
44
44
45
45
### The `results` Argument
46
46
47
-
The `results` object passed into a formatter is an array of [`result`](#the-result-object) objects containing the linting results for individual files. Here's an example output:
47
+
The `results` object passed into a formatter is an array of [`LintResult`](../integrate/nodejs-api#-lintresult-type) objects containing the linting results for individual files. Here's an example output:
48
48
49
49
```js
50
50
[
@@ -85,32 +85,6 @@ The `results` object passed into a formatter is an array of [`result`](#the-resu
85
85
];
86
86
```
87
87
88
-
#### The `result` Object
89
-
90
-
<!-- This section is copied from the "Node.js API" page. Changes to this section should
91
-
also be manually applied to that page. -->
92
-
93
-
Each object in the `results` array is a `result` object. Each `result` object contains the path of the file that was linted and information about linting issues that were encountered. Here are the properties available on each `result` object:
94
-
95
-
-**filePath**: The absolute path to the file that was linted.
96
-
-**messages**: An array of [`message`](#the-message-object) objects. See below for more info about messages.
97
-
-**errorCount**: The number of errors for the given file.
98
-
-**warningCount**: The number of warnings for the given file.
99
-
-**stats**: The optional [`stats`](./stats#-stats-type) object that only exists when the `stats` option is used.
100
-
-**source**: The source code for the given file. This property is omitted if this file has no errors/warnings or if the `output` property is present.
101
-
-**output**: The source code for the given file with as many fixes applied as possible. This property is omitted if no fix is available.
102
-
103
-
##### The `message` Object
104
-
105
-
Each `message` object contains information about the ESLint rule that was triggered by some source code. The properties available on each `message` object are:
106
-
107
-
-**ruleId**: the ID of the rule that produced the error or warning. If the error or warning was not produced by a rule (for example, if it's a parsing error), this is `null`.
108
-
-**severity**: the severity of the failure, `1` for warnings and `2` for errors.
109
-
-**message**: the human readable description of the error.
110
-
-**line**: the line where the issue is located.
111
-
-**column**: the column where the issue is located.
112
-
-**nodeType**: (**Deprecated:** This property will be removed in a future version of ESLint.) the type of the node in the [AST](https://github.com/estree/estree/blob/master/es5.md#node-objects) or `null` if the issue isn't related to a particular AST node.
113
-
114
88
### The `context` Argument
115
89
116
90
The formatter function receives a `context` object as its second argument. The object has the following properties:
Copy file name to clipboardExpand all lines: docs/src/use/command-line-interface.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1070,7 +1070,7 @@ This option outputs the configuration to be used for the file passed. When prese
1070
1070
1071
1071
#### `--stats`
1072
1072
1073
-
This option adds a series of detailed performance statistics (see [Stats type](../extend/stats#-stats-type)) such as the _parse_-, _fix_- and _lint_-times (time per rule) to [`result`](../extend/custom-formatters#the-result-object) objects that are passed to the formatter (see [Stats CLI usage](../extend/stats#cli-usage)).
1073
+
This option adds a series of detailed performance statistics (see [Stats type](../extend/stats#-stats-type)) such as the _parse_-, _fix_- and _lint_-times (time per rule) to [`result`](../integrate/nodejs-api#-lintresult-type) objects that are passed to the formatter (see [Stats CLI usage](../extend/stats#cli-usage)).
0 commit comments