Closed dwightjack closed 3 years ago
please try explicitly setting the sass-lint.yml in the settings
Ok seems to work. Now it seems the linter gets triggered when ever I type and not just on save.
For example when i type: font-size:
I got the following error:
Error: Parsing error at frontend/assets/scss/objects/_ico.scss: Please check validity of the block starting from line #47
at module.exports (C:\nodist\bin\node_modules\sass-lint\lib\groot.js:21:11)
at Function.sassLint.lintText (C:\nodist\bin\node_modules\sass-lint\index.js:36:13)
at C:\nodist\bin\node_modules\sass-lint\index.js:91:21
at Array.forEach (native)
at Function.sassLint.lintFiles (C:\nodist\bin\node_modules\sass-lint\index.js:90:9)
at detectPattern (C:\nodist\bin\node_modules\sass-lint\bin\sass-lint.js:15:18)
at C:\nodist\bin\node_modules\sass-lint\bin\sass-lint.js:86:5
at Array.forEach (native)
at Object. (C:\nodist\bin\node_modules\sass-lint\bin\sass-lint.js:85:16)
at Module._compile (module.js:435:26)
I researched a bit, The first issue is due to a bug in sass-lint, when not specifying a config file, they try to look up package.json, if you don't have one an exception is thrown. So, you need to specify a config file, or have a package.json file and have a .sass-lint.yml file.
Hi,
I have both the package.json file (without any reference to sass-lint though) and a .sass-lint.yml file.
Anyway with the latest plugin update I don't experience the first problem anymore. I still get the parsing error before hitting save.
I wonder if those file in groot.js is something related to sass-lint (see https://github.com/sasstools/sass-lint/issues/456). If so, maybe it'd be an option to suppress the parsing error until they update the AST.
Would you mind posting a sample of the code that this is failing on @dwightjack ? I haven't used this plugin yet but if it's linting as you type it will often throw parse errors on incomplete code, once the block is complete though it should lint fine. There's an update for sass-lint coming hopefully today that will report these parse errors specifically as lint errors so it shouldn't be as frustrating as the unhandled errors are at the moment.
If the code is complete and you're still encountering a parse error then unfortunately there's still a few cases where you will see this with the AST we use in its current state. Specifically most types of interpolation or even files using hard tabs. Hopefully these will be sorted soon.
It would be helpful if you could post these types of issues on the sass-lint repo itself so we can better keep track of them! Thanks!
Hi with material UI theme i'm getting the following error:
If you need any further detail, just ping me :)