sveltejs / cli

The Svelte CLI
MIT License
258 stars 11 forks source link

chore: lint files after testing #315

Open manuel3108 opened 4 days ago

manuel3108 commented 4 days ago

This is not a real PR. This should be used to gather input if we want this or not, while also being used as a quick reproduction.

Relates #308

Idea is to solve the problem more globally and in a future-proof way. After the all-addons test has run, we will initiate pnpm lint (which runs prettier and eslint behind the scenes) if any of our generated code does not match the linting rules we enforce while adding eslint and prettier respectively. If we want to keep this kind of test in the future, we should properly separate into it's own test that exclusively tests linting all add-ons. But this is enough to get a rough idea.

To summarize, the results are pretty bad. After running pnpm format on the results of the test i got 36 files that did not match the prettier output (4 of those with EOL mismatches). Most of the files are related to the spaces / tabs issue we were trying to solve with #100 (roughly 9 files). Another 10 files are created outside of our control (storbook's src/stories folder), but that would still leave us with 22 wrongly formatted files.

If we add eslint to the story, we get another 5 errors (3 paraglide, 1 lucia, 1 storybook).

I do think this is an important test to have, but I think the timing is off. We first need to solve a few of those other issues, especially the tabs / spaces one.

changeset-bot[bot] commented 4 days ago

⚠️ No Changeset found

Latest commit: 6870040cb68eab60e5d9c98129ca9aa8388a7228

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

pkg-pr-new[bot] commented 4 days ago

Open in Stackblitz

pnpm add https://pkg.pr.new/sveltejs/cli/sv@315
pnpm add https://pkg.pr.new/sveltejs/cli/svelte-migrate@315

commit: 6870040