New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docs: Update Linter API for v9 #17937
Conversation
✅ Deploy Preview for docs-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
The `verify()` method returns an array of objects containing information about the linting warnings and errors. Here's an example: | ||
|
||
```js | ||
{ | ||
fatal: false, | ||
ruleId: "semi", | ||
severity: 2, | ||
line: 1, | ||
column: 23, | ||
message: "Expected a semicolon.", | ||
fix: { | ||
range: [1, 15], | ||
text: ";" | ||
[ | ||
{ | ||
fatal: false, | ||
ruleId: "semi", | ||
severity: 2, | ||
line: 1, | ||
column: 23, | ||
message: "Expected a semicolon.", | ||
fix: { | ||
range: [1, 15], | ||
text: ";" | ||
} | ||
} | ||
} | ||
] | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't a change in v9, I just wrapped the lint message example in []
because verify()
always returns arrays.
@@ -601,8 +603,6 @@ const suppressedMessages = linter.getSuppressedMessages(); | |||
console.log(suppressedMessages[0].suppressions); // [{ "kind": "directive", "justification": "Need to suppress" }] | |||
``` | |||
|
|||
Linting message objects have a deprecated `source` property. This property **will be removed** from linting messages in an upcoming breaking release. If you depend on this property, you should now use the `SourceCode` instance provided by the linter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property was removed in ESLint v5 (27e3f24)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:
Updates Linter API for v9.
What changes did you make? (Give an overview)
Is there anything you'd like reviewers to focus on?