当前位置:网站首页>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
边栏推荐
- Spring cup eight school league
- Qt学习24 布局管理器(三)
- 记录关于银行回调post请求405 问题
- Qt学习19 Qt 中的标准对话框(上)
- [how to earn a million passive income]
- Solve MySQL 1045 access denied for user 'root' @ 'localhost' (using password: yes)
- Analysis of the characteristics of page owner
- Stack application (balancer)
- 3D vision - 2 Introduction to pose estimation - openpose includes installation, compilation and use (single frame, real-time video)
- 金属有机骨架(MOFs)抗肿瘤药载体|PCN-223装载甲硝唑|UiO-66包载盐酸环丙沙星([email protected])
猜你喜欢

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

Cross linked cyclodextrin metal organic framework loaded methotrexate slow-release particles | metal organic porous material uio-66 loaded with flavonoid glycosides | Qiyue

核酸修饰的金属有机框架药物载体|PCN-223金属有机骨架包载Ad金刚烷|ZIF-8包裹阿霉素(DOX)

Uniapp tips - scrolling components

如何使用lxml判断网站公告是否更新

NFT new opportunity, multimedia NFT aggregation platform okaleido will be launched soon

Logback log sorting

Go language web development series 30: gin: grouping by version for routing

Screenshot of the operation steps of upload labs level 4-level 9

Qt学习21 Qt 中的标准对话框(下)
随机推荐
Comprehensive case of MySQL data addition, deletion, modification and query
[technology development-24]: characteristics of existing IOT communication technology
Go language web development series 27: Gin framework: using gin swagger to implement interface documents
RichView TRVStyle ListStyle 列表样式(项目符号编号)
selenium 浏览器(1)
SQL Injection (AJAX/JSON/jQuery)
Summary of common error reporting problems and positioning methods of thrift
叶酸修饰的金属-有机骨架(ZIF-8)载黄芩苷|金属有机骨架复合磁性材料([email protected])|制备路线
Stack application (balancer)
Collection of mobile adaptation related articles
Which securities company has the lowest Commission for opening an account online? I want to open an account. Is it safe for the online account manager to open an account
GoLand 2021.1.1: configure the multi line display of the tab of the open file
Uniapp skills - dom display and hiding
Complete DNN deep neural network CNN training with tensorflow to complete image recognition cases
Metal organic framework material zif-8 containing curcumin( [email protected] Nanoparticles) | nano metal organic framework carry
Record 405 questions about bank callback post request
Golang — template
Uniapp skills - scrolling components -1
Bidirectional linked list (we only need to pay attention to insert and delete functions)
Comprehensively develop the main channel of digital economy and digital group, and actively promote the utonmos digital Tibet market