Skip to content
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

Merged
merged 2 commits into from Jan 1, 2024
Merged

docs: Update Linter API for v9 #17937

merged 2 commits into from Jan 1, 2024

Conversation

mdjermanovic
Copy link
Member

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)

  • Updated Linter API in the Node.js API Reference document.
  • Added Linter API changes to the v9 migration guide.

Is there anything you'd like reviewers to focus on?

@mdjermanovic mdjermanovic requested a review from a team as a code owner January 1, 2024 16:12
Copy link

netlify bot commented Jan 1, 2024

Deploy Preview for docs-eslint ready!

Name Link
🔨 Latest commit 6dbb18b
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/65930c26eca20100089d7fb1
😎 Deploy Preview https://deploy-preview-17937--docs-eslint.netlify.app/use/migrate-to-9.0.0
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@eslint-github-bot eslint-github-bot bot added the documentation Relates to ESLint's documentation label Jan 1, 2024
Comment on lines 557 to 574
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: ";"
}
}
}
]
```
Copy link
Member Author

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.
Copy link
Member Author

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)

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

docs/src/use/migrate-to-9.0.0.md Outdated Show resolved Hide resolved
@nzakas nzakas merged commit 4a9cd1e into main Jan 1, 2024
12 checks passed
@nzakas nzakas deleted the v9-docs-linter-api branch January 1, 2024 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Relates to ESLint's documentation
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

None yet

2 participants