当前位置:网站首页>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
边栏推荐
- selenium 浏览器(1)
- Using registered classes to realize specific type matching function template
- [技術發展-24]:現有物聯網通信技術特點
- Dynamic programming 01 knapsack and complete knapsack
- Multi person collaborative data annotation based on Baidu brain easydata from scratch
- 可编程逻辑器件软件测试
- Metal organic framework MOFs loaded with non steroidal anti-inflammatory drugs | zif-8 wrapped Prussian blue loaded quercetin (preparation method)
- 金属有机骨架MIL-88负载阿霉素DOX|叶酸修饰UiO-66-NH2负载阿霉素[email protected]纳米粒子
- 【BW16 应用篇】安信可BW16模组与开发板更新固件烧录说明
- Example analysis of QT learning 18 login dialog box
猜你喜欢
JVM runtime data area
NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon
又一个行业被中国芯片打破空白,难怪美国模拟芯片龙头降价抛售了
Flutter dynamic | fair 2.5.0 new version features
Go language web development series 25: Gin framework: using MD5 to verify the signature for the interface station
QT learning 21 standard dialog box in QT (Part 2)
JVM系列——概述,程序计数器day1-1
Failure of vector insertion element iterator in STL
可编程逻辑器件软件测试
金属有机骨架MOFs装载非甾体类抗炎药物|ZIF-8包裹普鲁士蓝负载槲皮素(制备方法)
随机推荐
JVM object lifecycle
全局事件总线
Qt学习20 Qt 中的标准对话框(中)
Uniapp skills - scrolling components -1
[développement technologique - 24]: caractéristiques des technologies de communication Internet des objets existantes
Stack application (balancer)
page owner特性浅析
NFT新的契机,多媒体NFT聚合平台OKALEIDO即将上线
Cross linked cyclodextrin metal organic framework loaded methotrexate slow-release particles | metal organic porous material uio-66 loaded with flavonoid glycosides | Qiyue
Golang — 命令行工具cobra
Mysql:insert date:SQL 错误 [1292] [22001]: Data truncation: Incorrect date value:
selenium 浏览器(1)
Windos creates Cordova prompt because running scripts is prohibited on this system
“又土又穷”的草根高校,凭什么被称为“东北小清华”?
Go language web development series 27: Gin framework: using gin swagger to implement interface documents
Go 1.16.4: purpose of go mod tidy
树的深入和广度优先遍历(不考虑二叉树)
[combinatorics] permutation and combination (examples of combinatorial number of multiple sets | three counting models | selection problem | combinatorial problem of multiple sets | nonnegative intege
全面发展数字经济主航道 和数集团积极推动UTONMOS数藏市场
Golang — template