@wuxh/stylelint-config-basic

0.0.3 • Public • Published

@wuxh/stylelint-config-basic

个性化 stylelint-config

usage

npm i stylelint @wuxh/stylelint-config-basic -D

.stylelintrc

{
  "extends": "@wuxh/stylelint-config-basic"
}

Add script for package.json

{
  "scripts": {
    "lint": "stylelint \"**/*.css\""
  }
}

Add VSCode setting

VSCode Extensions stylelint

{
  "editor.codeActionsOnSave": {
    "source.fixAll.stylelint": true
  },
  "stylelint.validate": ["css"]
}

lint Less

npm i postcss-less -D

package.json

{
  "scripts": {
-    "lint": "stylelint \"**/*.css\""
+    "lint": "stylelint \"**/*.{css,less}\""
  }
}

.vscode/setting.json

{
- "stylelint.validate": ["css"]
+ "stylelint.validate": ["css", "less"]
}

lint Scss

npm i postcss-scss -D

package.json

{
  "scripts": {
-    "lint": "stylelint \"**/*.css\""
+    "lint": "stylelint \"**/*.{css,scss}\""
  }
}

.vscode/setting.json

{
- "stylelint.validate": ["css"]
+ "stylelint.validate": ["css", "scss"]
}

lint Stylus

npm i postcss-styl stylelint-plugin-stylus -D

package.json

{
  "scripts": {
-    "lint": "stylelint \"**/*.css\""
+    "lint": "stylelint \"**/*.{css,styl,stylus}\""
  }
}

.vscode/setting.json

{
- "stylelint.validate": ["stylus"]
+ "stylelint.customSyntax": "stylelint-plugin-stylus/custom-syntax",
+ "stylelint.validate": ["css", "stylus"]
}

Readme

Keywords

Package Sidebar

Install

npm i @wuxh/stylelint-config-basic

Weekly Downloads

1

Version

0.0.3

License

MIT

Unpacked Size

4.31 kB

Total Files

4

Last publish

Collaborators

  • wxh16144