Created
September 25, 2021 10:35
-
-
Save nirtamir2/64933d0460df2085b9ac3b89e9ee85f0 to your computer and use it in GitHub Desktop.
Revisions
-
nirtamir2 created this gist
Sep 25, 2021 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,55 @@ # Stylelint ```bash yarn add -D stylelint stylelint-config-standart stylelint-config-prettier ``` ## Order If you want order ```bash yarn add -D stylelint-order ``` And choose one of the scripts: ```bash yarn add -D stylelint-config-rational-order yarn add -D stylelint-config-idiomatic-order yarn add -D stylelint-config-rational-order ``` ## Configuration Create `.stylelintrc.json` that includes: ```js module.exports = { extends: [ "stylelint-config-standard", // Order (choose one) // "stylelint-config-recess-order", // "stylelint-config-idiomatic-order", // "stylelint-config-rational-order", "stylelint-config-prettier", ], }; ``` ## Scripts Edit `package.json`: ```json { "scripts": { "lint": "eslint . --ext ts --ext tsx --ext js && stylelint --fix **/*.css" }, "lint-staged": { "*.@(ts|tsx|js)": ["yarn lint", "prettier --write"], "*..@(json|md)": "prettier --write", "*.css": ["stylelint --fix", "prettier --write"] } } ```