Eslint-plugin-import: Add option to `no-unassigned-import` for allowed glob

Created on 18 Nov 2016  路  3Comments  路  Source: benmosher/eslint-plugin-import

When using the style and css webpack loaders, sometimes I want to be able to import a CSS file which will result in injecting the styles in the DOM (a side-effect) but this is acceptable in some use cases (I realize there are CSS modules, but importing things like bootstrap etc.)

So I suggest:

"import/no-unassigned-import": [2, {
  "allowed": ["*.css"]
}]

Thoughts?

enhancement evaluating

Most helpful comment

I'd be happy to. I'll see when I can find the time. I'll add a comment in here when I've started working on it... Anyone else can feel free before me though :)

All 3 comments

Sounds good to me :+1:.

Do you feel like adding this by any chance?

I'd be happy to. I'll see when I can find the time. I'll add a comment in here when I've started working on it... Anyone else can feel free before me though :)

That'd be awesome! I'm pretty sure similar work has been made in no-extraneous-dependencies (at least regarding globs) FYI.

Was this page helpful?
0 / 5 - 0 ratings