当前位置:网站首页>Configure stylelint
Configure stylelint
2022-07-03 14:02:00 【pzy_ six hundred and sixty-six】
List of articles
Installation dependency
npm install -D stylelint stylelint-config-standard stylelint-config-rational-order stylelint-prettier stylelint-config-prettier postcss-less postcss-scss postcss-html stylelint-config-recommended-vue
New configuration file
.stylelintrc.js
module.exports = {
extends: ['stylelint-config-standard', 'stylelint-config-rational-order', 'stylelint-prettier/recommended','stylelint-config-recommended-vue'],
"plugins": [
"stylelint-order"
],
"overrides":[
{
"files": ["**/*.html"],
"customSyntax": "postcss-html",
},
{
"files": ["**/*.scss"],
"customSyntax": "postcss-scss",
},
{
"files": ["**/*.less"],
"customSyntax": "postcss-less",
}
],
"rules": {
// Color specifies lowercase ( Avoid and prettier Configuration conflict )
"color-hex-case": "lower",
// Empty blocks are prohibited
'block-no-empty': true,
// Color 6 Bit length
"color-hex-length": "long",
// Compatible with custom tag names
"selector-type-no-unknown": [true, {
"ignoreTypes": []
}],
// Ignore pseudo class selectors ::v-deep
"selector-pseudo-element-no-unknown": [true, {
"ignorePseudoElements": ["v-deep"]
}],
// Prevent low priority selectors from appearing after high priority selectors .
"no-descending-specificity": null,
// Don't verify @ Unknown name , For compatibility scss Function of
"at-rule-no-unknown": null,
// No empty comments
"comment-no-empty": true,
// It is forbidden to abbreviate redundant values of attributes
"shorthand-property-no-redundant-values": true,
// The browser engine prefix of the forbidden value
"value-no-vendor-prefix": true,
// property-no-vendor-prefix
"property-no-vendor-prefix": true,
// Prohibit less than 1 The decimal of has a leading zero ( Avoid and prettier Conflict )
"number-leading-zero": "always",
// Don't leave the first line blank
"no-empty-first-line": true,
}
}
package.json Join in stylelint Related configuration
{
"scripts": {
"stylelint-fix": "stylelint \"src/**/*.(vue|scss|css,less)\" --fix",
},
// If not used husky and lint-staged, Then these two configurations can be omitted
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
},
"lint-staged": {
"src/**/*.{less,scss,vue}": [
"stylelint --fix"
]
}
webstorm To configure stylelint

Ignore stylelint Yes css The test of
- Ignore the entire file , Add... On the first line
/* stylelint-disable */
/* stylelint-disable */
html {
}
- Ignore multiple lines
/* stylelint-disable */
html {
}
.div {
color: red;
}
/* stylelint-enable */
- Ignore a line , Add
/* stylelint-disable-next-line */To ignore the line
#id {
/* stylelint-disable-next-line */
color: pink !important;
}
- stay .stylelintrc.js Set the file to be ignored in
{
ignoreFiles: ["dist/**/*", "src/assets/scss/abc.scss"]
}
Reference resources
stylelint-config-recommended-vue
stylelint Configuration and use , Auto repair css, Writing order
边栏推荐
- JS general form submission 1-onsubmit
- Rasp implementation of PHP
- [understanding by chance-37]: the structure of human sensory system determines that human beings are self-centered
- Unity render streaming communicates with unity through JS
- QT learning 21 standard dialog box in QT (Part 2)
- 使用vscode查看Hex或UTF-8编码
- RocksDB LRUCache
- Bidirectional linked list (we only need to pay attention to insert and delete functions)
- 金属有机骨架MIL-88负载阿霉素DOX|叶酸修饰UiO-66-NH2负载阿霉素[email protected]纳米粒子
- Field problems in MySQL
猜你喜欢

Go language web development series 28: solve cross domain access of CORS with gin contrib / CORS

Multi person collaborative data annotation based on Baidu brain easydata from scratch

jvm-类加载

MySQL 数据处理值增删改

UiO-66-COOH装载苯达莫司汀|羟基磷灰石( HA) 包裹MIL-53(Fe)纳米粒子|装载黄芩苷锰基金属有机骨架材料
[email protected]纳米粒子"/>金属有机骨架MIL-88负载阿霉素DOX|叶酸修饰UiO-66-NH2负载阿霉素[email protected]纳米粒子

Implementation of Muduo accept connection, disconnection and sending data

Go language unit test 4: go language uses gomonkey to test functions or methods

小项目(servelt+jsp+mysql+EL+JSTL)完成一个登录功能的Servlet,具有增删改查的操作。实现登录身份验证,防止非法登录,防止多点登录,记住用户名密码功能。

Go language web development series 25: Gin framework: using MD5 to verify the signature for the interface station
随机推荐
Mysql:insert date:SQL 错误 [1292] [22001]: Data truncation: Incorrect date value:
GoLand 2021.2 configure go (go1.17.6)
jvm-运行时数据区
JVM object lifecycle
[développement technologique - 24]: caractéristiques des technologies de communication Internet des objets existantes
QT learning 20 standard dialog box in QT (middle)
Common network state detection and analysis tools
又一个行业被中国芯片打破空白,难怪美国模拟芯片龙头降价抛售了
Dlopen() implements dynamic loading of third-party libraries
Qt学习20 Qt 中的标准对话框(中)
NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon
Mastering the cypress command line options is the basis for truly mastering cypress
Richview trvstyle liststyle list style (bullet number)
Another industry has been broken by Chinese chips. No wonder the leading analog chip companies in the United States have cut prices and sold off
小项目(servelt+jsp+mysql+EL+JSTL)完成一个登录功能的Servlet,具有增删改查的操作。实现登录身份验证,防止非法登录,防止多点登录,记住用户名密码功能。
3D vision - 2 Introduction to pose estimation - openpose includes installation, compilation and use (single frame, real-time video)
Bidirectional linked list (we only need to pay attention to insert and delete functions)
解决MySql 1045 Access denied for user ‘root‘@‘localhost‘ (using password: YES)
金属有机骨架(MOFs)抗肿瘤药载体|PCN-223装载甲硝唑|UiO-66包载盐酸环丙沙星([email protected])
Uniapp tips - scrolling components