Can't lint or format svelte files at all
ZerdoX-x opened this issue · 1 comments
ZerdoX-x commented
Test.svelte
:
<h1>test</h1>
<style>
h1 {
text-align: center;
padding: 2.5em 0.1em;
}
</style>
stylelint.config.cjs
:
module.exports = {
plugins: ["stylelint-prettier"],
extends: [
"stylelint-config-standard",
"stylelint-prettier/recommended",
"stylelint-config-html/html",
"stylelint-config-html/svelte",
],
rules: {
"prettier/prettier": true
},
};
Error log:
ParseError: Expected }
1 | h1 {
> 2 | text-align: center;
| ^
3 | padding: 2.5em 0.1em;
4 | }
at error (/Users/zerdox/p/midas/test/web/node_modules/.pnpm/svelte@3.52.0/node_modules/svelte/compiler.js:17796:20)
at Parser$1.error (/Users/zerdox/p/midas/test/web/node_modules/.pnpm/svelte@3.52.0/node_modules/svelte/compiler.js:17873:10)
at Parser$1.eat (/Users/zerdox/p/midas/test/web/node_modules/.pnpm/svelte@3.52.0/node_modules/svelte/compiler.js:17887:19)
at mustache (/Users/zerdox/p/midas/test/web/node_modules/.pnpm/svelte@3.52.0/node_modules/svelte/compiler.js:17618:17)
at new Parser$1 (/Users/zerdox/p/midas/test/web/node_modules/.pnpm/svelte@3.52.0/node_modules/svelte/compiler.js:17832:22)
at Object.parse$3 [as parse] (/Users/zerdox/p/midas/test/web/node_modules/.pnpm/svelte@3.52.0/node_modules/svelte/compiler.js:17964:21)
at Object.parse (/Users/zerdox/p/midas/test/web/node_modules/.pnpm/prettier-plugin-svelte@2.8.0_lrllcp5xtrkmmdzifit4hd52ze/node_modules/prettier-plugin-svelte/plugin.js:2025:83)
at Object.parse (/Users/zerdox/p/midas/test/web/node_modules/.pnpm/prettier@2.7.1/node_modules/prettier/index.js:7334:23)
at coreFormat (/Users/zerdox/p/midas/test/web/node_modules/.pnpm/prettier@2.7.1/node_modules/prettier/index.js:8645:18)
at formatWithCursor2 (/Users/zerdox/p/midas/test/web/node_modules/.pnpm/prettier@2.7.1/node_modules/prettier/index.js:8837:18)
ZerdoX-x commented
Oops.. Maybe I didn't event install stylelint-prettier
package. Sorry for that. I've found that out when I decided I don't need this tool in favor of stylelint-config-prettier