-
-
Notifications
You must be signed in to change notification settings - Fork 602
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(ES6): changed 'var' into 'const' where convenient #325
chore(ES6): changed 'var' into 'const' where convenient #325
Conversation
generator, | ||
templateDir, | ||
templateData | ||
) => /** @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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mutable object, but okay..
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It doesn't get reassigned, so const
is ok. Otherwise eslint would have failed :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The .push
method is mutating it, ( even though the push method is immutable ) but that's another thing :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minor comment otherwise LGTM 👍
lib/generate-loader/index.js
Outdated
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you change to const { PluginGenerator }
here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=> someOtherconst
someOtherConst
@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
var
Did 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