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

chore(lint): enable 'typescript-eslint/prefer-find' #11259

Merged
merged 2 commits into from
Aug 15, 2024

Conversation

Josh-Walker-GM
Copy link
Collaborator

Enables the @typescript-eslint/prefer-find rule and addresses any errors that resulted.

@Josh-Walker-GM Josh-Walker-GM added release:chore This PR is a chore (means nothing for users) changesets-ok Override the changesets check labels Aug 15, 2024
@Josh-Walker-GM Josh-Walker-GM added this to the chore milestone Aug 15, 2024
@Josh-Walker-GM Josh-Walker-GM self-assigned this Aug 15, 2024
Comment on lines +80 to +85
const defaultSpecifier = p.node.specifiers.find((specifiers) =>
t.isImportDefaultSpecifier(specifiers),
)[0]
)
if (!defaultSpecifier) {
return
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It was always the case previously that it could have been undefined but our TS settings don't complain that hard at us.

If it was often undefined we'd likely have seen errors in user project. I haven't seen any reports like that so this seems totally fine to me to more gracefully handle that.

@Josh-Walker-GM Josh-Walker-GM merged commit 6865ecf into main Aug 15, 2024
46 checks passed
@Josh-Walker-GM Josh-Walker-GM deleted the jgmw/chore-linting-prefer-find branch August 15, 2024 14:40
@Josh-Walker-GM Josh-Walker-GM modified the milestones: chore, v8.0.0 Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changesets-ok Override the changesets check release:chore This PR is a chore (means nothing for users)
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

1 participant