0

I've configured stylelint to read SCSS and I keep getting browser hack warnings on SCSS items like $variables and !default. I loaded in the stylelint-scss plugin thinking this might fix it but it hasn't. I want the browser hacks rule to be enabled for true browser hacks but I'll have to turn this off if it fails on all of the SCSS items.

Does anyone know how I can keep the browser hack rule enabled but not have it fail on non-browser hacks like the standard variables for SCSS?

4

1 回答 1

1

no-browser-hacks 规则与 SCSS 语法不兼容。这记录在规则的 README中。

我可以想到三个可供您选择的选项:

  1. 继续使用 SCSS 并关闭 no-browser-hacks 规则。
  2. 继续使用 SCSS 并将 SCSS 兼容性贡献给stylehacks(支持规则的底层库)。库的作者很高兴接受一个拉取请求。
  3. 停止使用 SCSS,转而使用标准 CSS 语法和结构。

添加 stylelint-scss 插件不会解决问题,因为它提供了特定于 SCSS 语法和结构的附加规则。它不会改变 stylelint 的核心规则。

于 2016-10-29T12:16:03.300 回答