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.
Summary
The airbnb linter config introduces a lot of opinionated style lint rules. It helps us to establish a team wide style guide without fighting over styles, but it also adds significant burden to developers.
For example, a lot of style violations are not autofixable, so devs have to spend extra time to make linter happy. Some rules are even in conflict with each other sometimes, and devs need to find smart ways to work around them. What's worse, even after all these burdens, it's still not guaranteed that each AST corresponds to a unique style-guide approved output, so there can be still fighting over styles.
Therefore, I think it's better to introduce prettier for this case. Prettier formats all the code in an opinionated way, and it can be run in a pre-commit hook. Therefore, even if you code style looks like garbage, the pre-commit hook will fix it automatically for you like:
The diff is big, but almost all the changes are generated by
yarn format
.Test Plan
CI, and use you 👀 to decide whether prettier produces nice output.