Open
Description
I have following code :
const { addCellToRow } = require("./cell-utils.js");
const { setCellValue, findCell, createCell } = require("./cell-utils.js");
Both require are using the same path, and should thus be grouped.
I've tried to enable this in my .eslintrc :
"import/no-duplicates": ["error", {"prefer-inline": true}],
But it didn't have any effect.
Are there any rules that can catch this ?
Activity
ljharb commentedon Nov 18, 2023
Try adding
commonjs: true
?edi9999 commentedon Nov 18, 2023
Do you mean, in my .eslintrc,
I've tried just that and it didn't change anything.
edi9999 commentedon Nov 18, 2023
Still the same issue
edi9999 commentedon Nov 18, 2023
I've also tried :
"import/no-unresolved": [2, {commonjs: true, amd: true}],
,and also :
But both didn't work.
ljharb commentedon Nov 18, 2023
The latter is what I meant; if that doesn't work, then it seems like a good enhancement PR to make to the rule.
edi9999 commentedon Nov 22, 2023
I confirm that it doesn't work with the latter either.
edi9999 commentedon Nov 22, 2023
I'm sorry I won't have much time to work on this issue.
soryy708 commentedon Sep 3, 2024
Doesn't that overlap with ESLint's existing no-duplicate-imports rule?
ljharb commentedon Sep 3, 2024
Yes, by design - that rule can't take advantage of custom resolvers.