postcss-import icon indicating copy to clipboard operation
postcss-import copied to clipboard

Add option to disable the warning for empty css files

Open jitendravyas opened this issue 10 years ago • 14 comments

I have my own common project folder with lots of small css files. I have no problem if some partials are emply. I might add css to them later. Is there a way to disable the warning?

jitendravyas avatar Sep 20 '15 17:09 jitendravyas

Add a css comment in them ?

MoOx avatar Sep 20 '15 17:09 MoOx

if there is no option in plugin then I will comment empty file and to that I will have to check first which file is empty and which not.

jitendravyas avatar Sep 20 '15 17:09 jitendravyas

I mean you can add a comment in the empty file, not commenting the import usage.

MoOx avatar Sep 20 '15 17:09 MoOx

Yes. That can be done too. Thanks.

Also I would suggestion that in error message instead showing the whole path from root, can be done in shorter way.

file1.css file2.css file3.css file4.css file5.css file6.css is empty

Later I would prefer if this plugin can have an option to disable this warning.

jitendravyas avatar Sep 20 '15 17:09 jitendravyas

PR are always welcome :)

MoOx avatar Sep 20 '15 17:09 MoOx

I'm not good in Javascript, but I will try to learn it and send.

Jitendra Vyas Twitter http://twitter.com/jitendravyas | Linkedin http://www.linkedin.com/in/jitendravyas

On Sun, Sep 20, 2015 at 11:18 PM, Maxime Thirouin [email protected] wrote:

PR are always welcome :)

— Reply to this email directly or view it on GitHub https://github.com/postcss/postcss-import/issues/84#issuecomment-141814726 .

jitendravyas avatar Sep 20 '15 17:09 jitendravyas

@MoOx Why did you add warning on empty?

TrySound avatar Jan 09 '16 20:01 TrySound

Because this might be an user "error".

MoOx avatar Jan 10 '16 21:01 MoOx

Usually it's just because user didn't add content yet. And I don't think this feature is useful.

TrySound avatar Jan 10 '16 21:01 TrySound

I already have people asking me why "it doesn't work" and where editing the wrong file. It doesn't cost anything right? It just a warning, not an error.

MoOx avatar Jan 27 '16 11:01 MoOx

Let's keep it open for a time.

TrySound avatar Jan 27 '16 11:01 TrySound

PR welcome to add an option for this. We might change default behavior sometime, not now.

RyanZim avatar Nov 03 '16 20:11 RyanZim

I wish there were an option flag like warnOnEmpty that defaults to true but could be changed with

require('postcss-easy-import')({ prefix : 'true', warnOnEmpty: 'false' }),

maxfenton avatar Jan 14 '22 15:01 maxfenton

😐

babakfp avatar Jun 21 '22 20:06 babakfp

Thank you for adding this option.

maxfenton avatar Aug 01 '23 17:08 maxfenton