Skip to content

Commit

Permalink
chore(lint): enable 'typescript-eslint/prefer-find' (#11259)
Browse files Browse the repository at this point in the history
Enables the `@typescript-eslint/prefer-find` rule and addresses any
errors that resulted.
  • Loading branch information
Josh-Walker-GM committed Aug 15, 2024
1 parent 8180327 commit 6865ecf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,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
}

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

0 comments on commit 6865ecf

Please sign in to comment.