From 711d75ac30091b4316d106a47378a53c8e312a4f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kan=20Axelsson?= Date: Mon, 19 Aug 2019 10:43:15 +0200 Subject: [PATCH] revert ESlint prefer-object-spread --- .eslintrc.json | 3 ++- commands/cdp/src/index.js | 5 ++--- commands/node/src/index.js | 4 ++-- commands/puppeteer/src/index.js | 2 +- commands/serve/src/index.js | 4 ++-- package.json | 2 +- packages/server/src/proxies.js | 2 +- packages/transform/src/index.js | 2 +- yarn.lock | 22 +++++++++++----------- 9 files changed, 23 insertions(+), 23 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 158e42a4..68a5d33d 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -53,7 +53,8 @@ "no-plusplus": 0, "no-new": 0, "import/no-unresolved": 0, - "max-classes-per-file": 0 + "max-classes-per-file": 0, + "prefer-object-spread": 0 }, "extends": ["airbnb"] } diff --git a/commands/cdp/src/index.js b/commands/cdp/src/index.js index 2586ba42..430d4de0 100644 --- a/commands/cdp/src/index.js +++ b/commands/cdp/src/index.js @@ -25,9 +25,9 @@ const cdp = { let config = {}; const foundConfig = require(configPath); if (typeof foundConfig === 'function') { - config = { ...foundConfig() }; + config = Object.assign({}, foundConfig()); } else { - config = { ...foundConfig }; + config = Object.assign({}, foundConfig); } return config; }) @@ -35,7 +35,6 @@ const cdp = { .coerce('transform', opt => { const exclude = [...new Set(opt.defaultExclude.concat(opt.exclude))]; opt.testExclude = testExclude({ include: opt.include, exclude }); - // eslint-disable-next-line prefer-object-spread opt.typescript.compilerOptions = Object.assign( { compilerOptions: {} }, importCwd.silent(path.resolve(opt.typescript.config)), diff --git a/commands/node/src/index.js b/commands/node/src/index.js index 4e21f00b..a3816e8f 100644 --- a/commands/node/src/index.js +++ b/commands/node/src/index.js @@ -264,9 +264,9 @@ const configure = configPath => { let config = {}; const foundConfig = require(configPath); if (typeof foundConfig === 'function') { - config = { ...foundConfig() }; + config = Object.assign({}, foundConfig()); } else { - config = { ...foundConfig }; + config = Object.assign({}, foundConfig); } return config; }; diff --git a/commands/puppeteer/src/index.js b/commands/puppeteer/src/index.js index 5224fa5b..3dabdbca 100755 --- a/commands/puppeteer/src/index.js +++ b/commands/puppeteer/src/index.js @@ -8,7 +8,7 @@ const nodeOptions = require('@after-work.js/node/src/options'); const utils = require('@after-work.js/utils'); const puppetOptions = require('./options'); -const options = { ...nodeOptions, ...puppetOptions }; +const options = Object.assign({}, nodeOptions, puppetOptions); class PuppetRunner extends Runner { constructor(puppeteer, argv, libs) { diff --git a/commands/serve/src/index.js b/commands/serve/src/index.js index 3de96fc7..76fea6c4 100644 --- a/commands/serve/src/index.js +++ b/commands/serve/src/index.js @@ -29,9 +29,9 @@ const server = { let config = {}; const foundConfig = require(configPath); if (typeof foundConfig === 'function') { - config = { ...foundConfig() }; + config = Object.assign({}, foundConfig()); } else { - config = { ...foundConfig }; + config = Object.assign({}, foundConfig); } return config; }); diff --git a/package.json b/package.json index 8d79184a..eed27ee6 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,7 @@ "babel-plugin-istanbul": "5.2.0", "coveralls": "3.0.6", "eslint": "6.1.0", - "eslint-config-airbnb": "18.0.1", + "eslint-config-airbnb": "17.1.1", "eslint-plugin-import": "2.18.2", "eslint-plugin-jsx-a11y": "6.2.3", "eslint-plugin-react": "7.14.3", diff --git a/packages/server/src/proxies.js b/packages/server/src/proxies.js index b7ff9a15..7a920148 100644 --- a/packages/server/src/proxies.js +++ b/packages/server/src/proxies.js @@ -22,7 +22,7 @@ const normalize = options => Object.keys(options).map(context => { target: options.proxy[context], }; } else { - proxyOptions = { ...options.proxy[context] }; + proxyOptions = Object.assign({}, options.proxy[context]); proxyOptions.context = correctedContext; } proxyOptions.logLevel = proxyOptions.logLevel || 'warn'; diff --git a/packages/transform/src/index.js b/packages/transform/src/index.js index 7c93849a..448d6144 100644 --- a/packages/transform/src/index.js +++ b/packages/transform/src/index.js @@ -109,7 +109,7 @@ function transformFile(filename, argv, content = null) { argv, ); content = tsContent; - babelOpts = { ...babelOpts, ...tsBabelOpts }; + babelOpts = Object.assign({}, babelOpts, tsBabelOpts); } babelOpts.ast = false; const { babel } = argv.babel; diff --git a/yarn.lock b/yarn.lock index 4ecc15fe..7374f332 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3853,7 +3853,7 @@ config-chain@^1.1.11: ini "^1.3.4" proto-list "~1.2.1" -confusing-browser-globals@^1.0.7: +confusing-browser-globals@^1.0.5: version "1.0.8" resolved "https://registry.yarnpkg.com/confusing-browser-globals/-/confusing-browser-globals-1.0.8.tgz#93ffec1f82a6e2bf2bc36769cc3a92fa20e502f3" integrity sha512-lI7asCibVJ6Qd3FGU7mu4sfG4try4LX3+GVS+Gv8UlrEf2AeW57piecapnog2UHZSbcX/P/1UDWVaTsblowlZg== @@ -4832,21 +4832,21 @@ escodegen@^1.8.0: optionalDependencies: source-map "~0.6.1" -eslint-config-airbnb-base@^14.0.0: - version "14.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.0.0.tgz#8a7bcb9643d13c55df4dd7444f138bf4efa61e17" - integrity sha512-2IDHobw97upExLmsebhtfoD3NAKhV4H0CJWP3Uprd/uk+cHuWYOczPVxQ8PxLFUAw7o3Th1RAU8u1DoUpr+cMA== +eslint-config-airbnb-base@^13.2.0: + version "13.2.0" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-13.2.0.tgz#f6ea81459ff4dec2dda200c35f1d8f7419d57943" + integrity sha512-1mg/7eoB4AUeB0X1c/ho4vb2gYkNH8Trr/EgCT/aGmKhhG+F6vF5s8+iRBlWAzFIAphxIdp3YfEKgEl0f9Xg+w== dependencies: - confusing-browser-globals "^1.0.7" + confusing-browser-globals "^1.0.5" object.assign "^4.1.0" object.entries "^1.1.0" -eslint-config-airbnb@18.0.1: - version "18.0.1" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-18.0.1.tgz#a3a74cc29b46413b6096965025381df8fb908559" - integrity sha512-hLb/ccvW4grVhvd6CT83bECacc+s4Z3/AEyWQdIT2KeTsG9dR7nx1gs7Iw4tDmGKozCNHFn4yZmRm3Tgy+XxyQ== +eslint-config-airbnb@17.1.1: + version "17.1.1" + resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-17.1.1.tgz#2272e0b86bb1e2b138cdf88d07a3b6f4cda3d626" + integrity sha512-xCu//8a/aWqagKljt+1/qAM62BYZeNq04HmdevG5yUGWpja0I/xhqd6GdLRch5oetEGFiJAnvtGuTEAese53Qg== dependencies: - eslint-config-airbnb-base "^14.0.0" + eslint-config-airbnb-base "^13.2.0" object.assign "^4.1.0" object.entries "^1.1.0"