我有几个简单的 .scss
(SAAS) 文件,每个文件都出现了 sass-lint
错误。
Unexpected Parse Error
据我所知,我拥有最新的 sass-lint Atom 的插件。它似乎没有影响任何事情,更让人烦恼,但我也很想知道我是否做错了什么。
产生错误的示例代码:
$primaryFont: 'Lora';
$secondaryFont: 'Roboto';
$primaryHeader: 'Montserrat';
最佳答案
别担心,这不是你的问题,而是 sass-lint!
因为你是用空格缩进,所以有一个bug在 sass-lint 的一个依赖项中,当您使用制表符而不是空格缩进时,会导致 Unexpected parse error in file
被记录。看起来他们计划在下一个版本中解决这个问题,届时 Atom 插件的维护者将需要更新 Atom 包的依赖项并发布新版本。
我通过查看 package.json
了解了这一点对于 sass-lint特别是在第 21 行
的依赖项中,直接依赖于 sass-lint
NPM 包。从那里你可以回到 GitHub Repository其中包含所有问题,包括 #560其中描述了您遇到的确切问题。
我创建了 GitHub Issue on the sass-lint Atom Package为此,它在外部被 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.
关于Atom 中的 sass-lint 抛出 'Unexpected Parse Error',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36560486/