willhoney7 / eslint-plugin-import-helpers

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

Relative import mistaken as modules #31

Closed hyoretsu closed 4 years ago

hyoretsu commented 4 years ago

If you use relative modules with baseUrl config in tsconfig.json, they're now treated as modules, just like import React from 'react'. (It's either that or import asd from ../../../../components) Don't know if there's a way to fix that but I'll just add '/^components/'

willhoney7 commented 4 years ago

Hi!

This is working as designed (for now). The plugin doesn't do any reading/analyzing of the tsconfig.json.

You're correct, if you want to treat them differently, add a regexp group. Since it's just a one-time configuration thing, I don't think it's worth introducing more complexity when the regexp suffices. Open for discussion...