JavaScript

JavaScript

Made by DeepSource

Found multiple import of the same path JS-R1000

Style
Minor

It is always recommended to group all imports of a single path or source in a single import declaration. These usually happen in a codebase when multiple developers are working on the same codebase. It helps improving code refactoring and code readability as well.

Bad Practice

// <!-- index.js -->

import calc from './calc.js'
import { add } from './calc.js'

console.log(add(1, 2))

Recommended

// <!-- index.js -->

import calc,  { add }  from './calc.js'

console.log(add(1, 2))