sass-Atom 中的 lint 抛出 'Unexpected Parse Error'

sass-lint in Atom throws 'Unexpected Parse Error'

我有几个简单的 .scss (SAAS) 文件,每个文件都出现 sass-lint 错误。

Unexpected Parse Error

据我所知,我拥有最新的 Atom sass-lint 插件。它似乎没有影响任何事情,而且更令人烦恼,但是我也很想知道我是否做错了什么。

产生错误的示例代码:

$primaryFont: 'Lora';
$secondaryFont: 'Roboto';
$primaryHeader: 'Montserrat';

别担心,这不是你,是 sass-lint!

这是因为您使用空格缩进,sass-lint 的依赖项之一中有一个 bug,导致当您使用制表符而不是缩进时记录 Unexpected parse error in file空间。看起来他们计划在下一个版本中解决它,届时 Atom 插件的维护者将需要更新 Atom 包的依赖项并发布新版本。

我通过查看描述您遇到的确切问题的 package.json for sass-lint and specifically at the dependencies on line 21, there is a direct dependency upon the sass-lint NPM package. From there you can go back to the GitHub Repository which has all of the issues including #560 解决了这个问题。

我创建了 GitHub Issue on the sass-lint Atom Package for this, it is externally blocked by Issue #62 on sasstools/sass-lint,即 NPM 包,几天前 Dan Purdy 更新了它,他说:

We're at a bit of a crossroads at the moment, while running through our tests on all platforms we've found the latest version of the AST fixes a lot of our issues but also breaks a few things. Specifically Sass format on windows mainly. There's also some pretty annoying windows bugs left over so we're currently debating and looking into what our best course of action is. I hope to have 1.6 out soon though... I just can't say when.

您随时可以在此处 online YAML lint tool

尝试验证您的 .sass-lint.yml