Skip to content

Instantly share code, notes, and snippets.

@azu
Last active May 28, 2020 12:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save azu/74ce7275765bbc680e9b9f2a40ed4d73 to your computer and use it in GitHub Desktop.
Save azu/74ce7275765bbc680e9b9f2a40ed4d73 to your computer and use it in GitHub Desktop.
stylelintの設定
module.exports = {
// http://stylelint.io/user-guide/rules/
// https://github.com/stylelint/stylelint-config-standard をベースにする
"extends": "stylelint-config-standard",
"plugins": [
"stylelint-no-z-index",
"stylelint-disallow-selector"
],
"rules": {
// z-indexは直接数値を指定するのではなく、変数を利用するため
"plugin/no-z-index": 2,
// svg4everybodyによって、IE11では`use`は`svg`として展開されるため
"azu/disallow-selector": ["use"],
// 疑似要素の`:`は2個
"selector-pseudo-element-colon-notation": "double",
// 空改行は2個まで
"max-empty-lines": 2,
// セレクタの詳細度を制限 #は2つ、.クラスは2つまでのセレクタにする
"selector-max-specificity": "2,2,0",
// == stylelint-config-standard に入ってるけど無効化 ==
// .5s のような表記は許容する
"number-leading-zero": null,
// コメントの前に改行はいらない
"comment-empty-line-before": null,
"declaration-empty-line-before": null,
// @ の前に改行をいれるかは指定しない
// TODO: stylefmtが@applyの前に改行を入れてしまう
"at-rule-empty-line-before": null,
// #ffffff shortとlongは統一しない
// http://stylelint.io/user-guide/rules/color-hex-length/
"color-hex-length": null,
// 最後を改行するかは不定
"no-missing-end-of-source-newline": null,
// "#007dff" のように小文字で書く
"color-hex-case": "lower"
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment