AtomLinter / linter-sass-lint

A plugin for the Atom linter to interface with sass-lint - the all node scss/Sass linter
https://atom.io/packages/linter-sass-lint
MIT License
23 stars 9 forks source link

Crash when using quotes with the url() function #186

Closed lemnis closed 7 years ago

lemnis commented 7 years ago

Also tested VS code v1.16.1 with Sass lint 0.0.4, and that worked as expected.

The window crashes when I try to add quotes to the url() function, I am trying to type:

//sass-lint:disable-all

foo {
  bar: url("");
}

I didn't add my .sass-lint.yml, because it looks like the bug doesn't dependent on that.

DanPurdy commented 7 years ago

Hi there, unfortunately this is a parser error in the gonzales-pe library. I added an issue https://github.com/tonyganch/gonzales-pe/issues/282 if you'd like to follow along. There's a fix ready to be released I believe that we will push into sass-lint and then this linter plugin as soon as is possible.

The sass-lint disable comments will have no effect unfortunately as they are post the file parsing.

gorriecoe commented 7 years ago

Hey @lemnis, I have a temporary solution. Just add this to your snippets.cson. It seems to parse fine with quotes added.

'.source.scss':
  'url':
    'prefix': 'url'
    'body': 'url(\'${1}\')'
rasulovdev commented 7 years ago

It's not really quotes, but brackets causing the issue. See GIFs here #190

in-in commented 7 years ago

Any workaround for sass syntax? It ruins my Atom so badly even if I copy/paste this background-image: url()

lemnis commented 7 years ago

@in-in A small modification to @gorriecoe proposed workaround would work

'.source.sass':
  'url':
    'prefix': 'url'
    'body': 'url(\${1}\)'

Just make sure to press enter before typing a parenthesis

DanPurdy commented 7 years ago

Hi everyone just an update that the issue is fixed in the AST upstream now, looking to getting it released in the next day or two so you'll be able to drop these workarounds, sorry for that!

DanPurdy commented 7 years ago

This should be fixed now as we've made a fork of the AST and released that with the fixes temporarily to sass-lint which in turn meant i could update this plugin. Please let me know if it's not fixed.