Help us understand the problem. What is going on with this article?

stylelint "at-rule-no-unknown" ルールでエラー

Sassファイルの整形(Lint)をしてくれるツールはいろいろありますが、中でもstylelintがいい感じなので好んで使っています。

"at-rule-no-unknown" でエラー発生

ところが、"at-rule-no-unknown"すなわち「標準的でない@-規則」というルールにおいて、これを適用させたくなかったのでfalseを設定したところ、Invalid Option: Unexpected option value "false" for rule "at-rule-no-unknown"と怒られてしまいました。

stylelintrc.json
"rules": {
  "at-rule-no-unknown": false,
}

上記の書き方だとエラーになります。falsenullにしてもダメです。
次のようにoptionをtrueにした上で、例外ルールを記述するように書き直すとエラーが出なくなりました。

stylelintrc.json
"rules": {
  "at-rule-no-unknown": [true,
    {"ignoreAtRules": ["include","mixin","each"]}],
}

これはstylelintの"at-rule-no-unknown"ルールのoptionにtrueしかないのが原因でした。trueがあるならfalseもあるじゃん!という思い込みが罠でした。これはなかなかの初見殺し…

Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away