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

format #342

Closed
wants to merge 2 commits into from
Closed

format #342

wants to merge 2 commits into from

Conversation

xav-ie
Copy link
Contributor

@xav-ie xav-ie commented Sep 15, 2024

  • chore(format): use cache
  • refactor(lint:format): rename workflow

PR Checklist

Overview

First commit makes subsequent format command faster for local development.

I am happy to remove second commit, but I think it makes it more clear that you need to have proper formatting to pass linting. I also thinks it more clear that prettier is just a formatter, and there are others :)

🐢

Copy link

vercel bot commented Sep 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
boston-ts-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 15, 2024 4:46pm

Makes formatting faster by using the cache stored in `node_modules`
Treating formatting as a lint step makes it easier to understand the
checks necessary to pass PR approval.
@xav-ie
Copy link
Contributor Author

xav-ie commented Sep 15, 2024

I am not sure how to get prettier one to pass given that is gone...

@@ -15,8 +15,9 @@
"scripts": {
"build": "remix vite:build",
"dev": "remix vite:dev",
"format": "prettier --write .",
"format": "prettier --cache --write .",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you notice some performance issues without --cache?

"lint": "eslint . .*js --max-warnings 0",
"lint:format": "prettier --cache --check .",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The way I like to set up projects in general is lint:* scripts report you of violations and format:* scripts auto-fix said violations (as much as possible). I didn't set up this repo, but it seems to be done somewhat similarly. So here lint:format is a little contradicting to me.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Personally, I consider formatting to be a sibling to linting, not a sub-concern.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, that makes sense. I also did not notice significant speed increase, so I will close this.

@xav-ie xav-ie closed this Sep 16, 2024
@xav-ie xav-ie deleted the format branch September 16, 2024 13:26
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