Skip to content

chore: remove Rule & FormatterFunction from shared/types.js #19556

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

Merged
merged 5 commits into from
Mar 28, 2025
Merged

Conversation

snitin315
Copy link
Contributor

@snitin315 snitin315 commented Mar 22, 2025

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:

What changes did you make? (Give an overview)

Updated RuleMeta types to support dialects & language properties

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

@snitin315 snitin315 requested a review from a team as a code owner March 22, 2025 13:17
@eslint-github-bot eslint-github-bot bot added the chore This change is not user-facing label Mar 22, 2025
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Mar 22, 2025
Copy link

netlify bot commented Mar 22, 2025

Deploy Preview for docs-eslint canceled.

Name Link
🔨 Latest commit bab77fc
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/67e5d3f8cb6b0000084de892

@nzakas
Copy link
Member

nzakas commented Mar 24, 2025

It looks like this information is duplicated from where types are being pulled now:
https://github.com/eslint/eslint/blob/main/lib/types/index.d.ts

Maybe we should dedupe and use the imported types from @eslint/core?

@nzakas nzakas moved this from Needs Triage to Triaging in Triage Mar 24, 2025
@github-actions github-actions bot added the rule Relates to ESLint's core rules label Mar 24, 2025
@snitin315
Copy link
Contributor Author

Yes, updated.

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.

The type for individual rules is actually Rule.RuleModule from index.d.ts. That contains the JavaScript-specific definition of a rule. RuleDefinition is a generic rule without JS-specific information.

@snitin315
Copy link
Contributor Author

@nzakasThanks! Updated 👍🏻

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.

As a finishing touch, can we remove the Rule type from shares/types.js?

@snitin315 snitin315 added the accepted There is consensus among the team that this change meets the criteria for inclusion label Mar 27, 2025
@github-actions github-actions bot added cli Relates to ESLint's command-line interface core Relates to ESLint's core APIs and features labels Mar 27, 2025
@snitin315
Copy link
Contributor Author

Makes sense, I removed Rule & FormatterFunction in bab77fc

@snitin315 snitin315 changed the title chore: update RuleMeta types chore: remove Rule & FormatterFunction from shared/types.js Mar 27, 2025
@snitin315 snitin315 changed the title chore: remove Rule & FormatterFunction from shared/types.js chore: remove Rule & FormatterFunction from shared/types.js Mar 27, 2025
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. Thanks!

@nzakas nzakas merged commit 46eea6d into main Mar 28, 2025
31 checks passed
@nzakas nzakas deleted the ts/types-meta branch March 28, 2025 14:56
@github-project-automation github-project-automation bot moved this from Triaging to Complete in Triage Mar 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion chore This change is not user-facing cli Relates to ESLint's command-line interface core Relates to ESLint's core APIs and features rule Relates to ESLint's core rules
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

2 participants