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

[core]: linting and formatting precommit hook #403

Merged
merged 5 commits into from Jun 23, 2023

Conversation

khalibloo
Copy link
Contributor

Description

Fixed prettier script in lint-staged. Added eslint to lint-staged. Fixed linting errors. Formatted all files with prettier.

Before submitting the PR, please make sure you do the following

  • Read the Contributing guide
  • Prefix your PR title with [@svelteui/core], [@svelteui/actions], [@svelteui/motion], [@svelteui/core], [core], or [docs].
  • Include a description of the changes made in the PR description and in the commit messages.
  • Include screenshots/videos of the changes made.
  • Verify that the linter and tests are passing, with yarn lint and yarn test or just run yarn prepush.

@khalibloo
Copy link
Contributor Author

There are lots of changes because I ran prettier on all files. To ease the review, the prettier command was run in a separate commit. The commits can thus be reviewed sequentially.

With prettier in place now, there's an odd behavior that emerges. Running yarn prepush (specifically the syncpack command) changes the line endings of the package.json files in the monorepo. They appear as false changes in the git status, but when you try to stage and commit the change, prettier fixes the line endings and the git status becomes clean again, leaving you with an empty commit. I can't find any option in syncpack to address the line endings.

@BeeMargarida
Copy link
Member

This should not be doing all those changes, since it should only be applying the eslint and prettier configs that we are already doing for prepush. Why these changes?

@khalibloo
Copy link
Contributor Author

This should not be doing all those changes, since it should only be applying the eslint and prettier configs that we are already doing for prepush. Why these changes?

I ran the prettier command in the root of the project yarn prettier --write . and it produced all those changes. But even before this PR, I noticed when I touched some files, formatting them produced new changes. That's what led me to believe the files weren't getting formatted during the commits or during yarn prepush.

@BeeMargarida
Copy link
Member

Hum, let me check on my side, I have not touched prettier/eslint setup in some time

Copy link
Member

@BeeMargarida BeeMargarida left a comment

Choose a reason for hiding this comment

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

Makes sense, since we are running prettier only in each package, so this is expected. Thank you!!

@BeeMargarida BeeMargarida merged commit e552041 into svelteuidev:main Jun 23, 2023
1 check passed
@khalibloo khalibloo deleted the chore/precommit branch June 23, 2023 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants