-
Notifications
You must be signed in to change notification settings - Fork 90
Feature/eslint #831
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
Feature/eslint #831
Conversation
Is there anything now blocking this PR from being reviewed and merged? |
As far as I understand by #830 (comment), this PR is waiting for others to be merged first (#849 and maybe #854) |
@fgalan - Given the lack of movement on #849, I guess it would make more sense to move this up the queue. #854 is dependent on #849 so would come after the others. So I'd suggest processing in the following order - #831 , #849 then #854 It's just that there isn't much of a queue at the moment (since the last period of activity has cleared a of of small PRs) so it would make sense to use this opportunity to get the broad ES6 change in whilst the "lull" occurs. |
I have updated the table at #830 (comment) based on your feedback. In addition, I have asked other PRs authors about what they think about merging #831 before theirs. If they agree (or if they don't answer in a reasonable time, assuming in that case they are missing in action :) I think we can finally progress and eventually merge PR #831 |
@fgalan @AlvaroVega - Any chance this will be actioned before its upcoming first birthday? 🍰 |
@@ -38,7 +37,7 @@ function raise(alarmName, description) { | |||
if (!alarmRepository[alarmName]) { | |||
alarmRepository[alarmName] = { | |||
name: alarmName, | |||
description: description | |||
description |
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.
are your sure about this 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.
EsLint and Prettier are. This is standard syntax for ES6.
config.getCommandRegistry().removeFromDate( | ||
Date.now() - config.getConfig().pollingExpiration, | ||
function(error, results) { | ||
config |
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'm not sure if this way is more easy to read....
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.
Automated change - take it up with the guys at Prettier. 😄 This syntax has already been applied across the IoT Agents themselves the only hold out is the IoT-Node-lib so this is the one that isn't standardized.
I have reviewed and the only pending item is #601, but given the author seems to be MIA (Missing In Action :) as he doesn't answer to the question about adapting his PR after merging the lint changes, I think we can skip it and GO.
We are near to close a new version of the iotagent-node-lib (along with some other agents). We will wait until that release (we hope that some days or a week maybe) before merging the eslint contribution (in fact, the eslint contribution could be the first PR to be merged in the new version development cycle). |
2.14.0 has been already released (https://github.com/telefonicaid/iotagent-node-lib/releases/tag/2.14.0) Thus, this PR would be ready to be merged, once the conflict with master gets solved. |
# Conflicts: # CHANGES_NEXT_RELEASE # lib/services/northBound/deviceProvisioningServer.js
lib/errors.js
Outdated
* or (at your option) any later version. | ||
* or { | ||
constructor(at your option) any later 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.
Typo?
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.
Fixed ae4416e
"plugins": ["prettier"], | ||
"rules": { | ||
"prettier/prettier": "error", | ||
"no-shadow": 0, |
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.
Comparing with the .eslintrc.json file in IOTA-JSON .eslintrc.json repo, this setting has been added here.
Which effect does it have in the eslint rules?
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 reasoning it was added here - the latest version of eslint complains about Telefonica style callbacks in the code (it wants the callback
variable name to be unique) hence the shadowed variable name rule must be dropped. This is only due to the updates to a more modern Eslint
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.
Thanks for the clarification.
So, I understand that "no-shadow": 0
is the desired setting and the repos not using it (if any) should be fixed. Out of the scope of this PR, of course.
NTC
"prettier": "prettier --config .prettierrc.json --write '**/**/**/**/*.js' '**/**/**/*.js' '**/**/*.js' '**/*.js' '*.js'", | ||
"prettier:text": "prettier 'README.md' 'doc/*.md' 'doc/**/*.md' --no-config --tab-width 4 --print-width 120 --write --prose-wrap always", |
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.
Are the new targets (prettier and prettier:text) included in the corresponding .md describing the different targets? Maybe yes, but it's a bit hard to find it in so large PR :) Could you help providing a pointer, 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.
Fixed ea6d399
Co-authored-by: Fermín Galán Márquez <[email protected]>
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.
LGTM
It has been hard, but in the end, the PR is fine and we have found a good lull moment for it. Thanks for all your contributions!
|
Incorporates and supercedes #753
Related: #830