Skip to content
This repository has been archived by the owner on May 7, 2020. It is now read-only.

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

Closed
maximedupre opened this issue Mar 5, 2020 · 5 comments
Closed

Comments

@maximedupre
Copy link

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
Copy link

magnus-eriksson commented Mar 13, 2020

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

What I've tried:

  • Added the full path to node in settings (ran which node and copy/paste'd the path).
  • Restarted the language server (ctrl + shift + p and Svelte: Restart Language Server)
  • Restarted VSCode

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
Copy link

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
Copy link

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

@aekarahan
Copy link

Same problem.

@Zequez
Copy link

Zequez commented Apr 6, 2020

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants