当前位置:网站首页>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
边栏推荐
- 金属有机骨架MOFs装载非甾体类抗炎药物|ZIF-8包裹普鲁士蓝负载槲皮素(制备方法)
- Implementation of Muduo asynchronous logging
- 太阳底下无新事,元宇宙能否更上层楼?
- How to use lxml to judge whether the website announcement is updated
- Qt学习25 布局管理器(四)
- Golang — 命令行工具cobra
- 核酸修饰的金属有机框架药物载体|PCN-223金属有机骨架包载Ad金刚烷|ZIF-8包裹阿霉素(DOX)
- “又土又穷”的草根高校,凭什么被称为“东北小清华”?
- [technology development-24]: characteristics of existing IOT communication technology
- 28:第三章:开发通行证服务:11:在配置文件中定义属性,然后在代码中去获取;
猜你喜欢
Message subscription and publishing
Golang - command line tool Cobra
Go language web development series 28: solve cross domain access of CORS with gin contrib / CORS
[email protected])|制备路线"/>
叶酸修饰的金属-有机骨架(ZIF-8)载黄芩苷|金属有机骨架复合磁性材料([email protected])|制备路线
Use and design of Muduo buffer class
28:第三章:开发通行证服务:11:在配置文件中定义属性,然后在代码中去获取;
The solution of Chinese font garbled code in keil5
Qt学习17 对话框及其类型
MySQL 数据处理值增删改
Complete DNN deep neural network CNN training with tensorflow to complete image recognition cases
随机推荐
全局事件总线
Golang - command line tool Cobra
QT learning 23 layout manager (II)
Qt学习18 登录对话框实例分析
[技術發展-24]:現有物聯網通信技術特點
又一个行业被中国芯片打破空白,难怪美国模拟芯片龙头降价抛售了
Message subscription and publishing
How to promote the progress of project collaboration | community essay solicitation
金属有机骨架材料ZIF-8包载姜黄素([email protected]纳米颗粒)|纳米金属有机框架搭载雷帕霉素|科研试剂
Halcon combined with C # to detect surface defects -- Halcon routine autobahn
Record 405 questions about bank callback post request
QT learning 19 standard dialog box in QT (top)
MySQL 数据增删改查综合案例
Depth and breadth first traversal of tree (regardless of binary tree)
Unity render streaming communicates with unity through JS
JS general form submission 1-onsubmit
Metal organic framework (MOFs) antitumor drug carrier | pcn-223 loaded with metronidazole | uio-66 loaded with ciprofloxacin hydrochloride(
MIL-100( Fe) 包裹小分子阿司匹林形成[email protected](Fe)|甘草次酸修饰金属有机框架材料UiO-66-NH2(简称UiO-66-NH2-GA)
3D vision - 2 Introduction to pose estimation - openpose includes installation, compilation and use (single frame, real-time video)
Formation of mil-100 (FE) coated small molecule aspirin [email protected] (FE) | glycyrrhetinic acid modified metal organ