jamesbirtles / svelte-vscode

Svelte language support for VS Code
https://marketplace.visualstudio.com/items?itemName=JamesBirtles.svelte-vscode
MIT License
207 stars 22 forks source link

Do you need to disable the default CSS linter for SCSS to work? #103

Closed maximedupre closed 4 years ago

maximedupre commented 4 years ago

I get CSS errors in my SCSS style tag.

Screen Shot 2020-03-05 at 9 01 00 AM

I followed the instructions in the doc, but I think it is incomplete since I have this error...

Cheers!

magnus-eriksson commented 4 years ago

Having the same issue. It's only VSCode that complains. It can build it perfectly.

What I've tried:

The style:

<style type="text/scss">
    main {      
        h1 {
        color: #ff3e00;
        }
    }
</style>

The error: on the line h1 {

Colon is expected svelte(css-syntax-error)
bleucitron commented 4 years ago

Same problem here. I followed svelte-preprocess instructions.

The scss is functional, but i'm still getting errors in VS Code.

Capture d’écran 2020-03-19 à 11 01 26

Index.svelte style:

<style lang="scss">
  $color: orange;
  p {
    color: $color;
  }
</style>

svelte.config.js

const sveltePreprocess = require('svelte-preprocess');

module.exports = {
  preprocess: sveltePreprocess(),
};
NicholasPedroso commented 4 years ago

Same problem here. Tried everything. but just cant get this to work. This highlight syntax sucks :/

aekarahan commented 4 years ago

Same problem.

Zequez commented 4 years ago

After going through the code I figured the extension fails silently when svelte.config.js is invalid, so be extra sure the file doesn't has any syntax errors. Also make sure the output looks like this:

> require("./svelte.config.js")
{
  preprocess: {
    markup: [AsyncFunction: markup],
    script: [AsyncFunction: script],
    style: [AsyncFunction: style]
  }
}

Also, as a side note, SASS syntax is not supported, because it's not supported by vscode-css-languageservice. I'm not sure how pure .sass files do it.