Skip to content

Commit

Permalink
Chore: Use ES2018 object spread syntax (#141)
Browse files Browse the repository at this point in the history
This syntax first shipped in Node.js v8.6.0 and removes a dependency on
`object-assign`.
  • Loading branch information
btmills authored Mar 1, 2020
1 parent f584cc6 commit 9aa1fdc
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 4 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ if (!fs.existsSync(SYMLINK_LOCATION)) {
module.exports = {
"root": true,

"parserOptions": {
"ecmaVersion": 2018
},

"plugins": [
PACKAGE_NAME
],
Expand Down
8 changes: 4 additions & 4 deletions lib/processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

"use strict";

const assign = require("object-assign");
const unified = require("unified");
const remarkParse = require("remark-parse");

Expand Down Expand Up @@ -244,11 +243,12 @@ function preprocess(text) {
previousNode = parent.children[index];
}

blocks.push(assign({}, node, {
blocks.push({
...node,
baseIndentText: getIndentText(text, node),
comments,
rangeMap: getBlockRangeMap(text, node, comments)
}));
});
}
}
});
Expand Down Expand Up @@ -312,7 +312,7 @@ function adjustBlock(block) {
};
}

return assign({}, message, out, adjustedFix);
return { ...message, ...out, ...adjustedFix };
};
}

Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
"nyc": "^14.1.1"
},
"dependencies": {
"object-assign": "^4.0.1",
"remark-parse": "^5.0.0",
"unified": "^6.1.2"
},
Expand Down

0 comments on commit 9aa1fdc

Please sign in to comment.