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-rules.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
@@ -163,7 +163,7 @@ The main method you'll use when writing custom rules is `context.report()`, whic
163
163
164
164
-`messageId`: (`string`) The ID of the message (see [messageIds](#messageids)) (recommended over `message`).
165
165
-`message`: (`string`) The problem message (alternative to `messageId`).
166
-
-`node`: (optional `object`) The AST node related to the problem. If present and `loc` is not specified, then the starting location of the node is used as the location of the problem.
166
+
-`node`: (optional `object`) This can be an AST node, a token, or a comment related to the problem. If present and `loc` is not specified, then the starting location of the node is used as the location of the problem.
167
167
-`loc`: (optional `object`) Specifies the location of the problem. If both `loc` and `node` are specified, then the location is used from `loc` instead of `node`.
168
168
-`start`: An object of the start location.
169
169
- `line`: (`number`) The 1-based line number at which the problem occurred.
Copy file name to clipboardExpand all lines: docs/src/integrate/nodejs-api.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
@@ -672,7 +672,7 @@ The information available for each linting message is:
672
672
-`line` - the line on which the error occurred.
673
673
-`message` - the message that should be output.
674
674
-`messageId` - the ID of the message used to generate the message (this property is omitted if the rule does not use message IDs).
675
-
-`nodeType` - (**Deprecated:** This property will be removed in a future version of ESLint.) the node or token type that was reported with the problem.
675
+
-`nodeType` - (**Deprecated:** This property will be removed in a future version of ESLint.) the node, comment, or token type that was reported with the problem.
676
676
-`ruleId` - the ID of the rule that triggered the messages (or null if `fatal` is true).
677
677
-`severity` - either 1 or 2, depending on your configuration.
678
678
-`endColumn` - the end column of the range on which the error occurred (this property is omitted if it's not range).
* - `"problem"` means the rule is identifying code that either will cause an error or may cause a confusing behavior. Developers should consider this a high priority to resolve.
1162
-
* - `"suggestion"` means the rule is identifying something that could be done in a better way but no errors will occur if the code isn’t changed.
1167
+
* - `"suggestion"` means the rule is identifying something that could be done in a better way but no errors will occur if the code isn't changed.
1163
1168
* - `"layout"` means the rule cares primarily about whitespace, semicolons, commas, and parentheses,
1164
1169
* all the parts of the program that determine how the code looks rather than how it executes.
1165
-
* These rules work on parts of the code that aren’t specified in the AST.
1170
+
* These rules work on parts of the code that aren't specified in the AST.
1166
1171
*/
1167
1172
type?: "problem"|"suggestion"|"layout"|undefined;
1168
1173
/**
@@ -1177,7 +1182,7 @@ export namespace Rule {
1177
1182
LangOptions: Linter.LanguageOptions;
1178
1183
Code: SourceCode;
1179
1184
RuleOptions: any[];
1180
-
Node: ESTree.Node;
1185
+
Node: JSSyntaxElement;
1181
1186
MessageIds: string;
1182
1187
}>{
1183
1188
/*
@@ -1275,7 +1280,7 @@ export type JSRuleDefinition<
0 commit comments