question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Don't work with svelte template more (v14)

See original GitHub issue

The stylelint v13 work with Svelte template files (*.svelte). New version v14 don’t work with any Svelte files more.

Example:

<script lang="ts">
  export let version: string;
</script>

<span>
  v{version}
</span>

<style>
  span {
    font-size: 12px;
    color: var(--d50);
  }
</style>

command:

npx stylelint 'src/**/*.svelte'

error:

src/components/ReleaseNote.svelte
 1:9  ✖  Unknown word  CssSyntaxError

npm

"stylelint": "^14.0.0",
"stylelint-config-standard": "^23.0.0",

.stylelintrc

{
  "extends": [
    "stylelint-config-standard"
  ],
  "rules": {
    "selector-pseudo-class-no-unknown": [
      true,
      {
        "ignorePseudoClasses": [
          "global"
        ]
      }
    ]
  }
}

Do you have plan support Svelte template files?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
shooniacommented, Oct 25, 2021

@ybiquitous Thank you for your answer! It works well!

I like this new approach to decrease a node_modules size in the project.

2reactions
ybiquitouscommented, Oct 25, 2021

@shoonia Could you check the migration guide to v14, please?

Maybe, your Stylelint configuration would look like this: (that means you would need to install postcss-html additionally)

{
  "extends": [
    "stylelint-config-standard"
  ],
  "overrides": [
    {
      "files": ["**/*.svelte"],
      "customSyntax": "postcss-html",
      "rules": {
        ...
      }
    }
  ]
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

Testing a Svelte app with Vitest - LogRocket Blog
Vitest has become the first choice dev tool for Svelte. Learn about its features and integrations and how it compares to Jest.
Read more >
svelte - Could not install Sveltejs - Stack Overflow
in order to install svelte you need to git clone it's template not the source code. here is the template. either use the...
Read more >
Quick start - Slinkity
Use our handy CLI command to spin up a Slinkity site: npm init slinkity . This demos our core functionality while staying as...
Read more >
Deploy SvelteKit with node adapter on linux server.
So first requirement for this is using node-adapter in our project because default auto-adapter won't work for nodeJs deploy on server.
Read more >
Getting Started | Guide - Vitest
You can learn more about the rationale behind the project in the Why ... setup but doesn't require installing anything on your machine....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found