Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

490
Visualizações
How do you get rid of these SASS linting errors when using Tailwind-CSS?

Linting error

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?

over 4 years ago · Santiago Trujillo
7 Respostas
Responde à pergunta

0

If you using VS Code then you can add support for modern and experimental CSS within Visual Studio Code by installing the following plugin to fix the error while using Tailwind CSS directives.

https://marketplace.visualstudio.com/items?itemName=csstools.postcss

over 4 years ago · Santiago Trujillo Relatório

0

You have to get a code formatter for VSCode to solve it.

I recommend you to download Beautify available on this link.

over 4 years ago · Santiago Trujillo Relatório

0

Quick Solution for both .css and .scss (NOT RECOMMENDED)

  1. At the root level of your project, update or create a dir .vscode with a file settings.json:

enter image description here

  1. Add the following to .vscode/settings.json:
{
  "css.validate": false
}

enter image description here

Results:

You get rid of these SASS linting errors when using Tailwind-CSS but you disable CSS validation.

enter image description here

over 4 years ago · Santiago Trujillo Relatório

0

Solution for both .css and .scss

  1. At the root level of your project, update or create a dir .vscode with a file settings.json:

enter image description here

  1. Add the following to .vscode/settings.json:
{
  "css.validate": false,
  "less.validate": false,
  "scss.validate": false
}
  1. Install the vscode-stylelint extension

enter image description here

  1. install stylelint-config-standard:

npm i stylelint-config-standard -D

  1. 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,
  },
};
  1. restart vsCode

Results:

You get rid of these SASS linting errors when using Tailwind-CSS and keep doing css validation with stylelint.

enter image description here

over 4 years ago · Santiago Trujillo Relatório

0

enter image description here

The other answers are thermonuclear. Even Confucius stopped with a canon...

This is the one that did it for me.

To reproduce: Settings -> search for "invalid tailwind directive", update the value for this rule to "ignore". Voila.

over 4 years ago · Santiago Trujillo Relatório

0

You can tell VS Code's CSS linter to ignore "Unknown At Rules" (like @tailwind). This will leave the rest of your CSS validation intact:

  1. VS Code -> Command Palette -> Workspace Settings -> Search for: CSS Unknown At Rules
  2. Set to ignore

enter image description here

VS Code can also whitelist specific CSS properties with CSS > Lint: Valid Properties, but it doesn't look like whitelisting specific 'at rules' is supported yet.

over 4 years ago · Santiago Trujillo Relatório

0

One line fix in vscode's settings.json

"scss.lint.unknownAtRules": "ignore"
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda