Merge pull request #423 from ueokande/greenkeeper/eslint-5.0.1

Update eslint
jh-changes
Shin'ya Ueoka 6 years ago committed by GitHub
commit d0c23587f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      .eslintrc
  2. 15
      e2e/ambassador/src/client/keys.js
  3. 454
      package-lock.json
  4. 3
      package.json
  5. 2
      src/background/components/operation.js
  6. 5
      src/background/reducers/find.js
  7. 5
      src/background/reducers/index.js
  8. 6
      src/background/reducers/setting.js
  9. 51
      src/console/reducers/index.js
  10. 2
      src/content/actions/operation.js
  11. 7
      src/content/actions/setting.js
  12. 15
      src/content/reducers/addon.js
  13. 5
      src/content/reducers/find.js
  14. 20
      src/content/reducers/follow-controller.js
  15. 5
      src/content/reducers/index.js
  16. 10
      src/content/reducers/input.js
  17. 2
      src/content/reducers/setting.js
  18. 2
      src/settings/components/form/keymaps-form.jsx
  19. 2
      src/settings/components/form/properties-form.jsx
  20. 4
      src/settings/components/form/search-form.jsx
  21. 16
      src/settings/components/index.jsx
  22. 6
      src/shared/settings/storage.js
  23. 6
      src/shared/settings/values.js
  24. 2
      webpack.config.js

@ -29,6 +29,7 @@
"id-length": "off", "id-length": "off",
"indent": ["error", 2], "indent": ["error", 2],
"jsx-quotes": ["error", "prefer-single"], "jsx-quotes": ["error", "prefer-single"],
"max-classes-per-file": "off",
"max-params": ["error", 5], "max-params": ["error", 5],
"max-statements": ["error", 15], "max-statements": ["error", 15],
"multiline-comment-style": "off", "multiline-comment-style": "off",

@ -4,28 +4,25 @@ import * as ipc from './ipc';
const NEUTRAL_MODIFIERS = { shiftKey: false, altKey: false, ctrlKey: false }; const NEUTRAL_MODIFIERS = { shiftKey: false, altKey: false, ctrlKey: false };
const press = (tabId, key, modifiers = NEUTRAL_MODIFIERS) => { const press = (tabId, key, modifiers = NEUTRAL_MODIFIERS) => {
return ipc.send(Object.assign({}, modifiers, { return ipc.send({ ...modifiers,
type: EVENT_KEYPRESS, type: EVENT_KEYPRESS,
tabId, tabId,
key, key, });
}));
}; };
const down = (tabId, key, modifiers = NEUTRAL_MODIFIERS) => { const down = (tabId, key, modifiers = NEUTRAL_MODIFIERS) => {
return ipc.send(Object.assign({}, modifiers, { return ipc.send({ modifiers,
type: EVENT_KEYDOWN, type: EVENT_KEYDOWN,
tabId, tabId,
key, key, });
}));
}; };
const up = (tabId, key, modifiers = NEUTRAL_MODIFIERS) => { const up = (tabId, key, modifiers = NEUTRAL_MODIFIERS) => {
return ipc.send(Object.assign({}, modifiers, { return ipc.send({ modifiers,
type: EVENT_KEYUP, type: EVENT_KEYUP,
tabId, tabId,
key, key, });
}));
}; };
export { press, down, up }; export { press, down, up };

454
package-lock.json generated

@ -1436,6 +1436,28 @@
"trim-right": "^1.0.1" "trim-right": "^1.0.1"
} }
}, },
"babel-helper-bindify-decorators": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-helper-bindify-decorators/-/babel-helper-bindify-decorators-6.24.1.tgz",
"integrity": "sha1-FMGeXxQte0fxmlJDHlKxzLxAozA=",
"dev": true,
"requires": {
"babel-runtime": "^6.22.0",
"babel-traverse": "^6.24.1",
"babel-types": "^6.24.1"
}
},
"babel-helper-builder-binary-assignment-operator-visitor": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz",
"integrity": "sha1-zORReto1b0IgvK6KAsKzRvmlZmQ=",
"dev": true,
"requires": {
"babel-helper-explode-assignable-expression": "^6.24.1",
"babel-runtime": "^6.22.0",
"babel-types": "^6.24.1"
}
},
"babel-helper-builder-react-jsx": { "babel-helper-builder-react-jsx": {
"version": "6.26.0", "version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.26.0.tgz", "resolved": "https://registry.npmjs.org/babel-helper-builder-react-jsx/-/babel-helper-builder-react-jsx-6.26.0.tgz",
@ -1447,6 +1469,65 @@
"esutils": "^2.0.2" "esutils": "^2.0.2"
} }
}, },
"babel-helper-explode-assignable-expression": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz",
"integrity": "sha1-8luCz33BBDPFX3BZLVdGQArCLKo=",
"dev": true,
"requires": {
"babel-runtime": "^6.22.0",
"babel-traverse": "^6.24.1",
"babel-types": "^6.24.1"
}
},
"babel-helper-explode-class": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-helper-explode-class/-/babel-helper-explode-class-6.24.1.tgz",
"integrity": "sha1-fcKjkQ3uAHBW4eMdZAztPVTqqes=",
"dev": true,
"requires": {
"babel-helper-bindify-decorators": "^6.24.1",
"babel-runtime": "^6.22.0",
"babel-traverse": "^6.24.1",
"babel-types": "^6.24.1"
}
},
"babel-helper-function-name": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz",
"integrity": "sha1-00dbjAPtmCQqJbSDUasYOZ01gKk=",
"dev": true,
"requires": {
"babel-helper-get-function-arity": "^6.24.1",
"babel-runtime": "^6.22.0",
"babel-template": "^6.24.1",
"babel-traverse": "^6.24.1",
"babel-types": "^6.24.1"
}
},
"babel-helper-get-function-arity": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz",
"integrity": "sha1-j3eCqpNAfEHTqlCQj4mwMbG2hT0=",
"dev": true,
"requires": {
"babel-runtime": "^6.22.0",
"babel-types": "^6.24.1"
}
},
"babel-helper-remap-async-to-generator": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz",
"integrity": "sha1-XsWBgnrXI/7N04HxySg5BnbkVRs=",
"dev": true,
"requires": {
"babel-helper-function-name": "^6.24.1",
"babel-runtime": "^6.22.0",
"babel-template": "^6.24.1",
"babel-traverse": "^6.24.1",
"babel-types": "^6.24.1"
}
},
"babel-helpers": { "babel-helpers": {
"version": "6.24.1", "version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz", "resolved": "https://registry.npmjs.org/babel-helpers/-/babel-helpers-6.24.1.tgz",
@ -1477,12 +1558,128 @@
"babel-runtime": "^6.22.0" "babel-runtime": "^6.22.0"
} }
}, },
"babel-plugin-syntax-async-functions": {
"version": "6.13.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz",
"integrity": "sha1-ytnK0RkbWtY0vzCuCHI5HgZHvpU=",
"dev": true
},
"babel-plugin-syntax-async-generators": {
"version": "6.13.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-async-generators/-/babel-plugin-syntax-async-generators-6.13.0.tgz",
"integrity": "sha1-a8lj67FuzLrmuStZbrfzXDQqi5o=",
"dev": true
},
"babel-plugin-syntax-class-properties": {
"version": "6.13.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-class-properties/-/babel-plugin-syntax-class-properties-6.13.0.tgz",
"integrity": "sha1-1+sjt5oxf4VDlixQW4J8fWysJ94=",
"dev": true
},
"babel-plugin-syntax-decorators": {
"version": "6.13.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-decorators/-/babel-plugin-syntax-decorators-6.13.0.tgz",
"integrity": "sha1-MSVjtNvePMgGzuPkFszurd0RrAs=",
"dev": true
},
"babel-plugin-syntax-dynamic-import": {
"version": "6.18.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz",
"integrity": "sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo=",
"dev": true
},
"babel-plugin-syntax-exponentiation-operator": {
"version": "6.13.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz",
"integrity": "sha1-nufoM3KQ2pUoggGmpX9BcDF4MN4=",
"dev": true
},
"babel-plugin-syntax-jsx": { "babel-plugin-syntax-jsx": {
"version": "6.18.0", "version": "6.18.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz", "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz",
"integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=", "integrity": "sha1-CvMqmm4Tyno/1QaeYtew9Y0NiUY=",
"dev": true "dev": true
}, },
"babel-plugin-syntax-object-rest-spread": {
"version": "6.13.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-object-rest-spread/-/babel-plugin-syntax-object-rest-spread-6.13.0.tgz",
"integrity": "sha1-/WU28rzhODb/o6VFjEkDpZe7O/U=",
"dev": true
},
"babel-plugin-syntax-trailing-function-commas": {
"version": "6.22.0",
"resolved": "https://registry.npmjs.org/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz",
"integrity": "sha1-ugNgk3+NBuQBgKQ/4NVhb/9TLPM=",
"dev": true
},
"babel-plugin-transform-async-generator-functions": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-async-generator-functions/-/babel-plugin-transform-async-generator-functions-6.24.1.tgz",
"integrity": "sha1-8FiQAUX9PpkHpt3yjaWfIVJYpds=",
"dev": true,
"requires": {
"babel-helper-remap-async-to-generator": "^6.24.1",
"babel-plugin-syntax-async-generators": "^6.5.0",
"babel-runtime": "^6.22.0"
}
},
"babel-plugin-transform-async-to-generator": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz",
"integrity": "sha1-ZTbjeK/2yx1VF6wOQOs+n8jQh2E=",
"dev": true,
"requires": {
"babel-helper-remap-async-to-generator": "^6.24.1",
"babel-plugin-syntax-async-functions": "^6.8.0",
"babel-runtime": "^6.22.0"
}
},
"babel-plugin-transform-class-properties": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-class-properties/-/babel-plugin-transform-class-properties-6.24.1.tgz",
"integrity": "sha1-anl2PqYdM9NvN7YRqp3vgagbRqw=",
"dev": true,
"requires": {
"babel-helper-function-name": "^6.24.1",
"babel-plugin-syntax-class-properties": "^6.8.0",
"babel-runtime": "^6.22.0",
"babel-template": "^6.24.1"
}
},
"babel-plugin-transform-decorators": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-decorators/-/babel-plugin-transform-decorators-6.24.1.tgz",
"integrity": "sha1-eIAT2PjGtSIr33s0Q5Df13Vp4k0=",
"dev": true,
"requires": {
"babel-helper-explode-class": "^6.24.1",
"babel-plugin-syntax-decorators": "^6.13.0",
"babel-runtime": "^6.22.0",
"babel-template": "^6.24.1",
"babel-types": "^6.24.1"
}
},
"babel-plugin-transform-exponentiation-operator": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz",
"integrity": "sha1-KrDJx/MJj6SJB3cruBP+QejeOg4=",
"dev": true,
"requires": {
"babel-helper-builder-binary-assignment-operator-visitor": "^6.24.1",
"babel-plugin-syntax-exponentiation-operator": "^6.8.0",
"babel-runtime": "^6.22.0"
}
},
"babel-plugin-transform-object-rest-spread": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-object-rest-spread/-/babel-plugin-transform-object-rest-spread-6.26.0.tgz",
"integrity": "sha1-DzZpLVD+9rfi1LOsFHgTepY7ewY=",
"dev": true,
"requires": {
"babel-plugin-syntax-object-rest-spread": "^6.8.0",
"babel-runtime": "^6.26.0"
}
},
"babel-plugin-transform-react-jsx": { "babel-plugin-transform-react-jsx": {
"version": "6.24.1", "version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz", "resolved": "https://registry.npmjs.org/babel-plugin-transform-react-jsx/-/babel-plugin-transform-react-jsx-6.24.1.tgz",
@ -1523,6 +1720,31 @@
"babel-plugin-transform-react-jsx": "^6.0.2" "babel-plugin-transform-react-jsx": "^6.0.2"
} }
}, },
"babel-preset-stage-2": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-preset-stage-2/-/babel-preset-stage-2-6.24.1.tgz",
"integrity": "sha1-2eKWD7PXEYfw5k7sYrwHdnIZvcE=",
"dev": true,
"requires": {
"babel-plugin-syntax-dynamic-import": "^6.18.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-decorators": "^6.24.1",
"babel-preset-stage-3": "^6.24.1"
}
},
"babel-preset-stage-3": {
"version": "6.24.1",
"resolved": "https://registry.npmjs.org/babel-preset-stage-3/-/babel-preset-stage-3-6.24.1.tgz",
"integrity": "sha1-g2raCp56f6N8sTj7kyb4eTSkg5U=",
"dev": true,
"requires": {
"babel-plugin-syntax-trailing-function-commas": "^6.22.0",
"babel-plugin-transform-async-generator-functions": "^6.24.1",
"babel-plugin-transform-async-to-generator": "^6.24.1",
"babel-plugin-transform-exponentiation-operator": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.22.0"
}
},
"babel-register": { "babel-register": {
"version": "6.26.0", "version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz", "resolved": "https://registry.npmjs.org/babel-register/-/babel-register-6.26.0.tgz",
@ -4097,51 +4319,84 @@
} }
}, },
"eslint": { "eslint": {
"version": "4.19.1", "version": "5.0.1",
"resolved": "https://registry.npmjs.org/eslint/-/eslint-4.19.1.tgz", "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.0.1.tgz",
"integrity": "sha512-bT3/1x1EbZB7phzYu7vCr1v3ONuzDtX8WjuM9c0iYxe+cq+pwcKEoQjl7zd3RpC6YOLgnSy3cTN58M2jcoPDIQ==", "integrity": "sha512-D5nG2rErquLUstgUaxJlWB5+gu+U/3VDY0fk/Iuq8y9CUFy/7Y6oF4N2cR1tV8knzQvciIbfqfohd359xTLIKQ==",
"dev": true, "dev": true,
"requires": { "requires": {
"ajv": "^5.3.0", "ajv": "^6.5.0",
"babel-code-frame": "^6.22.0", "babel-code-frame": "^6.26.0",
"chalk": "^2.1.0", "chalk": "^2.1.0",
"concat-stream": "^1.6.0", "cross-spawn": "^6.0.5",
"cross-spawn": "^5.1.0",
"debug": "^3.1.0", "debug": "^3.1.0",
"doctrine": "^2.1.0", "doctrine": "^2.1.0",
"eslint-scope": "^3.7.1", "eslint-scope": "^4.0.0",
"eslint-visitor-keys": "^1.0.0", "eslint-visitor-keys": "^1.0.0",
"espree": "^3.5.4", "espree": "^4.0.0",
"esquery": "^1.0.0", "esquery": "^1.0.1",
"esutils": "^2.0.2", "esutils": "^2.0.2",
"file-entry-cache": "^2.0.0", "file-entry-cache": "^2.0.0",
"functional-red-black-tree": "^1.0.1", "functional-red-black-tree": "^1.0.1",
"glob": "^7.1.2", "glob": "^7.1.2",
"globals": "^11.0.1", "globals": "^11.5.0",
"ignore": "^3.3.3", "ignore": "^3.3.3",
"imurmurhash": "^0.1.4", "imurmurhash": "^0.1.4",
"inquirer": "^3.0.6", "inquirer": "^5.2.0",
"is-resolvable": "^1.0.0", "is-resolvable": "^1.1.0",
"js-yaml": "^3.9.1", "js-yaml": "^3.11.0",
"json-stable-stringify-without-jsonify": "^1.0.1", "json-stable-stringify-without-jsonify": "^1.0.1",
"levn": "^0.3.0", "levn": "^0.3.0",
"lodash": "^4.17.4", "lodash": "^4.17.5",
"minimatch": "^3.0.2", "minimatch": "^3.0.4",
"mkdirp": "^0.5.1", "mkdirp": "^0.5.1",
"natural-compare": "^1.4.0", "natural-compare": "^1.4.0",
"optionator": "^0.8.2", "optionator": "^0.8.2",
"path-is-inside": "^1.0.2", "path-is-inside": "^1.0.2",
"pluralize": "^7.0.0", "pluralize": "^7.0.0",
"progress": "^2.0.0", "progress": "^2.0.0",
"regexpp": "^1.0.1", "regexpp": "^1.1.0",
"require-uncached": "^1.0.3", "require-uncached": "^1.0.3",
"semver": "^5.3.0", "semver": "^5.5.0",
"string.prototype.matchall": "^2.0.0",
"strip-ansi": "^4.0.0", "strip-ansi": "^4.0.0",
"strip-json-comments": "~2.0.1", "strip-json-comments": "^2.0.1",
"table": "4.0.2", "table": "^4.0.3",
"text-table": "~0.2.0" "text-table": "^0.2.0"
}, },
"dependencies": { "dependencies": {
"acorn": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.1.tgz",
"integrity": "sha512-d+nbxBUGKg7Arpsvbnlq61mc12ek3EY8EQldM3GPAhWJ1UVxC6TDGbIvUMNU6obBX3i1+ptCIzV4vq0gFPEGVQ==",
"dev": true
},
"acorn-jsx": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-4.1.1.tgz",
"integrity": "sha512-JY+iV6r+cO21KtntVvFkD+iqjtdpRUpGqKWgfkCdZq1R+kbreEl8EcdcJR4SmiIgsIQT33s6QzheQ9a275Q8xw==",
"dev": true,
"requires": {
"acorn": "^5.0.3"
}
},
"ajv": {
"version": "6.5.1",
"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.5.1.tgz",
"integrity": "sha512-pgZos1vgOHDiC7gKNbZW8eKvCnNXARv2oqrGQT7Hzbq5Azp7aZG6DJzADnkuSq7RH6qkXp4J/m68yPX/2uBHyQ==",
"dev": true,
"requires": {
"fast-deep-equal": "^2.0.1",
"fast-json-stable-stringify": "^2.0.0",
"json-schema-traverse": "^0.4.1",
"uri-js": "^4.2.1"
}
},
"ajv-keywords": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.2.0.tgz",
"integrity": "sha1-6GuBnGAs+IIa1jdBNpjx3sAhhHo=",
"dev": true
},
"ansi-regex": { "ansi-regex": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
@ -4168,6 +4423,19 @@
"supports-color": "^5.3.0" "supports-color": "^5.3.0"
} }
}, },
"cross-spawn": {
"version": "6.0.5",
"resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz",
"integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==",
"dev": true,
"requires": {
"nice-try": "^1.0.4",
"path-key": "^2.0.1",
"semver": "^5.5.0",
"shebang-command": "^1.2.0",
"which": "^1.2.9"
}
},
"debug": { "debug": {
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
@ -4177,28 +4445,90 @@
"ms": "2.0.0" "ms": "2.0.0"
} }
}, },
"eslint-scope": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.0.tgz",
"integrity": "sha512-1G6UTDi7Jc1ELFwnR58HV4fK9OQK4S6N985f166xqXxpjU6plxFISJa2Ba9KCQuFa8RCnj/lSFJbHo7UFDBnUA==",
"dev": true,
"requires": {
"esrecurse": "^4.1.0",
"estraverse": "^4.1.1"
}
},
"espree": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/espree/-/espree-4.0.0.tgz",
"integrity": "sha512-kapdTCt1bjmspxStVKX6huolXVV5ZfyZguY1lcfhVVZstce3bqxH9mcLzNn3/mlgW6wQ732+0fuG9v7h0ZQoKg==",
"dev": true,
"requires": {
"acorn": "^5.6.0",
"acorn-jsx": "^4.1.1"
}
},
"esprima": { "esprima": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.0.tgz",
"integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==", "integrity": "sha512-oftTcaMu/EGrEIu904mWteKIv8vMuOgGYo7EhVJJN00R/EED9DCua/xxHRdYnKtcECzVg7xOWhflvJMnqcFZjw==",
"dev": true "dev": true
}, },
"fast-deep-equal": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz",
"integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=",
"dev": true
},
"globals": { "globals": {
"version": "11.5.0", "version": "11.7.0",
"resolved": "https://registry.npmjs.org/globals/-/globals-11.5.0.tgz", "resolved": "https://registry.npmjs.org/globals/-/globals-11.7.0.tgz",
"integrity": "sha512-hYyf+kI8dm3nORsiiXUQigOU62hDLfJ9G01uyGMxhc6BKsircrUhC4uJPQPUSuq2GrTmiiEt7ewxlMdBewfmKQ==", "integrity": "sha512-K8BNSPySfeShBQXsahYB/AbbWruVOTyVpgoIDnl8odPpeSfP2J5QO2oLFFdl2j7GfDCtZj2bMKar2T49itTPCg==",
"dev": true "dev": true
}, },
"inquirer": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-5.2.0.tgz",
"integrity": "sha512-E9BmnJbAKLPGonz0HeWHtbKf+EeSP93paWO3ZYoUpq/aowXvYGjjCSuashhXPpzbArIjBbji39THkxTz9ZeEUQ==",
"dev": true,
"requires": {
"ansi-escapes": "^3.0.0",
"chalk": "^2.0.0",
"cli-cursor": "^2.1.0",
"cli-width": "^2.0.0",
"external-editor": "^2.1.0",
"figures": "^2.0.0",
"lodash": "^4.3.0",
"mute-stream": "0.0.7",
"run-async": "^2.2.0",
"rxjs": "^5.5.2",
"string-width": "^2.1.0",
"strip-ansi": "^4.0.0",
"through": "^2.3.6"
}
},
"js-yaml": { "js-yaml": {
"version": "3.11.0", "version": "3.12.0",
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.11.0.tgz", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz",
"integrity": "sha512-saJstZWv7oNeOyBh3+Dx1qWzhW0+e6/8eDzo7p5rDFqxntSztloLtuKu+Ejhtq82jsilwOIZYsCz+lIjthg1Hw==", "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==",
"dev": true, "dev": true,
"requires": { "requires": {
"argparse": "^1.0.7", "argparse": "^1.0.7",
"esprima": "^4.0.0" "esprima": "^4.0.0"
} }
}, },
"json-schema-traverse": {
"version": "0.4.1",
"resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
"integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
"dev": true
},
"rxjs": {
"version": "5.5.11",
"resolved": "https://registry.npmjs.org/rxjs/-/rxjs-5.5.11.tgz",
"integrity": "sha512-3bjO7UwWfA2CV7lmwYMBzj4fQ6Cq+ftHc2MvUe+WMS7wcdJ1LosDWmdjPQanYp2dBRj572p7PeU81JUxHKOcBA==",
"dev": true,
"requires": {
"symbol-observable": "1.0.1"
}
},
"strip-ansi": { "strip-ansi": {
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
@ -4216,6 +4546,20 @@
"requires": { "requires": {
"has-flag": "^3.0.0" "has-flag": "^3.0.0"
} }
},
"table": {
"version": "4.0.3",
"resolved": "https://registry.npmjs.org/table/-/table-4.0.3.tgz",
"integrity": "sha512-S7rnFITmBH1EnyKcvxBh1LjYeQMmnZtCXSEbHcH6S0NoKit24ZuFO/T1vDcLdYsLQkM188PVVhQmzKIuThNkKg==",
"dev": true,
"requires": {
"ajv": "^6.0.1",
"ajv-keywords": "^3.0.0",
"chalk": "^2.1.0",
"lodash": "^4.17.4",
"slice-ansi": "1.0.0",
"string-width": "^2.1.1"
}
} }
} }
}, },
@ -5167,14 +5511,12 @@
"balanced-match": { "balanced-match": {
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"brace-expansion": { "brace-expansion": {
"version": "1.1.11", "version": "1.1.11",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"balanced-match": "^1.0.0", "balanced-match": "^1.0.0",
"concat-map": "0.0.1" "concat-map": "0.0.1"
@ -5189,20 +5531,17 @@
"code-point-at": { "code-point-at": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"concat-map": { "concat-map": {
"version": "0.0.1", "version": "0.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"console-control-strings": { "console-control-strings": {
"version": "1.1.0", "version": "1.1.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"core-util-is": { "core-util-is": {
"version": "1.0.2", "version": "1.0.2",
@ -5319,8 +5658,7 @@
"inherits": { "inherits": {
"version": "2.0.3", "version": "2.0.3",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.5",
@ -5332,7 +5670,6 @@
"version": "1.0.0", "version": "1.0.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"number-is-nan": "^1.0.0" "number-is-nan": "^1.0.0"
} }
@ -5347,7 +5684,6 @@
"version": "3.0.4", "version": "3.0.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"brace-expansion": "^1.1.7" "brace-expansion": "^1.1.7"
} }
@ -5355,14 +5691,12 @@
"minimist": { "minimist": {
"version": "0.0.8", "version": "0.0.8",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"minipass": { "minipass": {
"version": "2.2.4", "version": "2.2.4",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"safe-buffer": "^5.1.1", "safe-buffer": "^5.1.1",
"yallist": "^3.0.0" "yallist": "^3.0.0"
@ -5381,7 +5715,6 @@
"version": "0.5.1", "version": "0.5.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"minimist": "0.0.8" "minimist": "0.0.8"
} }
@ -5462,8 +5795,7 @@
"number-is-nan": { "number-is-nan": {
"version": "1.0.1", "version": "1.0.1",
"bundled": true, "bundled": true,
"dev": true, "dev": true
"optional": true
}, },
"object-assign": { "object-assign": {
"version": "4.1.1", "version": "4.1.1",
@ -5475,7 +5807,6 @@
"version": "1.4.0", "version": "1.4.0",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"wrappy": "1" "wrappy": "1"
} }
@ -5597,7 +5928,6 @@
"version": "1.0.2", "version": "1.0.2",
"bundled": true, "bundled": true,
"dev": true, "dev": true,
"optional": true,
"requires": { "requires": {
"code-point-at": "^1.0.0", "code-point-at": "^1.0.0",
"is-fullwidth-code-point": "^1.0.0", "is-fullwidth-code-point": "^1.0.0",
@ -11119,6 +11449,15 @@
"safe-regex": "^1.1.0" "safe-regex": "^1.1.0"
} }
}, },
"regexp.prototype.flags": {
"version": "1.2.0",
"resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz",
"integrity": "sha512-ztaw4M1VqgMwl9HlPpOuiYgItcHlunW0He2fE6eNfT6E/CF2FtYi9ofOYe4mKntstYk0Fyh/rDRBdS3AnxjlrA==",
"dev": true,
"requires": {
"define-properties": "^1.1.2"
}
},
"regexpp": { "regexpp": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-1.1.0.tgz",
@ -12943,6 +13282,19 @@
} }
} }
}, },
"string.prototype.matchall": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-2.0.0.tgz",
"integrity": "sha512-WoZ+B2ypng1dp4iFLF2kmZlwwlE19gmjgKuhL1FJfDgCREWb3ye3SDVHSzLH6bxfnvYmkCxbzkmWcQZHA4P//Q==",
"dev": true,
"requires": {
"define-properties": "^1.1.2",
"es-abstract": "^1.10.0",
"function-bind": "^1.1.1",
"has-symbols": "^1.0.0",
"regexp.prototype.flags": "^1.2.0"
}
},
"string_decoder": { "string_decoder": {
"version": "1.1.1", "version": "1.1.1",
"resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
@ -13068,6 +13420,12 @@
"whet.extend": "~0.9.9" "whet.extend": "~0.9.9"
} }
}, },
"symbol-observable": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.0.1.tgz",
"integrity": "sha1-g0D8RwLDEi310iKI+IKD9RPT/dQ=",
"dev": true
},
"table": { "table": {
"version": "4.0.2", "version": "4.0.2",
"resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz", "resolved": "https://registry.npmjs.org/table/-/table-4.0.2.tgz",

@ -26,9 +26,10 @@
"babel-eslint": "^8.2.3", "babel-eslint": "^8.2.3",
"babel-loader": "^7.1.4", "babel-loader": "^7.1.4",
"babel-preset-preact": "^1.1.0", "babel-preset-preact": "^1.1.0",
"babel-preset-stage-2": "^6.24.1",
"chai": "^4.1.2", "chai": "^4.1.2",
"css-loader": "^0.28.11", "css-loader": "^0.28.11",
"eslint": "^4.19.1", "eslint": "^5.0.1",
"eslint-plugin-react": "^7.8.2", "eslint-plugin-react": "^7.8.2",
"html-webpack-plugin": "^3.2.0", "html-webpack-plugin": "^3.2.0",
"karma": "^2.0.2", "karma": "^2.0.2",

@ -28,7 +28,7 @@ export default class BackgroundComponent {
} }
} }
// eslint-disable-next-line complexity // eslint-disable-next-line complexity, max-lines-per-function
exec(operation, tab) { exec(operation, tab) {
let tabState = this.store.getState().tab; let tabState = this.store.getState().tab;

@ -7,9 +7,8 @@ const defaultState = {
export default function reducer(state = defaultState, action = {}) { export default function reducer(state = defaultState, action = {}) {
switch (action.type) { switch (action.type) {
case actions.FIND_SET_KEYWORD: case actions.FIND_SET_KEYWORD:
return Object.assign({}, state, { return { ...state,
keyword: action.keyword, keyword: action.keyword, };
});
default: default:
return state; return state;
} }

@ -10,9 +10,8 @@ const defaultState = {
}; };
export default function reducer(state = defaultState, action = {}) { export default function reducer(state = defaultState, action = {}) {
return Object.assign({}, state, { return { ...state,
setting: settingReducer(state.setting, action), setting: settingReducer(state.setting, action),
find: findReducer(state.find, action), find: findReducer(state.find, action),
tab: tabReducer(state.tab, action), tab: tabReducer(state.tab, action), };
});
} }

@ -12,10 +12,8 @@ export default function reducer(state = defaultState, action = {}) {
}; };
case actions.SETTING_SET_PROPERTY: case actions.SETTING_SET_PROPERTY:
return { return {
value: Object.assign({}, state.value, { value: { ...state.value,
properties: Object.assign({}, state.value.properties, properties: { ...state.value.properties, [action.name]: action.value }}
{ [action.name]: action.value })
})
}; };
default: default:
return state; return state;

@ -51,68 +51,61 @@ const nextConsoleText = (completions, group, item, defaults) => {
return completions[group].items[item].content; return completions[group].items[item].content;
}; };
// eslint-disable-next-line max-lines-per-function
export default function reducer(state = defaultState, action = {}) { export default function reducer(state = defaultState, action = {}) {
switch (action.type) { switch (action.type) {
case actions.CONSOLE_HIDE: case actions.CONSOLE_HIDE:
return Object.assign({}, state, { return { ...state,
mode: '', mode: '', };
});
case actions.CONSOLE_SHOW_COMMAND: case actions.CONSOLE_SHOW_COMMAND:
return Object.assign({}, state, { return { ...state,
mode: 'command', mode: 'command',
consoleText: action.text, consoleText: action.text,
completions: [] completions: []};
});
case actions.CONSOLE_SHOW_FIND: case actions.CONSOLE_SHOW_FIND:
return Object.assign({}, state, { return { ...state,
mode: 'find', mode: 'find',
consoleText: '', consoleText: '',
completions: [] completions: []};
});
case actions.CONSOLE_SHOW_ERROR: case actions.CONSOLE_SHOW_ERROR:
return Object.assign({}, state, { return { ...state,
mode: 'error', mode: 'error',
messageText: action.text, messageText: action.text, };
});
case actions.CONSOLE_SHOW_INFO: case actions.CONSOLE_SHOW_INFO:
return Object.assign({}, state, { return { ...state,
mode: 'info', mode: 'info',
messageText: action.text, messageText: action.text, };
});
case actions.CONSOLE_HIDE_COMMAND: case actions.CONSOLE_HIDE_COMMAND:
return Object.assign({}, state, { return {
...state,
mode: state.mode === 'command' || state.mode === 'find' ? '' : state.mode, mode: state.mode === 'command' || state.mode === 'find' ? '' : state.mode,
}); };
case actions.CONSOLE_SET_CONSOLE_TEXT: case actions.CONSOLE_SET_CONSOLE_TEXT:
return Object.assign({}, state, { return { ...state,
consoleText: action.consoleText, consoleText: action.consoleText, };
});
case actions.CONSOLE_SET_COMPLETIONS: case actions.CONSOLE_SET_COMPLETIONS:
return Object.assign({}, state, { return { ...state,
completions: action.completions, completions: action.completions,
completionSource: action.completionSource, completionSource: action.completionSource,
groupSelection: -1, groupSelection: -1,
itemSelection: -1, itemSelection: -1, };
});
case actions.CONSOLE_COMPLETION_NEXT: { case actions.CONSOLE_COMPLETION_NEXT: {
let next = nextSelection(state); let next = nextSelection(state);
return Object.assign({}, state, { return { ...state,
groupSelection: next[0], groupSelection: next[0],
itemSelection: next[1], itemSelection: next[1],
consoleText: nextConsoleText( consoleText: nextConsoleText(
state.completions, next[0], next[1], state.completions, next[0], next[1],
state.completionSource), state.completionSource), };
});
} }
case actions.CONSOLE_COMPLETION_PREV: { case actions.CONSOLE_COMPLETION_PREV: {
let next = prevSelection(state); let next = prevSelection(state);
return Object.assign({}, state, { return { ...state,
groupSelection: next[0], groupSelection: next[0],
itemSelection: next[1], itemSelection: next[1],
consoleText: nextConsoleText( consoleText: nextConsoleText(
state.completions, next[0], next[1], state.completions, next[0], next[1],
state.completionSource), state.completionSource), };
});
} }
default: default:
return state; return state;

@ -8,7 +8,7 @@ import * as consoleFrames from 'content/console-frames';
import * as addonActions from './addon'; import * as addonActions from './addon';
import * as properties from 'shared/settings/properties'; import * as properties from 'shared/settings/properties';
// eslint-disable-next-line complexity // eslint-disable-next-line complexity, max-lines-per-function
const exec = (operation, repeat, settings) => { const exec = (operation, repeat, settings) => {
let smoothscroll = settings.properties.smoothscroll || let smoothscroll = settings.properties.smoothscroll ||
properties.defaults.smoothscroll; properties.defaults.smoothscroll;

@ -10,7 +10,7 @@ const reservedKeymaps = {
const set = (value) => { const set = (value) => {
let entries = []; let entries = [];
if (value.keymaps) { if (value.keymaps) {
let keymaps = Object.assign({}, value.keymaps, reservedKeymaps); let keymaps = { ...value.keymaps, ...reservedKeymaps };
entries = Object.entries(keymaps).map((entry) => { entries = Object.entries(keymaps).map((entry) => {
return [ return [
keyUtils.fromMapKeys(entry[0]), keyUtils.fromMapKeys(entry[0]),
@ -21,9 +21,8 @@ const set = (value) => {
return { return {
type: actions.SETTING_SET, type: actions.SETTING_SET,
value: Object.assign({}, value, { value: { ...value,
keymaps: entries, keymaps: entries, }
})
}; };
}; };

@ -7,17 +7,14 @@ const defaultState = {
export default function reducer(state = defaultState, action = {}) { export default function reducer(state = defaultState, action = {}) {
switch (action.type) { switch (action.type) {
case actions.ADDON_ENABLE: case actions.ADDON_ENABLE:
return Object.assign({}, state, { return { ...state,
enabled: true, enabled: true, };
});
case actions.ADDON_DISABLE: case actions.ADDON_DISABLE:
return Object.assign({}, state, { return { ...state,
enabled: false, enabled: false, };
});
case actions.ADDON_TOGGLE_ENABLED: case actions.ADDON_TOGGLE_ENABLED:
return Object.assign({}, state, { return { ...state,
enabled: !state.enabled, enabled: !state.enabled, };
});
default: default:
return state; return state;
} }

@ -8,10 +8,9 @@ const defaultState = {
export default function reducer(state = defaultState, action = {}) { export default function reducer(state = defaultState, action = {}) {
switch (action.type) { switch (action.type) {
case actions.FIND_SET_KEYWORD: case actions.FIND_SET_KEYWORD:
return Object.assign({}, state, { return { ...state,
keyword: action.keyword, keyword: action.keyword,
found: action.found, found: action.found, };
});
default: default:
return state; return state;
} }

@ -10,24 +10,20 @@ const defaultState = {
export default function reducer(state = defaultState, action = {}) { export default function reducer(state = defaultState, action = {}) {
switch (action.type) { switch (action.type) {
case actions.FOLLOW_CONTROLLER_ENABLE: case actions.FOLLOW_CONTROLLER_ENABLE:
return Object.assign({}, state, { return { ...state,
enabled: true, enabled: true,
newTab: action.newTab, newTab: action.newTab,
background: action.background, background: action.background,
keys: '', keys: '', };
});
case actions.FOLLOW_CONTROLLER_DISABLE: case actions.FOLLOW_CONTROLLER_DISABLE:
return Object.assign({}, state, { return { ...state,
enabled: false, enabled: false, };
});
case actions.FOLLOW_CONTROLLER_KEY_PRESS: case actions.FOLLOW_CONTROLLER_KEY_PRESS:
return Object.assign({}, state, { return { ...state,
keys: state.keys + action.key, keys: state.keys + action.key, };
});
case actions.FOLLOW_CONTROLLER_BACKSPACE: case actions.FOLLOW_CONTROLLER_BACKSPACE:
return Object.assign({}, state, { return { ...state,
keys: state.keys.slice(0, -1), keys: state.keys.slice(0, -1), };
});
default: default:
return state; return state;
} }

@ -14,11 +14,12 @@ const defaultState = {
}; };
export default function reducer(state = defaultState, action = {}) { export default function reducer(state = defaultState, action = {}) {
return Object.assign({}, state, { return {
...state,
addon: addonReducer(state.addon, action), addon: addonReducer(state.addon, action),
find: findReducer(state.find, action), find: findReducer(state.find, action),
setting: settingReducer(state.setting, action), setting: settingReducer(state.setting, action),
input: inputReducer(state.input, action), input: inputReducer(state.input, action),
followController: followControllerReducer(state.followController, action), followController: followControllerReducer(state.followController, action),
}); };
} }

@ -7,13 +7,11 @@ const defaultState = {
export default function reducer(state = defaultState, action = {}) { export default function reducer(state = defaultState, action = {}) {
switch (action.type) { switch (action.type) {
case actions.INPUT_KEY_PRESS: case actions.INPUT_KEY_PRESS:
return Object.assign({}, state, { return { ...state,
keys: state.keys.concat([action.key]), keys: state.keys.concat([action.key]), };
});
case actions.INPUT_CLEAR_KEYS: case actions.INPUT_CLEAR_KEYS:
return Object.assign({}, state, { return { ...state,
keys: [], keys: [], };
});
default: default:
return state; return state;
} }

@ -8,7 +8,7 @@ const defaultState = {
export default function reducer(state = defaultState, action = {}) { export default function reducer(state = defaultState, action = {}) {
switch (action.type) { switch (action.type) {
case actions.SETTING_SET: case actions.SETTING_SET:
return Object.assign({}, action.value); return { ...action.value };
default: default:
return state; return state;
} }

@ -100,7 +100,7 @@ class KeymapsForm extends Component {
return; return;
} }
let next = Object.assign({}, this.props.value); let next = { ...this.props.value };
next[e.target.name] = e.target.value; next[e.target.name] = e.target.value;
this.props.onChange(next); this.props.onChange(next);

@ -44,7 +44,7 @@ class PropertiesForm extends Component {
} }
let name = e.target.name; let name = e.target.name;
let next = Object.assign({}, this.props.value); let next = { ...this.props.value };
if (e.target.type.toLowerCase() === 'checkbox') { if (e.target.type.toLowerCase() === 'checkbox') {
next[name] = e.target.checked; next[name] = e.target.checked;
} else if (e.target.type.toLowerCase() === 'number') { } else if (e.target.type.toLowerCase() === 'number') {

@ -53,10 +53,10 @@ class SearchForm extends Component {
let value = this.props.value; let value = this.props.value;
let name = e.target.name; let name = e.target.name;
let index = e.target.getAttribute('data-index'); let index = e.target.getAttribute('data-index');
let next = Object.assign({}, { let next = {
default: value.default, default: value.default,
engines: value.engines ? value.engines.slice() : [], engines: value.engines ? value.engines.slice() : [],
}); };
if (name === 'name') { if (name === 'name') {
next.engines[index][0] = e.target.value; next.engines[index][0] = e.target.value;

@ -134,7 +134,7 @@ class SettingsComponent extends Component {
} }
validateValue(e) { validateValue(e) {
let next = Object.assign({}, this.state); let next = { ...this.state };
next.errors.json = ''; next.errors.json = '';
try { try {
@ -146,18 +146,16 @@ class SettingsComponent extends Component {
} }
bindForm(name, value) { bindForm(name, value) {
let next = Object.assign({}, this.state, { let next = { ...this.state,
settings: Object.assign({}, this.state.settings, { settings: { ...this.state.settings,
form: Object.assign({}, this.state.settings.form) form: { ...this.state.settings.form }}};
})
});
next.settings.form[name] = value; next.settings.form[name] = value;
this.setState(next); this.setState(next);
this.context.store.dispatch(settingActions.save(next.settings)); this.context.store.dispatch(settingActions.save(next.settings));
} }
bindValue(e) { bindValue(e) {
let next = Object.assign({}, this.state); let next = { ...this.state };
let error = false; let error = false;
next.errors.json = ''; next.errors.json = '';
@ -190,7 +188,7 @@ class SettingsComponent extends Component {
let form = settingsValues.formFromJson( let form = settingsValues.formFromJson(
this.state.settings.json, KeymapsForm.AllowdOps); this.state.settings.json, KeymapsForm.AllowdOps);
let next = Object.assign({}, this.state); let next = { ...this.state };
next.settings.form = form; next.settings.form = form;
next.settings.source = 'form'; next.settings.source = 'form';
next.errors.json = ''; next.errors.json = '';
@ -201,7 +199,7 @@ class SettingsComponent extends Component {
migrateToJson() { migrateToJson() {
let json = settingsValues.jsonFromForm(this.state.settings.form); let json = settingsValues.jsonFromForm(this.state.settings.form);
let next = Object.assign({}, this.state); let next = { ...this.state };
next.settings.json = json; next.settings.json = json;
next.settings.source = 'json'; next.settings.source = 'json';
next.errors.json = ''; next.errors.json = '';

@ -6,7 +6,7 @@ const loadRaw = async() => {
if (!settings) { if (!settings) {
return DefaultSettings; return DefaultSettings;
} }
return Object.assign({}, DefaultSettings, settings); return { ...DefaultSettings, ...settings };
}; };
const loadValue = async() => { const loadValue = async() => {
@ -20,9 +20,7 @@ const loadValue = async() => {
if (!value.properties) { if (!value.properties) {
value.properties = {}; value.properties = {};
} }
return Object.assign({}, return { ...settingsValues.valueFromJson(DefaultSettings.json), ...value };
settingsValues.valueFromJson(DefaultSettings.json),
value);
}; };
const save = (settings) => { const save = (settings) => {

@ -6,12 +6,12 @@ const operationFromFormName = (name) => {
if (argStr) { if (argStr) {
args = JSON.parse(argStr); args = JSON.parse(argStr);
} }
return Object.assign({ type }, args); return { type, ...args };
}; };
const operationToFormName = (op) => { const operationToFormName = (op) => {
let type = op.type; let type = op.type;
let args = Object.assign({}, op); let args = { ...op };
delete args.type; delete args.type;
if (Object.keys(args).length === 0) { if (Object.keys(args).length === 0) {
@ -83,7 +83,7 @@ const formFromValue = (value, allowedOps) => {
} }
} }
let formProperties = Object.assign({}, properties.defaults, value.properties); let formProperties = { ...properties.defaults, ...value.properties };
return { return {
keymaps, keymaps,

@ -24,7 +24,7 @@ config = {
exclude: /node_modules/, exclude: /node_modules/,
loader: 'babel-loader', loader: 'babel-loader',
query: { query: {
presets: ['preact'] presets: ['preact', 'stage-2']
} }
}, },
{ {