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-empty-pattern/no-floating-decimal/no-self-compare/no-delete-var/no-new-object ESLint rules #7988

Merged
merged 1 commit into from
Jan 23, 2017
Merged

Conversation

Snuffleupagus
Copy link
Collaborator

The following rules required no code changes:
http://eslint.org/docs/rules/no-empty-pattern
http://eslint.org/docs/rules/no-floating-decimal
http://eslint.org/docs/rules/no-delete-var
http://eslint.org/docs/rules/no-new-object

There was just one change needed in order to enable:
http://eslint.org/docs/rules/no-self-compare; which I think helps readability a lot, since that comparison makes no sense until you realize that we push NaN onto the stack in some cases and furthermore that NaN !== NaN.

…/`no-delete-var`/`no-new-object` ESLint rules

The following rules required no code changes:
http://eslint.org/docs/rules/no-empty-pattern
http://eslint.org/docs/rules/no-floating-decimal
http://eslint.org/docs/rules/no-delete-var
http://eslint.org/docs/rules/no-new-object

There was just one change needed in order to enable:
http://eslint.org/docs/rules/no-self-compare; which I think helps readability a lot, since that comparison makes no sense until you realize that we push `NaN` onto the `stack` in some cases *and* furthermore that `NaN !== NaN`.
@yurydelendik
Copy link
Contributor

/botio test

@pdfjsbot
Copy link

From: Bot.io (Linux)


Received

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

Live output at: http://107.21.233.14:8877/74abbccbf30c4fd/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Received

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

Live output at: http://107.22.172.223:8877/4fdeb8b226336d9/output.txt

@pdfjsbot
Copy link

From: Bot.io (Windows)


Success

Full output at http://107.22.172.223:8877/4fdeb8b226336d9/output.txt

Total script time: 25.79 mins

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

@pdfjsbot
Copy link

From: Bot.io (Linux)


Success

Full output at http://107.21.233.14:8877/74abbccbf30c4fd/output.txt

Total script time: 26.88 mins

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

@yurydelendik yurydelendik merged commit ca74e15 into mozilla:master Jan 23, 2017
@yurydelendik
Copy link
Contributor

Thank you for the patch

@Snuffleupagus Snuffleupagus deleted the eslint-more-rules-2 branch January 23, 2017 20:50
@timvandermeij
Copy link
Contributor

Question: where does isNaN actually come from? Shouldn't it have been imported?

@Snuffleupagus
Copy link
Collaborator Author

Snuffleupagus commented Jan 23, 2017

Question: where does isNaN actually come from? Shouldn't it have been imported?

It's a function that's built-in to all browsers, so no need to import anything; also see e.g. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/isNaN.

@yurydelendik
Copy link
Contributor

@timvandermeij
Copy link
Contributor

You're right. I was confused because we also have isInt and similar functions that we implement ourselves as utility functions. Sorry for the noise.

movsb pushed a commit to movsb/pdf.js that referenced this pull request Jul 14, 2018
Enable the `no-empty-pattern`/`no-floating-decimal`/`no-self-compare`/`no-delete-var`/`no-new-object` ESLint rules
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.

4 participants