kungfusheep / SublimeLinter-contrib-stylelint

this repo is no longer maintained - please see https://github.com/SublimeLinter/SublimeLinter-stylelint
MIT License
116 stars 19 forks source link

Error: Unexpected "space" found. #30

Closed chrisblossom closed 5 years ago

chrisblossom commented 8 years ago

Does anyone know what I am doing wrong here? Below is the sublimelinter debug output.

SublimeLinter: stylelint: summary.scss ['/Users/chase/n/bin/node', '/Users/chase/Library/Application Support/Sublime Text 3/Packages/SublimeLinter-contrib-stylelint/stylelint_wrapper.js', '@', '--config', '/Users/chase/app/.stylelintrc'] 
SublimeLinter: stylelint output:
Error: Unexpected "space" found.
    at new error (/Users/chase/app/node_modules/postcss-selector-parser/dist/processor.js:27:23)
    at Parser.error (/Users/chase/app/node_modules/postcss-selector-parser/dist/parser.js:212:15)
    at Parser.pseudo (/Users/chase/app/node_modules/postcss-selector-parser/dist/parser.js:320:18)
    at Parser.parse (/Users/chase/app/node_modules/postcss-selector-parser/dist/parser.js:502:22)
    at Parser.loop (/Users/chase/app/node_modules/postcss-selector-parser/dist/parser.js:470:18)
    at new Parser (/Users/chase/app/node_modules/postcss-selector-parser/dist/parser.js:89:21)
    at Processor.process (/Users/chase/app/node_modules/postcss-selector-parser/dist/processor.js:24:21)
    at /Users/chase/app/node_modules/stylelint/dist/rules/selector-no-vendor-prefix/index.js:36:10
    at /Users/chase/app/node_modules/postcss/lib/container.js:118:28
    at /Users/chase/app/node_modules/postcss/lib/container.js:81:26 

Thank you!

Arkkimaagi commented 8 years ago

To me it looks like a stylelint issue, check this: https://github.com/stylelint/stylelint/issues/1153

Remember that you can check what stylelint says by running it manually when you see something odd in sublime stylelint. It helps a bit.

When stylelint handles that error situation better, I'd assume this repository can also be fixed to handle it a bit better.

chrisblossom commented 8 years ago

@Arkkimaagi Thanks for the response. Actually running it via CLI was the first thing I tried and it works as expected.

Here is my css linting command: stylelint --syntax scss 'src/**/*.scss'

I suspect the issue is this plugin not specifying --syntax scss and parsing the files as plain css. https://github.com/stylelint/stylelint/blob/master/docs/user-guide/css-processors.md#parsing-non-standard-syntax

Any suggestions on how to add --syntax scss to further test?

Arkkimaagi commented 8 years ago

I have no perfect solution, but you can try my hack if you're feeling adventurous. https://github.com/kungfusheep/SublimeLinter-contrib-stylelint/issues/29

Arkkimaagi commented 8 years ago

Even tho I talk only about LESS support in it, I tried to code it to support scss and sss file formats too.

chrisblossom commented 8 years ago

That solved the issue. Thanks for your help. Hopefully an iteration of your self-called "hack" gets implemented.

Since this issue isn't solved I am going to keep it open.