How do you get rid of these SASS linting errors when using Tailwind-CSS?
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.
Unknown at rule @tailwind CSS in reactjs
Make sure to install PostCSS Language Support, extension found in the VSCODE.
That will remove the error that is displaying.
@apply rule is compatible with postCSS: https://github.com/tailwindcss/tailwindcss/issues/325
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=csstools.postcss
How to fix eslint/prettier Parsing error: ';' expected for .css file?
After a bit more research, I found out that my eslint command was the issue:
yarn eslint src/**
This included .css, .json, etc. files even though my eslintrc was correctly configurated. By switching to this function, the issue no longer occurs:
yarn eslint --ext js,jsx,ts,tsx src
Related Topics
White to Transparent Gradient with Background Image
How to Center a Button in Material-Ui
Tailwind CSS How to Code Pixel Perfect Design
Site 5X Faster via Mod_Rewrite, But CSS Images Are Broken
What Does The 'P-N' and Its Variants Represent in Bootstrap V4
Make Flex Item Full Width After It's Been Wrapped Without Using Media Queries
Body { Font-Size: 100.01%; } Vs Body { Font-Size: 100%; }
Target The 2Nd Instance of a CSS Class
Make Some Gradient Move Endlessly in a Progress Bar Like in Windows 7
Using an Icon Font (Font Awesome) Looks a Little Blurred and Too Bold
How to Let a Div Automatically Set It Own Width
Twitter Bootstrap 3.0 Row Wider Than Window
Reactjs How to Use Ref Inside Map Function
Font Awesome Icons Are Not Working in Some Browsers
How to Add Image Background to Btn-Default Twitter-Bootstrap Button