chore(ES6): changed 'var' into 'const' where convenient - #325
Conversation
| ) => /** @param {string} filePath */ filePath => { | ||
| var sourceParts = templateDir.split(path.delimiter); | ||
| const sourceParts = templateDir.split(path.delimiter); | ||
| sourceParts.push.apply(sourceParts, filePath.split("/")); |
There was a problem hiding this comment.
Mutable object, but okay..
There was a problem hiding this comment.
It doesn't get reassigned, so const is ok. Otherwise eslint would have failed :)
There was a problem hiding this comment.
The .push method is mutating it, ( even though the push method is immutable ) but that's another thing :D
sendilkumarn
left a comment
There was a problem hiding this comment.
minor comment otherwise LGTM 👍
| var yeoman = require("yeoman-environment"); | ||
| var LoaderGenerator = require("../generators/loader-generator").LoaderGenerator; | ||
| const yeoman = require("yeoman-environment"); | ||
| const LoaderGenerator = require("../generators/loader-generator").LoaderGenerator; |
There was a problem hiding this comment.
can we use this const { LoaderGenerator } = require("../generators/loader-generator") ?
| var yeoman = require("yeoman-environment"); | ||
| var PluginGenerator = require("../generators/plugin-generator").PluginGenerator; | ||
| const yeoman = require("yeoman-environment"); | ||
| const PluginGenerator = require("../generators/plugin-generator").PluginGenerator; |
There was a problem hiding this comment.
Can you change to const { PluginGenerator } here as well?
There was a problem hiding this comment.
Can we use ES6 destructing now? Cool!
| var someOtherVar = somethingElse; | ||
| var otherPackage = require('other-package'); | ||
| const packageName = require('package-name'); | ||
| const someOtherconst = somethingElse; |
There was a problem hiding this comment.
=> someOtherconstsomeOtherConst
|
@ev1stensberg Thanks for your update. I labeled the Pull Request so reviewers will review it again. @dhruvdutt Please review the new changes. |
|
@ev1stensberg The tests look fine, but there are code style issue in your Pull Request. Please review the following: See complete report here. |
What kind of change does this PR introduce?
Refactor, removed last references to
varDid you add tests for your changes?
No, but I updated one snapshot
If relevant, did you update the documentation?
No
Summary
Slowly moving to ES6
Does this PR introduce a breaking change?
No