scss-lint icon indicating copy to clipboard operation
scss-lint copied to clipboard

LengthVariable allow 0?

Open thejamespower opened this issue 9 years ago • 2 comments

I'd like to ignore zero values from the LengthVariable linter.

This is my config:

  LengthVariable:
    enabled: true
    allowed_lengths: [0]

But I still get this:

Length literals like 0 should only be used in variable declarations;...

How can I get the effect I require?

thejamespower avatar Feb 01 '17 10:02 thejamespower

It looks like this might be a limitation in how LengthVariable works. We'd be happy to look at a PR fixing this!

trotzig avatar Mar 13 '17 14:03 trotzig

Easy fix for this would be allowed_lengths: ["0"]

When you put smth like allowed_lengths: [0, 20px], config['allowed_lengths'] outputs [0, "20px"]. I have no idea how to fix it in code though.

karezhest avatar Jul 15 '17 15:07 karezhest