Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to add a .stylelintrc.json file to the root directory

2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the root directory how to add .stylelintrc.json file related knowledge, the content is detailed and easy to understand, the operation is simple and fast, has a certain reference value, I believe that everyone after reading this root directory how to add .stylelintrc.json file article will have a harvest, let's take a look.

Configuration method:

The stylelint attribute in package.json specifies the rule

Specify in the .stylelintrc file that the file format can be JSON or YAML. You can also suffix the file, like: .stylelintrc.json, .stylelintrc.yaml, .stylelintrc.yml, .stylelintrc.js

Stylelint.config.js file, which exports a configuration object span >

Search in order. If any of the above three ways has a value, the search will end.

Create a new .stylelintrc.json file in the project root and copy the following

Module.exports = {"extends": ["stylelint-config-standard", "stylelint-config-recess-order"], "rules": {"at-rule-no-unknown": [true, {"ignoreAtRules": ["mixin", "extend", "content", "include"]}], "indentation": 4 "no-descending-specificity": null / / prohibits selector with less specificity from rewriting after selector with higher specificity}}

The priority of rules is higher than that of extends. It is recommended that extends be used for unified management.

At-rule-no-unknown is configured separately in the configuration file to enable Stylelint to support mixin, extend, and content syntax in SCSS syntax.

Fragment disable rule

/ * stylelint-disable * / / * (please state the reason for prohibiting detection) Front-end component restriction class name * / .cropper _ topContainer. Img-preview {border: 0 none;} / * stylelint-enable * /

Fix mode

Stylelint-- fix can handle it.

Webstorm can configure external tools to implement autofix and add keymap shortcut keys

This is the end of the article on "how to add a .stylelintrc.json file to the root directory". Thank you for reading! I believe that everyone has a certain understanding of the knowledge of "how to add .stylelintrc.json file to the root directory". If you want to learn more, you are welcome to follow the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report