chore(eslint): added eslint-node-plugin#3652
Conversation
| sourceMap.sourceRoot = options.sourceRoot || ""; | ||
| sourceMap.file = module.id + ".js"; | ||
| var footer = self.sourceMapComment.replace(/\[url\]/g, "data:application/json;charset=utf-8;base64," + new Buffer(JSON.stringify(sourceMap)).toString("base64")); | ||
| var footer = self.sourceMapComment.replace(/\[url\]/g, "data:application/json;charset=utf-8;base64," + Buffer.from(JSON.stringify(sourceMap)).toString("base64")); |
There was a problem hiding this comment.
new Buffer() has been deprecated since node 6. So Using Buffer.from()
There was a problem hiding this comment.
Buffer.from is not existed on node@v4
There was a problem hiding this comment.
It does infact exist on node 4.7>.
There was a problem hiding this comment.
Yup this got reverted!
| options.plugins.push(new ProvidePlugin(name, value)); | ||
| }); | ||
|
|
||
| ifBooleanArg("labeled-modules", function() { |
There was a problem hiding this comment.
Why to remove this? Should the removal be a separate PR?
There was a problem hiding this comment.
So this is because The file doesn't exist. This was also a lint error.
| @@ -321,7 +321,7 @@ Compiler.prototype.emitAssets = function(compilation, callback) { | |||
| } | |||
| var content = source.source(); | |||
| if(!Buffer.isBuffer(content)) | |||
There was a problem hiding this comment.
I would force braces with ifs (separate PR) as the form without can hide errors easily.
There was a problem hiding this comment.
Yes thats a good idea
There was a problem hiding this comment.
I'll do that in a separate PR. Otherwise looks good?
There was a problem hiding this comment.
Maybe "curly": ["error", "multi-line", "consistent"], to still allow for short ifs that cannot visually be confused with a block?
|
Rerunning travis to make sure the PR hook was just a flake run. Otherwise maybe related to yarn PR merge. |
What kind of change does this PR introduce?
Refactor, ESLINT ❤️
Did you add tests for your changes?
None needed!
If relevant, link to documentation update:
N/A
Summary
Because we have to support node >=4.7 we need to have a easy way to ensure that all linting and node api features are correctly in place.
This PR adds eslint-node-plugin which allows us to essentially have our
engineproperty set, and then get intelligent and appropriate linting settings with the exact "ecmaFeatures" that we are looking for. Aside from that I fixed any lint warnings in master. Now folks will be forced to add "use strict"Does this PR introduce a breaking change?
No.
Other information