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: update types for no-restricted-imports rule #19060

Merged
merged 6 commits into from
Nov 14, 2024

Conversation

snitin315
Copy link
Contributor

Prerequisites checklist

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

[x] Documentation update
[x] 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)

Update types for the no-restricted-imports rule.

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

NA

@snitin315 snitin315 requested a review from a team as a code owner October 27, 2024 03:52
@eslint-github-bot eslint-github-bot bot added the bug ESLint is working incorrectly label Oct 27, 2024
Copy link

netlify bot commented Oct 27, 2024

Deploy Preview for docs-eslint ready!

Name Link
🔨 Latest commit 3f1bb77
🔍 Latest deploy log https://app.netlify.com/sites/docs-eslint/deploys/67298c62c673060008612f55
😎 Deploy Preview https://deploy-preview-19060--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.

Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Looks pretty close to complete to! I verified the types match what's on https://eslint.org/docs/latest/rules/no-restricted-imports.

The only blocker is that there's an inconsistency in the types: the pattern options properly set up ?: never with exactOptionalPropertyTypes, but the path options reduce down to ?: undefined.

Left a couple of stylistic suggestions for the TypeScript syntax too.

lib/types/rules/ecmascript-6.d.ts Outdated Show resolved Hide resolved
lib/types/rules/ecmascript-6.d.ts Show resolved Hide resolved
lib/types/rules/ecmascript-6.d.ts Outdated Show resolved Hide resolved
@snitin315
Copy link
Contributor Author

@JoshuaKGoldberg Thanks for the feedback, I've resolved your comments. PTAL

@snitin315 snitin315 added accepted There is consensus among the team that this change meets the criteria for inclusion types Related to TypeScript types labels Oct 31, 2024
JoshuaKGoldberg
JoshuaKGoldberg previously approved these changes Nov 1, 2024
Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Looks great, yay!

Just one suggestion on exports, I trust whatever you do here 🙂

lib/types/rules/ecmascript-6.d.ts Outdated Show resolved Hide resolved
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. Would like another approval before merging.

Copy link
Member

@aladdin-add aladdin-add 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!

Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

🔥

@snitin315 snitin315 merged commit fd33f13 into main Nov 14, 2024
26 checks passed
@snitin315 snitin315 deleted the fix/update-no-restricted-imports-types branch November 14, 2024 15:00
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 bug ESLint is working incorrectly types Related to TypeScript types
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

4 participants