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: use eslint-plugin-node (refs #6407) #6862
Conversation
LGTM |
LGTM, waiting for others to review. |
Do the new path-util functions need tests? (Maybe I missed them?) |
@@ -82,7 +83,7 @@ function printResults(engine, results, format, outputFile) { | |||
if (outputFile) { | |||
const filePath = path.resolve(process.cwd(), outputFile); | |||
|
|||
if (fs.existsSync(filePath) && fs.statSync(filePath).isDirectory()) { | |||
if (pathUtil.isDirectory(filePath)) { |
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 a bunch of places when dealing with config we use shelljs to check if it's a file, I think there was a reason why we did that instead of using fs. @gyandeeps do you remember? Should we use shelljs everywhere or fs? It would be good if we just use pathUtil for this everywhere.
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.
Good catch.
If I replace pathUtil by shell.test("-d"
and shell.test("-f"
, I don't need to add new functions.
Agree with @platinumazure Needs tests for isFile and isDirectory, otherwise LGTM. |
Ah, sorry. I have forgotten tests for the added functions. |
- To warn unsupported ecma features of Node 4. - To prevent a use of deprecated API. - etc.
4e25964
to
104f831
Compare
LGTM |
I removed |
LGTM, but waiting another day for others to look |
LGTM. Pretty sure the AppVeyor failure is the too many arguments issue that gyandeeps has since fixed, so hopefully this is safe to merge. |
Refs #6407.
This PR enables eslint-plugin-node to lint our codebase.
This would help us:
require(...)
.require(...)
.Also, this PR removes some uses of deprecated API.
util.isArray
fs.existsSync