Skip to content

Conversation

vicb
Copy link
Contributor

@vicb vicb commented Oct 18, 2024

The previously used sort-imports can not fix the code.

Changed the plugins to ones that can auto-fix the code (i.e. on save, or via lint:fix).
Getting an error without auto-fix was becoming frustrating.

@vicb vicb requested a review from dario-piotrowicz October 18, 2024 09:32
Copy link

changeset-bot bot commented Oct 18, 2024

⚠️ No Changeset found

Latest commit: 1dc806d

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

Copy link

pkg-pr-new bot commented Oct 18, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/@opennextjs/cloudflare@109

commit: 1dc806d

@petebacondarwin
Copy link
Contributor

In workers-sdk and in the vite-plugin-cloudflare projects we use Prettier to do the import ordering.
See flarelabs-net/vite-plugin-cloudflare@1ad143f

This is nice because most people have formatting set up on-save in their IDEs, which keeps imports sorted all the time and avoids having to run eslint fix commands.

Could we consider that approach?

@vicb
Copy link
Contributor Author

vicb commented Oct 18, 2024

In workers-sdk and in the vite-plugin-cloudflare projects we use Prettier to do the import ordering. See flarelabs-net/vite-plugin-cloudflare@1ad143f

This is nice because most people have formatting set up on-save in their IDEs, which keeps imports sorted all the time and avoids having to run eslint fix commands.

Could we consider that approach?

Can we merge this PR to "unblock" me now and I'll create an issue for the follow up?

edit: it's also easy to run ESLint on save so that you does not have to execute the command
edit2: also I have been delayed a bit but I still plan to work on a common eslint/prettier config to use across projects.

@vicb vicb mentioned this pull request Oct 18, 2024
@vicb vicb merged commit a91ac71 into main Oct 18, 2024
7 checks passed
@vicb vicb deleted the autofix branch October 18, 2024 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants