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

Enable the ESLint prefer-const rule globally (PR 11450 follow-up) #11534

Merged
merged 2 commits into from
Jan 24, 2020

Conversation

Snuffleupagus
Copy link
Collaborator

No description provided.

@Snuffleupagus
Copy link
Collaborator Author

/botio lint

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_lint from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.215.176.217:8877/579cb2aea8d7f5e/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_lint from @Snuffleupagus received. Current queue size: 0

Live output at: http://54.67.70.0:8877/ee61e7e25ecfc8a/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Success

Full output at http://54.67.70.0:8877/ee61e7e25ecfc8a/output.txt

Total script time: 1.17 mins

  • Lint: Passed

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://54.215.176.217:8877/579cb2aea8d7f5e/output.txt

Total script time: 2.62 mins

  • Lint: Passed

@Snuffleupagus Snuffleupagus changed the title Enable the ESLint prefer-const rule globally (PR 11450) Enable the ESLint prefer-const rule globally (PR 11450 follow-up) Jan 24, 2020
@timvandermeij
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://54.67.70.0:8877/c52863a2048ddb9/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

Command cmd_test from @timvandermeij received. Current queue size: 0

Live output at: http://54.215.176.217:8877/a4b4a50ae45b427/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/c52863a2048ddb9/output.txt

Total script time: 19.48 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.67.70.0:8877/c52863a2048ddb9/reftest-analyzer.html#web=eq.log

Copy link
Contributor

@timvandermeij timvandermeij left a comment

Choose a reason for hiding this comment

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

Looks good when the merge conflict is resolved. Thank you for doing this!

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://54.215.176.217:8877/a4b4a50ae45b427/output.txt

Total script time: 26.01 mins

  • Font tests: Passed
  • Unit tests: Passed
  • Regression tests: FAILED

Image differences available at: http://54.215.176.217:8877/a4b4a50ae45b427/reftest-analyzer.html#web=eq.log

Please find additional details about the ESLint rule at https://eslint.org/docs/rules/prefer-const

With the recent introduction of Prettier this sort of mass enabling of ESLint rules becomes a lot easier, since the code will be automatically reformatted as necessary to account for e.g. changed line lengths.

Note that this patch is generated automatically, by using the ESLint `--fix` argument, and will thus require some additional clean-up (which is done separately).
… rule globally

This covers cases that the `--fix` command couldn't deal with, and in a few cases (notably `src/core/jbig2.js`) the code was changed to use block-scoped variables instead.
@timvandermeij timvandermeij merged commit 794744c into mozilla:master Jan 24, 2020
@Snuffleupagus
Copy link
Collaborator Author

Snuffleupagus commented Jan 24, 2020

Looks good when the merge conflict is resolved. Thank you for doing this!

As always, thank you for reviewing these bigger patches!
(The fact that it's mostly done automatically hopefully helps to simplify the review process a bit though...)

We may also want to look into enabling the no-var rule globally at some point, but I don't yet know if --fix will handle enough cases to make a mostly automatic conversion feasible.

@Snuffleupagus Snuffleupagus deleted the prefer-const branch January 24, 2020 23:41
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.

3 participants