use prettier to resolve no-duplicate-imports eslint error

Viewed 400

eslint has no-duplicate-imports https://eslint.org/docs/rules/no-duplicate-imports which shows error or warning for importing multiple modules from same path duplicate lines.

ie.

import { testModule } from '../file'
import { otherModule } from '../file'

makes you resolve as:

import { testModule, otherModule } from '../file'

How would you accomplish this with an existing prettier plugin, or any other way where onSave it resolves this for you, to avoid having to fix this manually.

0 Answers
Related