-
Notifications
You must be signed in to change notification settings - Fork 154
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
Fixes #662: exchange var for const of require statements in src/filesystem/interface.js #668
Conversation
Changed decleration of import files from var to const in interface.js
Codecov Report
@@ Coverage Diff @@
## master #668 +/- ##
==========================================
- Coverage 86.71% 86.63% -0.08%
==========================================
Files 16 16
Lines 1746 1736 -10
==========================================
- Hits 1514 1504 -10
Misses 232 232
Continue to review full report at Codecov.
|
I don't disagree with any of the changes made, but there there are still more stuff in the file that could be changed. |
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 a good start, nice work. I left some things to address. Also, can you also dig into the rest of the file, and also fix those uses of var
?
NOTE: you can git add
, git commit
and git push
again on this same branch, and it will add more to this pull request.
src/filesystem/interface.js
Outdated
var FS_PENDING = Constants.FS_PENDING; | ||
var FS_ERROR = Constants.FS_ERROR; | ||
var FS_NODUPEIDCHECK = Constants.FS_NODUPEIDCHECK; | ||
const Constants = require('../constants.js'); |
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.
Let's use destructing assignment here, since we're pulling a bunch of stuff off Constants
:
const {
FILE_SYSTEM_NAME,
FS_FORMAT,
...
} = require('../constants.js');
@@ -1,30 +1,30 @@ | |||
var { promisify } = require('es6-promisify'); |
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 add use strict
; to the top of this file please?
@humphd Thank you for the recommendations, I've made all the additions you requested. Let me know if there is still more that needs to be 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.
This was a big file to take on, with lots of changes needed. Nice job. I've left some comments on things you can improve next time, and some things to fix now.
Please update this, and let me know when you've pushed the fixes so I can re-review and hopefully merge.
|
||
// node.js supports a calling pattern that leaves off a callback. | ||
function maybeCallback(callback) { | ||
if(typeof callback === 'function') { | ||
if (typeof callback === 'function') { |
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.
In general, be careful of this kind of thing (i.e., changing formatting in lines unrelated to your actual changes). We call this a "spurious whitespace change" and open source projects tend to want to avoid it, since it masks the history of this line of code, making it look like it was changed here by you, when actually it was just a formatting fix.
I'll allow it this time, but be aware that it's not generally a good idea. If your editor did it automatically, I'd disable that.
@humphd Thank you again for the input! I believe all is in order 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.
Nice.
Changed decleration of import files from var to const in interface.js