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

标签 sass atom-editor gulp-sass scss-lint

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

Unexpected Parse Error

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

产生错误的示例代码:

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

Screenshot of the error

最佳答案

别担心,这不是你的问题,而是 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/

相关文章:

css - 检索元素样式表中的原色

atom-editor - 如何注释掉 Pact 中的代码块?

atom-editor - Atom 编辑器安装包失败

c++ - PlatformIO (Atom) 的 src 文件夹中是否可以有两个文件?

sass 文件,使用 gulp 组合和分离主题颜色文件

gulp - 错误: File to import not found or unreadable Gulp + Sass

server - 在本地服务器上与团队一起使用 gulp。错误 : EPERM: operation not permitted,

node.js - 在 Windows 中使用 shell 脚本递归合并和编译 SCSS 文件

css - 将变量从 SASS 导出到 vanilla CSS?

html - 我如何在 ul 列表的图像上进行叠加,但仅在图像上而不是在图像的整个部分上进行叠加?