当前位置:网站首页>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
边栏推荐
- Uniapp tips - scrolling components
- Replace the GPU card number when pytorch loads the historical model, map_ Location settings
- 树的深入和广度优先遍历(不考虑二叉树)
- 金属有机骨架MOFs装载非甾体类抗炎药物|ZIF-8包裹普鲁士蓝负载槲皮素(制备方法)
- [技術發展-24]:現有物聯網通信技術特點
- Depth and breadth first traversal of tree (regardless of binary tree)
- 信创产业现状、分析与预测
- 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)
- Go 1.16.4: purpose of go mod tidy
猜你喜欢

QT learning 17 dialog box and its types

Unity embeddedbrowser browser plug-in event communication

使用vscode查看Hex或UTF-8编码

金属有机骨架MOFs装载非甾体类抗炎药物|ZIF-8包裹普鲁士蓝负载槲皮素(制备方法)

QT learning 21 standard dialog box in QT (Part 2)

Go language web development series 29: Gin framework uses gin contrib / sessions library to manage sessions (based on cookies)

Go: send the get request and parse the return JSON (go1.16.4)

Implementation of Muduo accept connection, disconnection and sending data

Qt学习20 Qt 中的标准对话框(中)
![[技術發展-24]:現有物聯網通信技術特點](/img/f3/a219fe8e7438b8974d2226b4c3d4a4.png)
[技術發展-24]:現有物聯網通信技術特點
随机推荐
MySQL 数据处理值增删改
Dynamic programming 01 knapsack and complete knapsack
QT learning 24 layout manager (III)
Uniapp skills - scrolling components -1
叶酸修饰的金属-有机骨架(ZIF-8)载黄芩苷|金属有机骨架复合磁性材料([email protected])|制备路线
如何使用lxml判断网站公告是否更新
NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon
金属有机骨架MOFs装载非甾体类抗炎药物|ZIF-8包裹普鲁士蓝负载槲皮素(制备方法)
How to use lxml to judge whether the website announcement is updated
Summary of common error reporting problems and positioning methods of thrift
全面发展数字经济主航道 和数集团积极推动UTONMOS数藏市场
[bw16 application] instructions for firmware burning of Anxin Ke bw16 module and development board update
Function calling convention
Go language web development series 27: Gin framework: using gin swagger to implement interface documents
Ocean CMS vulnerability - search php
Example analysis of QT learning 18 login dialog box
[how to earn a million passive income]
Stack application (balancer)
Rasp implementation of PHP
使用vscode查看Hex或UTF-8编码