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

chore: optimize lint-staged #101

Merged
merged 9 commits into from
Oct 25, 2024
Merged

chore: optimize lint-staged #101

merged 9 commits into from
Oct 25, 2024

Conversation

groninge01
Copy link
Contributor

@groninge01 groninge01 commented Oct 24, 2024

  • add caching for eslint/prettier/typecheck
  • set incremental to true in base tsconfig for typecheck
  • -update stylelint and run fix

Copy link

vercel bot commented Oct 24, 2024

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

Name Status Preview Comments Updated (UTC)
mono-frontend-v3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2024 0:54am
mono-test-v3 ✅ Ready (Inspect) Visit Preview 💬 Add feedback Oct 24, 2024 0:54am

@groninge01 groninge01 marked this pull request as ready for review October 24, 2024 12:54
@@ -103,7 +103,7 @@
}
}

@media screen and (min-width >= 768px) {
@media screen and (width >= 768px) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this intended?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

stylelint threw an error on it

> @balancer/frontend-monorepo@ stylelint /home/groninge/projects/frontend-monorepo
> stylelint '**/*.css'


packages/lib/assets/css/marketing.css
  106:18  ✖  Unexpected invalid media query " (min-width >= 768px)", "min-" and "max-" prefixes are not needed when using range queries  media-query-no-invalid

Copy link
Contributor

Choose a reason for hiding this comment

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

@uiuxxx is this linting change valid? or will it cause problems.

Comment on lines +49 to +54
"transit": {
"dependsOn": ["^transit"]
},
"//#format": {
"outputs": ["node_modules/.cache/.prettiercache"]
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Where did this solution come from? Can you point me to the docs?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

But what is this transit and //#format command? I've never seen that in Turbo.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The task with double slashes is a root task.
The transit task is turbo magic to make tasks run in parallel (but I only saw that happen once).

Comment on lines +15 to +16
"format": "prettier '*.*(md|json|yaml|ts|js|tsx)' --check --cache --cache-location='node_modules/.cache/.prettiercache'",
"format:fix": "prettier '*.*(md|json|yaml|ts|js|tsx)' --write --cache --cache-location='node_modules/.cache/.prettiercache' --log-level=warn",
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this not be?

Suggested change
"format": "prettier '*.*(md|json|yaml|ts|js|tsx)' --check --cache --cache-location='node_modules/.cache/.prettiercache'",
"format:fix": "prettier '*.*(md|json|yaml|ts|js|tsx)' --write --cache --cache-location='node_modules/.cache/.prettiercache' --log-level=warn",
"format": "turbo format",
"format:fix": "turbo format:fix",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is needed to run prettier in the root (and only in the root)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

but it might not make sense to run eslint/prettier in the root

Copy link
Contributor

@garethfuller garethfuller left a comment

Choose a reason for hiding this comment

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

I'm a bit worried this is overcomplicating things. Would be great to look into biome.

@garethfuller garethfuller merged commit 4aef9e3 into main Oct 25, 2024
8 checks passed
@garethfuller garethfuller deleted the chore/optimize-lint-staged branch October 25, 2024 07:28
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.

2 participants