Skip to content

Instantly share code, notes, and snippets.

@harapeko
Last active June 26, 2018 08:55
Show Gist options
  • Save harapeko/8e6b22ed3a02eca4e6c6f38ef88d874b to your computer and use it in GitHub Desktop.
Save harapeko/8e6b22ed3a02eca4e6c6f38ef88d874b to your computer and use it in GitHub Desktop.
suitcss用stylelint設定(sass記法)。cssクラス名(stylelint-selector-bem-pattern)+細かいルール(stylelint-config-suitcss)のlint
# エントリ系、設定系、プラグイン系などのcssを追記する
{
"extends": "stylelint-config-suitcss",
"plugins": ["stylelint-selector-bem-pattern"],
"rules": {
# sass記法のコメントで発生するTypeError回避(20180626)
"indentation": null,
"declaration-block-trailing-semicolon": null,
"max-line-length": [ 120, {
ignore: "non-comments",
} ],
"rule-empty-line-before": [ "always-multi-line", {
ignore: ["after-comment"],
} ],
"order/properties-alphabetical-order": null,
"number-leading-zero": "never",
"block-opening-brace-space-before": null,
"block-closing-brace-newline-before": null,
"comment-empty-line-before": null,
"plugin/selector-bem-pattern": {
"implicitComponents": true,
"componentName": "[A-Z]+",
"componentSelectors": {
"initial": "^\\.{componentName}(?:-[a-z]+)?$",
"combined": "^\\.combined-{componentName}-[a-z]+$"
},
"utilitySelectors": "^\\.util-[a-z]+$"
},
}
}
{
"scripts": {
"lint": "stylelint resources/assets/sass/*.sass --syntax sass"
},
"devDependencies": {
"stylelint": "^9.3.0",
"stylelint-config-suitcss": "^14.0.0",
"stylelint-selector-bem-pattern": "^2.0.0"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment