-
Notifications
You must be signed in to change notification settings - Fork 122
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
var => let/const #452
var => let/const #452
Conversation
hhmmm.. it seems that in 87d3cde eslint also removed the double negations 😕 All the tests are passing, but I've added the
|
…' into f/var-let-const-436
Hi, If you are happy and all is green, feel free to remove the WIP tag and leave it to me. I am in favour of removing the unnecessary double negations and I believe eslint tried to do that: for some I see it removed them, for some I still see them - but I definitely will spend some time to check them one by one. In case it turns out to be too much of a work, I can still make a separate PR for that and then we can merge this later so that it has less moving parts 👍 |
Removed I'm creating another PR setting |
@elboletaire instead of having an |
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.
Nice! Thanks @elboletaire
client/src/href-builder.js
Outdated
@@ -22,8 +22,8 @@ module.exports = function(config){ | |||
throw settings.missingComponentName; | |||
} | |||
|
|||
var lang = options.headers['accept-language'], | |||
forwardLang = config.forwardAcceptLanguageToClient === true; | |||
const lang = options.headers['accept-language']; |
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.
❤️ so much better :)
client/src/href-builder.js
Outdated
registryUrl = clientRenderingEndpoint, | ||
registrySegment = registryUrl.slice(-1) === '/' ? registryUrl : (registryUrl + '/'), | ||
qs = !!component.parameters ? ('/?' + querystring.stringify(component.parameters)) : ''; | ||
const versionSegment = component.version ? ('/' + component.version) : '', |
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 personally find those multiple assignments pretty annoying, can we have a pr in the future to remove them ? 😈 😅 😃
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.
lol yes, indeed
each: function(obj, fn){ | ||
if(_.isArray(obj)){ | ||
for(var i = 0; i < obj.length; i++){ | ||
for(let i = 0; i < obj.length; i++){ |
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.
❤️
@@ -1,7 +1,7 @@ | |||
'use strict'; | |||
|
|||
function addProperties(source, destination) { | |||
for (var key in source) { | |||
for (const key in source) { |
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.
interesting, I would have imagined this to be a let...
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.
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.
ah...not all loops are born equals..
About the Now that we speak about the files in the root folder... why that |
True. But yes, for now on we can keep it, and yes, now that you mention I would like if we get rid of grunt down the road, but definitely not a priority. |
@nickbalestra casually today (well, for me it was yesterday, it's 2am here now) I've been at nodeconf (Barcelona) and I discovered this package: https://github.com/semantic-release/semantic-release which, if I'm not wrong, only relies on git and a npm registry. |
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.
Just 2 little changes. Everything else looks good.
@@ -1,6 +1,6 @@ | |||
'use strict'; |
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.
This is client-side code that then gets uglified by jade import - when making this switch the uglification fails :(
Can we add a file ignore for this rule in this file please?
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.
Sure. It's strange because there were some client files that crashed setting const
and let
due to the use strict
, but not these two files 😕
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.
Done
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.
Yeah, I realised the UI wasn't covered by any tests so I managed to discover this manually. To facilitate testing, I created a separate PR to add a couple of test: #455 - so this should not happen again in the future ;)
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.
Nice
@@ -1,45 +1,45 @@ | |||
'use strict'; |
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.
Same here, client side code that should stay with var for now
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.
Done
Both |
…/oc into f/var-let-const-436
Thanks for working on this @elboletaire 👍 |
Closes #436
Note that #450 must be merged first (this branch has been created from that PR branch).