import-js/eslint-plugin-import

Disallow duplicate require

Aperta

#2925 aperta il 18 nov 2023

 (9 commenti) (1 reazione) (0 assegnatari)JavaScript (1548 fork)batch import
enhancementhelp wanted

Metriche repository

Star
 (5940 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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 ?

Guida contributor