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

Chore: dogfooding no-var rule and remove vars (refs #6407) #6757

Merged
merged 1 commit into from Jul 29, 2016

Conversation

mysticatea
Copy link
Member

@mysticatea mysticatea commented Jul 25, 2016

Refs #6407.

This PR applies no-var rule to our code.

  • I tweaked some code for references from outside of the block which has declarations.
  • I fixed some tests which are using our .eslintrc.yml or our code with --no-eslintrc.
  • I added a dependency karma-babel-preprocessor for tests of PhantomJS. let in tests/lib/eslint.js caused syntax errors.

@eslintbot
Copy link

LGTM

@mysticatea
Copy link
Member Author

Also, let is slower than var, so I profiled performance between before/after this PR. As a result, I could see no significant differences.

Before

C:\Users\t-nagashima.AD\Documents\GitHub\eslint [chore/no-var-and-prefer-const]> npm run perf

> eslint@3.1.1 perf C:\Users\t-nagashima.AD\Documents\GitHub\eslint
> node Makefile.js perf


Loading:
  Load performance Run #1:  363.21531ms
  Load performance Run #2:  359.273145ms
  Load performance Run #3:  361.171179ms
  Load performance Run #4:  366.161369ms
  Load performance Run #5:  363.397929ms

  Load Performance median:  363.21531ms


Single File:
  CPU Speed is 3392 with multiplier 13000000
  Performance Run #1:  3858.823388ms
  Performance Run #2:  3873.5548909999998ms
  Performance Run #3:  3858.693893ms
  Performance Run #4:  3937.017115ms
  Performance Run #5:  3874.006157ms

  Performance budget exceeded: 3873.5548909999998ms (limit: 3832.5471698113206ms)


Multi Files (450 files):
  CPU Speed is 3392 with multiplier 39000000
  Performance Run #1:  14332.274141ms
  Performance Run #2:  12398.347067ms
  Performance Run #3:  11891.07006ms
  Performance Run #4:  11816.343988ms
  Performance Run #5:  12031.848532ms

  Performance budget exceeded: 12031.848532ms (limit: 11497.641509433963ms)

After

C:\Users\t-nagashima.AD\Documents\GitHub\eslint [chore/no-var-and-prefer-const +0 ~519 -0 !]> npm run perf

> eslint@3.1.1 perf C:\Users\t-nagashima.AD\Documents\GitHub\eslint
> node Makefile.js perf


Loading:
  Load performance Run #1:  361.830118ms
  Load performance Run #2:  360.144889ms
  Load performance Run #3:  363.776148ms
  Load performance Run #4:  355.25944ms
  Load performance Run #5:  363.504784ms

  Load Performance median:  361.830118ms


Single File:
  CPU Speed is 3392 with multiplier 13000000
  Performance Run #1:  3892.6454169999997ms
  Performance Run #2:  3874.342117ms
  Performance Run #3:  3895.069274ms
  Performance Run #4:  3918.40291ms
  Performance Run #5:  3852.414501ms

  Performance budget exceeded: 3892.6454169999997ms (limit: 3832.5471698113206ms)


Multi Files (450 files):
  CPU Speed is 3392 with multiplier 39000000
  Performance Run #1:  11876.235927ms
  Performance Run #2:  11997.202451ms
  Performance Run #3:  11880.865707ms
  Performance Run #4:  11883.21531ms
  Performance Run #5:  11817.850825ms

  Performance budget exceeded: 11880.865707ms (limit: 11497.641509433963ms)

@gyandeeps
Copy link
Member

LGTM, waiting for others to review.

@platinumazure
Copy link
Member

LGTM with merge-base of 1025772. I can't speak to the karma preprocessor though, hopefully someone else can cover that.

This is one of those things that should probably be merged quickly; otherwise, @mysticatea will either need to rebase with some frequency or scramble with another commit after this is merged, if someone has added a var statement in the meanwhile.

@ilyavolodin
Copy link
Member

LGTM

@nzakas nzakas merged commit 4fc0018 into master Jul 29, 2016
@mysticatea mysticatea deleted the chore/no-var branch July 30, 2016 07:03
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants