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
Disable usage of var
.
#6639
Disable usage of var
.
#6639
Conversation
Adds `no-var` rule and runs `eslint --fix` across the codebase.
Strict mode is required for using `const` / `let` in module scope under Node 4. We had previously disabled strict mode requirement for `blueprints/` directory, due to the fact that the majority of files were actually intended for the browser and are already receiving a global use strict. This removes the `blueprints/.eslintrc.js` override and fixes the resulting errors regarding missing `'use strict';` in each of the blueprint files.
const uniq = require('ember-cli-lodash-subset').uniq; | ||
const SilentError = require('silent-error'); | ||
const sortPackageJson = require('sort-package-json'); | ||
let date = new Date(); |
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.
i would expect this also to be const
does the linting prevent this?
e.g. something that we want to share over a large context, and would prefer for the binding to not accidentally change.
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.
@stefanpenner - The linting rules absolutely still allow us to use const
there, but I used the basic heuristic of "if its a require
then make it const
" to automate these changes and this one just ended up being a let
.
Once we land this we should start reviewing "whats left" and fixing things like this one...
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.
sounds great.
We shouldn't let this sit for long, but lets make sure we coordinate with @nathanhammond re: landing this in a way thats aligned with his plan here. (He thought about it thoroughly, don't want to mis some aspect of his plan) If that is already done, |
@stefanpenner - Yep, @Turbo87 @nathanhammond and I circled the wagons last night and are on the same page. We basically want to get all of this "large scale refactoring" done and out of the way before branch point into 2.12's beta cycle. |
@homu r+ |
📌 Commit 19dbd27 has been approved by |
⚡ Test exempted - status |
Disable usage of `var`. * Prefer `const` for `require`'s * Prefer `let` for everything else.
const
forrequire
'slet
for everything else.