Skip to content

Commit abdbfa8

Browse files
docs: mark LintMessage#nodeType as deprecated (#19019)
* docs: mark `LintMessage#nodeType` as deprecated * docs: mark `TestCaseError#type` as deprecated * docs: apply suggestions from code review Co-authored-by: Milos Djermanovic <[email protected]> --------- Co-authored-by: Milos Djermanovic <[email protected]>
1 parent 468e3bd commit abdbfa8

3 files changed

Lines changed: 9 additions & 3 deletions

File tree

docs/src/extend/custom-formatters.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Each `message` object contains information about the ESLint rule that was trigge
111111
* **message**: the human readable description of the error.
112112
* **line**: the line where the issue is located.
113113
* **column**: the column where the issue is located.
114-
* **nodeType**: 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.
114+
* **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.
115115

116116
### The `context` Argument
117117

docs/src/integrate/nodejs-api.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ The information available for each linting message is:
658658
* `fatal` - usually omitted, but will be set to true if there's a parsing error (not related to a rule).
659659
* `line` - the line on which the error occurred.
660660
* `message` - the message that should be output.
661-
* `nodeType` - the node or token type that was reported with the problem.
661+
* `nodeType` - (**Deprecated:** This property will be removed in a future version of ESLint.) the node or token type that was reported with the problem.
662662
* `ruleId` - the ID of the rule that triggered the messages (or null if `fatal` is true).
663663
* `severity` - either 1 or 2, depending on your configuration.
664664
* `endColumn` - the end column of the range on which the error occurred (this property is omitted if it's not range).
@@ -839,7 +839,7 @@ In addition to the properties above, invalid test cases can also have the follow
839839
* `message` (string/regexp): The message for the error. Must provide this or `messageId`
840840
* `messageId` (string): The Id for the error. Must provide this or `message`. See [testing errors with messageId](#testing-errors-with-messageid) for details
841841
* `data` (object): Placeholder data which can be used in combination with `messageId`
842-
* `type` (string): The type of the reported AST node
842+
* `type` (string): (**Deprecated:** This property will be removed in a future version of ESLint.) The type of the reported AST node
843843
* `line` (number): The 1-based line number of the reported location
844844
* `column` (number): The 1-based column number of the reported location
845845
* `endLine` (number): The 1-based line number of the end of the reported location

lib/types/index.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1179,6 +1179,9 @@ export namespace Linter {
11791179
ruleId: string | null;
11801180
message: string;
11811181
messageId?: string | undefined;
1182+
/**
1183+
* @deprecated `nodeType` is deprecated and will be removed in the next major version.
1184+
*/
11821185
nodeType?: string | undefined;
11831186
fatal?: true | undefined;
11841187
severity: Exclude<Severity, 0>;
@@ -1661,6 +1664,9 @@ export namespace RuleTester {
16611664
interface TestCaseError {
16621665
message?: string | RegExp;
16631666
messageId?: string;
1667+
/**
1668+
* @deprecated `type` is deprecated and will be removed in the next major version.
1669+
*/
16641670
type?: string | undefined;
16651671
data?: any;
16661672
line?: number | undefined;

0 commit comments

Comments
 (0)