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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,6 @@ module.exports = {
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/no-duplicate-type-constituents': 'off',
'@typescript-eslint/unbound-method': 'off',
'@typescript-eslint/prefer-find': 'off',
},
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,12 @@ export default function (
importStatementPath(p.node.source?.value),
)

const defaultSpecifier = p.node.specifiers.filter((specifiers) =>
const defaultSpecifier = p.node.specifiers.find((specifiers) =>
t.isImportDefaultSpecifier(specifiers),
)[0]
)
if (!defaultSpecifier) {
return
}
Comment on lines +80 to +85
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.


// Remove Page imports in prerender mode (see babel-preset)
// The removed imports will be replaced further down in this file
Expand Down
Loading