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

fix: Bring types in sync with @eslint/core #19157

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft

fix: Bring types in sync with @eslint/core #19157

wants to merge 3 commits into from

Conversation

nzakas
Copy link
Member

@nzakas nzakas commented Nov 22, 2024

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] 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
[x] Other, please explain:

Types update.

What changes did you make? (Give an overview)

This PR reformulates some types exported by eslint in terms of the types exported from @eslint/core. This will allow better compatibility with language plugins and allow us to start de-duplicating types.

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

I did my best to ensure that these type changes are backwards compatible, but please do double-check:

  • RuleContext
  • RuleModule
  • SourceCode

I also did not update ESLint.Plugin because RuleDefinition currently requires a parameter, but it should be optional. I need to update that in @eslint/core first.

@nzakas nzakas requested a review from a team as a code owner November 22, 2024 17:01
@eslint-github-bot eslint-github-bot bot added the bug ESLint is working incorrectly label Nov 22, 2024
Copy link

netlify bot commented Nov 22, 2024

Deploy Preview for docs-eslint ready!

Name Link
🔨 Latest commit 5f83c38
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/6751ff47b48c4c00088391ce
😎 Deploy Preview https://deploy-preview-19157--docs-eslint.netlify.app
📱 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.

lib/types/index.d.ts Outdated Show resolved Hide resolved
lib/types/index.d.ts Outdated Show resolved Hide resolved
@@ -468,7 +468,7 @@ rule = {
context.markVariableAsUsed("foo");

context.report({ message: "foo", node: AST });
context.report({ message: "foo", loc: { line: 0, column: 0 } });
context.report({ message: "foo", loc: { start: {line: 0, column: 0}, end: { line: 1, column: 1 } } });
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 appeared to be an error in the current types, as loc should have start and end properties.

@nzakas nzakas marked this pull request as draft November 22, 2024 20:38
Copy link

github-actions bot commented Dec 2, 2024

Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.

@github-actions github-actions bot added the Stale label Dec 2, 2024
@fasttime
Copy link
Member

fasttime commented Dec 3, 2024

Not stale. We need to update @eslint/core to the last pending release.

@fasttime fasttime removed the Stale label Dec 3, 2024
@fasttime fasttime mentioned this pull request Dec 5, 2024
1 task
@nzakas
Copy link
Member Author

nzakas commented Dec 5, 2024

I think we need one more change to full update the types in the eslint package:
eslint/rewrite#138

Copy link

Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.

@github-actions github-actions bot added the Stale label Dec 15, 2024
@fasttime fasttime removed the Stale label Dec 15, 2024
@nzakas
Copy link
Member Author

nzakas commented Dec 16, 2024

Note stale - waiting on @eslint/core updates.

Copy link

Hi everyone, it looks like we lost track of this pull request. Please review and see what the next steps are. This pull request will auto-close in 7 days without an update.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug ESLint is working incorrectly
Projects
Status: Implementing
Development

Successfully merging this pull request may close these issues.

2 participants