Skip to content

Commit cd39983

Browse files
authored
docs: move custom-formatters type descriptions to nodejs-api (#20190)
* docs: link the types from the `custom-formatters` page to the `nodejs-api` page * update
1 parent 8962089 commit cd39983

File tree

2 files changed

+2
-28
lines changed

2 files changed

+2
-28
lines changed

docs/src/extend/custom-formatters.md

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ The remainder of this section contains reference information on how to work with
4444

4545
### The `results` Argument
4646

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:
4848

4949
```js
5050
[
@@ -85,32 +85,6 @@ The `results` object passed into a formatter is an array of [`result`](#the-resu
8585
];
8686
```
8787

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-
11488
### The `context` Argument
11589

11690
The formatter function receives a `context` object as its second argument. The object has the following properties:

docs/src/use/command-line-interface.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1070,7 +1070,7 @@ This option outputs the configuration to be used for the file passed. When prese
10701070

10711071
#### `--stats`
10721072

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)).
10741074

10751075
- **Argument Type**: No argument.
10761076

0 commit comments

Comments
 (0)