- Be sure you run
yarn install
to intall any needed dependency. - Install extension: https://marketplace.visualstudio.com/items?itemName=shinnn.stylelint
- Set
"prettier.stylelintIntegration": true
in general or Workspace settings. - Set
"editor.formatOnSave": true,
in general or Workspace settings.
Last active
November 3, 2022 02:59
-
-
Save sveggiani/8628994e473ca559248917ef01000f6e to your computer and use it in GitHub Desktop.
[Configure Stylelint + Prettier for SASS/SCSS] #javascript #prettier #stylelint #sass #scss #masscode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "svod-fe-website", | |
"version": "0.1.0", | |
"devDependencies": { | |
"prettier": "^1.13.4", | |
"prettier-stylelint": "^0.4.2", | |
"stylelint": "^9.3.0", | |
"stylelint-config-sass-guidelines": "^5.0.0", | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"extends": [ | |
"stylelint-config-sass-guidelines", | |
"./node_modules/prettier-stylelint/config.js" | |
], | |
"rules": { | |
"color-hex-case": "upper", | |
"color-hex-length": "long", | |
"max-nesting-depth": 3, | |
"declaration-block-single-line-max-declarations": 1, | |
"declaration-block-semicolon-newline-after": "always-multi-line", | |
"number-leading-zero": "never", | |
"declaration-property-value-whitelist": { | |
"color": ["/^\\$|initial|inherit|transparent/"] | |
}, | |
"order/order": [ | |
[ | |
{ | |
"type": "at-rule", | |
"name": "include", | |
"hasBlock": false | |
}, | |
"dollar-variables", | |
"custom-properties", | |
{ | |
"type": "at-rule", | |
"name": "extend" | |
}, | |
"declarations", | |
{ | |
"type": "at-rule", | |
"name": "include", | |
"hasBlock": true | |
}, | |
{ | |
"type": "at-rule", | |
"name": "include", | |
"parameter": "breakpoint", | |
"hasBlock": true | |
}, | |
"rules" | |
] | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
my mistake, I commented by looking at the activity part :D