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

Apply 'curly' ESLint rule + run Prettier on changed files #3294

Merged
merged 1 commit into from
Feb 13, 2022

Conversation

kubk
Copy link
Collaborator

@kubk kubk commented Feb 12, 2022

Related discussion: #3287 (comment)

This PR applies ESLint rule "curly" on the whole code base: https://eslint.org/docs/rules/curly
What ESLint documentation says about this rule: "it is considered by many to be best practice to never omit curly braces around blocks, even when they are optional, because it can lead to bugs and reduces code clarity"

The commit was generated automatically using yarn lint --fix && yarn prettier. Prettier changes were applied only for changed files. Just in case I checked that this change doesn't affect bundle at all. Here are the results of running command yarn lerna run test:size before and after applying changes:

Screen Shot 2022-02-12 at 22 48 57

It's a screenshot from https://www.diffchecker.com/diff

@kubk kubk requested a review from urugator February 12, 2022 19:49
@changeset-bot
Copy link

changeset-bot bot commented Feb 12, 2022

⚠️ No Changeset found

Latest commit: a030d10

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@@ -15,6 +15,7 @@ module.exports = {
rules: {
"no-fallthrough": "off",
"no-constant-condition": "off",
curly: "error",
Copy link
Collaborator Author

@kubk kubk Feb 12, 2022

Choose a reason for hiding this comment

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

It looks inconsistent, but Prettier decided to remove quotes here. That's because it tries to avoid them if possible

Copy link
Collaborator

@urugator urugator left a comment

Choose a reason for hiding this comment

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

lgtm

@kubk kubk merged commit e60b36c into main Feb 13, 2022
@kubk kubk deleted the apply-curly-eslint-rule branch July 18, 2022 08:55
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.

None yet

2 participants