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 no-var linting rule in more core files #13029

Merged
merged 6 commits into from
Feb 27, 2021

Conversation

timvandermeij
Copy link
Contributor

@timvandermeij timvandermeij commented Feb 27, 2021

This is mostly done using the gulp lint --fix command, and manual changes in a small number of cases where ESLint couldn't determine what to use, in an effort to reduce the number of disabled ESLint rules in the core folder and to use modern syntax.

@timvandermeij timvandermeij changed the title Enable no no-var linting rule in more core files Enable the no-var linting rule in more core files Feb 27, 2021
@timvandermeij
Copy link
Contributor Author

/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/00150e1f9934047/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://3.101.106.178:8877/dc1e2450a916a0e/output.txt

Copy link
Collaborator

@Snuffleupagus Snuffleupagus left a comment

Choose a reason for hiding this comment

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

Looks great, thank you!

I've added one (small) suggestion, but it's obviously not a blocker :-)

Comment on lines 15 to -16
/* no-babel-preset */
/* eslint-disable no-var */
Copy link
Collaborator

Choose a reason for hiding this comment

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

Including this here for future reference, to clarify that we've considered the implications of these changes:

Here, and in src/core/unicode.js, we include these files as-is in the "legacy"-builds because of issues with Babel; please note

pdf.js/gulpfile.js

Lines 198 to 200 in 052db45

// `src/core/{glyphlist,unicode}.js` (Babel is too slow for those when
// source-maps are enabled) should be excluded from processing.
const babelExcludes = [

Hence this PR will result in let/const being included even in the "legacy"-builds, however that should be fine given the following compatibility information:

Note also that IE 11 support is now explicitly removed, and this CSS-compatibility configuration for the GENERIC-builds:

pdf.js/gulpfile.js

Lines 78 to 90 in 052db45

// Default Autoprefixer config used for generic, components, minified-pre
var AUTOPREFIXER_CONFIG = {
overrideBrowserslist: [
"last 2 versions",
"Chrome >= 49", // Last supported on Windows XP
"Firefox >= 52", // Last supported on Windows XP
"Firefox ESR",
"Safari >= 10",
"> 0.5%",
"not IE > 0",
"not dead",
],
};

src/core/unicode.js Outdated Show resolved Hide resolved
…c/core/unicode.js`

This avoids creating intermediate strings and should be slightly more
efficient.
@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/00150e1f9934047/output.txt

Total script time: 24.49 mins

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

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

@pdfjsbot
Copy link

From: Bot.io (Windows)


Failed

Full output at http://3.101.106.178:8877/dc1e2450a916a0e/output.txt

Total script time: 28.92 mins

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

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

@timvandermeij
Copy link
Contributor Author

/botio unittest

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Received

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

Live output at: http://54.67.70.0:8877/0e938857338b95e/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://3.101.106.178:8877/a9925bc3d6c1c64/output.txt

@pdfjsbot
Copy link

From: Bot.io (Linux m4)


Failed

Full output at http://54.67.70.0:8877/0e938857338b95e/output.txt

Total script time: 3.64 mins

  • Unit Tests: FAILED

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://3.101.106.178:8877/a9925bc3d6c1c64/output.txt

Total script time: 5.88 mins

  • Unit Tests: Passed

@timvandermeij timvandermeij merged commit 5a8b849 into mozilla:master Feb 27, 2021
@timvandermeij timvandermeij deleted the no-var branch February 27, 2021 12:35
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