willhoney7 / eslint-plugin-import-helpers

ESLint plugin to help enforce a configurable order for import statements
288 stars 17 forks source link

How to separate modules that are only `import` #46

Closed imrafaelcezar closed 2 years ago

imrafaelcezar commented 2 years ago

How the imports look like:

import Client from '~/structures/Client';
import 'dotenv/config';

How I would like it to be:

import Client from '~/structures/Client';

import 'dotenv/config';

How could I do this?

willhoney7 commented 2 years ago

As the docs mention, bare imports are not ordered because they usually contain side effects and the order matters.

https://github.com/Tibfib/eslint-plugin-import-helpers/blob/master/docs/rules/order-imports.md#:~:text=Unassigned%20imports%20are%20ignored%20(ex%3A%20import%20%27polyfill%27)%2C%20as%20the%20order%20they%20are%20imported%20in%20may%20be%20important.

Someone opened up a PR once to add support for this but it was never finished.

willhoney7 commented 2 years ago

closing since this is a duplicate of https://github.com/Tibfib/eslint-plugin-import-helpers/issues/35