使用Tailwind-CSS时,如何摆脱这些SASS掉毛错误? [英] How do you get rid of these SASS linting errors when using Tailwind-CSS?
本文介绍了使用Tailwind-CSS时,如何摆脱这些SASS掉毛错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在Gatsby.js项目中使用Tailwind。我的环境是VSCode,使用的是Prettier代码格式化程序。
我如何摆脱这些掉毛的错误警报?
解决方案
.css和.scss的解决方案
- 在项目的根目录下,使用文件
settings.json $ c $更新或创建目录
.vscode
c>:
< ol start = 2>
.vscode / settings.json:
{
css.validate:否,
less.validate:否,
scss.validate:false
}
- 安装
- 安装
I'm using Tailwind in a Gatsby.js project. My environment is VSCode, using Prettier code formatter.
How do I get rid of these linting error alerts?
解决方案Solution for both .css and .scss
- At the root level of your project, update or create a dir
.vscode
with a filesettings.json
:
- Add the following to
.vscode/settings.json:
{ "css.validate": false, "less.validate": false, "scss.validate": false }
- Install the vscode-stylelint extension
- install stylelint-config-standard:
npm i stylelint-config-standard -D
- create a
stylelint.config.js
file at the root level and add:
module.exports = { extends: ['stylelint-config-recommended'], rules: { "at-rule-no-unknown": [ true, { ignoreAtRules: [ "tailwind", "apply", "variants", "responsive", "screen", ], }, ], "declaration-block-trailing-semicolon": null, "no-descending-specificity": null, }, };
- restart vsCode
Results:
You get rid of these SASS linting errors when using Tailwind-CSS and keep doing css validation with stylelint.
这篇关于使用Tailwind-CSS时,如何摆脱这些SASS掉毛错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- At the root level of your project, update or create a dir
- 安装
查看全文