Enforce consistent code style through prettier #135
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This is a proposal of a prettier config for this repository, I tried to make the config as close as possible to the current code style. You can see the changes by cloning my fork A-K-O-R-A/TUfast_TUD, switching to the
coding-with-style
branch and then runningnpm install
followed bynpm run prettier:fix
.Adding this config will also make the CI fail if the pushed code wasn't formatted with prettier. The easiest solution is to just configure your editor to format on save by. In the case of VSCode there is a extension esbenp.prettier-vscode which I also added as a recommended VSCode extension for this repository in the
.vscode/extension.json
file.References
This repository does not have a consistent code style yet and only a few linting rules which leads to a very inconsistent code style and allows for errors like missing closing tags in HTML files or confusing indentations which degrades the readability significantly.
Type of change
Testing
npm run test
locally