Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SvelteKit from prettier to biome: inconsistencies #4365

Closed
1 task done
frederikhors opened this issue Oct 22, 2024 · 4 comments
Closed
1 task done

SvelteKit from prettier to biome: inconsistencies #4365

frederikhors opened this issue Oct 22, 2024 · 4 comments
Labels
S-Needs triage Status: this issue needs to be triaged

Comments

@frederikhors
Copy link

frederikhors commented Oct 22, 2024

I'm using prettier (unfortunately) in a SvelteKit project, with this .prettierrc file:

{
	"useTabs": true,
	"singleQuote": true,
	"trailingComma": "none",
	"printWidth": 100,
	"plugins": [
		"prettier-plugin-svelte",
		"prettier-plugin-tailwindcss"
	],
	"overrides": [
		{
			"files": "*.svelte",
			"options": {
				"parser": "svelte"
			}
		}
	]
}

I migrated this file to biome 1.9.4 and with the below biome.json everything works but I'm getting an annoying difference: the indentation!

With prettier the file is like this:

<script lang="ts">
	import { something } from 'somewhere';
	import { something } from 'somewhere';
	import { something } from 'somewhere';

    
    type Props = {
        // something
    }
</script>

with Biome now it is like this:

<script lang="ts">
import { something } from 'somewhere';
import { something } from 'somewhere';
import { something } from 'somewhere';


type Props = {
    // something
}
</script>

Why?

Configuration

{
	"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
	"vcs": { "enabled": false, "clientKind": "git", "useIgnoreFile": true },
	"files": { "ignoreUnknown": false, "ignore": [] },
	"formatter": {
		"enabled": true,
		"lineWidth": 100,
	},
	"linter": { "enabled": false },
	"javascript": {
		"formatter": {
			"quoteStyle": "single",
			"trailingCommas": "none"
		}
	},
	"overrides": [{ "include": ["*.svelte"] }]
}

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@frederikhors frederikhors added the S-Needs triage Status: this issue needs to be triaged label Oct 22, 2024
@ematipico
Copy link
Member

This is a known limitation

@ematipico ematipico closed this as not planned Won't fix, can't repro, duplicate, stale Oct 22, 2024
@frederikhors
Copy link
Author

Can I ask you why is that?

@dyc3
Copy link
Contributor

dyc3 commented Oct 22, 2024

We currently just process the js sections because our HTML parser isn't ready yet.

@olafurw
Copy link

olafurw commented Oct 31, 2024

We currently just process the js sections because our HTML parser isn't ready yet.

Is there a place where I can monitor the status of the HTML parsing? I'd love to fully switch over to Biome for a pretty large Svelte project I have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Needs triage Status: this issue needs to be triaged
Projects
None yet
Development

No branches or pull requests

4 participants