import-js/eslint-plugin-import

Disallow duplicate require

Open

#2 925 ouverte le 18 nov. 2023

Voir sur GitHub
 (9 commentaires) (1 réaction) (0 assignés)JavaScript (1 540 forks)batch import
enhancementhelp wanted

Métriques du dépôt

Stars
 (4 946 stars)
Métriques de merge PR
 (Merge moyen 138j 22h) (3 PRs mergées en 30 j)

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 ?

Guide contributeur