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(*): Sync linting and IDE config #2137
Conversation
|
22d95c0
to
cb591ac
Compare
Preview environment ready: https://preview-2137--swisspost-web-frontend.netlify.app |
71a981f
to
9c85bcd
Compare
9c85bcd
to
e762ece
Compare
e762ece
to
76a6f54
Compare
"editor.defaultFormatter": null, | ||
"editor.formatOnSave": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting defaultFormatter to null should be sufficient according to https://zellwk.com/blog/prettier-disable-languages but it's not. So I disabled as well formatOnSave for MDX according to https://github.com/prettier/prettier-vscode
# Conflicts: # .vscode/settings.json # packages/components/src/components.d.ts # packages/documentation/src/stories/components/badge/badge.stories.ts # packages/internet-header/src/components.d.ts
# IDEs and editors | ||
.idea/ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.idea contain already a generated gitignore that manage what can be sync with a team and what shoudn't.
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
What
Commit essential linting and formatting config from our favourite IDE to the repository. The aim is to have the same config across the team and across IDE so we avoid dealing with changes that shouldn't be part of our PR.
prettier --write "**/*.{**/*,*}.{js,ts,jsx,tsx,scss,css,html,json}"
About MDX:
Disable formatting totally, as the maximum printWidth rule conflicts with MDX syntax about new line =
<p>
.Latest issue that we had: #2128 . Issue on Prettier repository: prettier/prettier#12209
If this wouldn't be enough, the second option is to ensure that our files are checked before committed with a git hook: https://github.com/lint-staged/lint-staged
For review: you can do it commit by commit.