Skip to content

Commit

Permalink
Remove babel (#53)
Browse files Browse the repository at this point in the history
* remove babel, build scripts; update lint parser

* use ecmaVersion 2017, disable spread rule
  • Loading branch information
rekmarks authored Jul 27, 2020
1 parent fab806e commit 993dda8
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 1,633 deletions.
26 changes: 10 additions & 16 deletions merged-packages/json-rpc-engine/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
module.exports = {
root: true,

extends: [
'@metamask/eslint-config',
'@metamask/eslint-config/config/mocha',
'@metamask/eslint-config/config/nodejs',
],

parser: 'babel-eslint',

parserOptions: {
ecmaVersion: 2017,
ecmaFeatures: {
arrowFunctions: true,
classes: true,
experimentalObjectRestSpread: true,
},
},

plugins: [
'babel',
'json',
'import',
],

extends: [
'@metamask/eslint-config',
'@metamask/eslint-config/config/mocha',
'@metamask/eslint-config/config/nodejs',
],

rules: {
'prefer-object-spread': 'off',
},

overrides: [{
files: [
'.eslintrc.js',
Expand All @@ -32,6 +28,4 @@ module.exports = {
sourceType: 'script',
},
}],

ignorePatterns: ['dist'],
}
9 changes: 0 additions & 9 deletions merged-packages/json-rpc-engine/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
"scripts": {
"lint": "eslint . --ext js,json",
"lint:fix": "eslint . --ext js,json --fix",
"build": "babel src --out-dir dist",
"test": "mocha ./test",
"coverage": "nyc yarn test"
},
Expand All @@ -22,16 +21,8 @@
"safe-event-emitter": "^1.0.1"
},
"devDependencies": {
"@babel/cli": "^7.8.4",
"@babel/core": "^7.8.6",
"@babel/plugin-transform-runtime": "^7.8.3",
"@babel/preset-env": "^7.8.6",
"@babel/runtime": "^7.8.4",
"@metamask/eslint-config": "^2.1.0",
"babel-eslint": "^10.1.0",
"babelify": "^10.0.0",
"eslint": "^6.8.0",
"eslint-plugin-babel": "^5.3.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-json": "^2.1.0",
"eslint-plugin-mocha": "^6.3.0",
Expand Down
2 changes: 1 addition & 1 deletion merged-packages/json-rpc-engine/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ module.exports = class RpcEngine extends SafeEventEmitter {

_handle (_req, cb) {

const req = { ..._req }
const req = Object.assign({}, _req)
const res = {
id: req.id,
jsonrpc: req.jsonrpc,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ describe('idRemapMiddleware tests', function () {
})

const payload = { id: 1, jsonrpc: '2.0', method: 'hello' }
const payloadCopy = { ...payload }
const payloadCopy = Object.assign({}, payload)

engine.handle(payload, function (err, res) {
assert.ifError(err, 'did not error')
Expand Down
Loading

0 comments on commit 993dda8

Please sign in to comment.