From add69cf9a4d18823ecd3c7013f992b85e0cfa97a Mon Sep 17 00:00:00 2001 From: Andrey Sitnik Date: Sat, 23 Jun 2018 18:12:30 +0300 Subject: [PATCH 1/2] [New] Add ESLint 5 support --- .travis.yml | 7 +++++++ appveyor.yml | 6 ++++++ config/recommended.js | 3 +-- package.json | 4 ++-- tests/src/rules/namespace.js | 4 +--- 5 files changed, 17 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8d2b2d7ea..ea8c60a59 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,7 @@ node_js: os: linux env: + - ESLINT_VERSION=5 - ESLINT_VERSION=4 - ESLINT_VERSION=3 - ESLINT_VERSION=2 @@ -31,6 +32,9 @@ matrix: node_js: 6 - env: PACKAGE=resolvers/webpack node_js: 4 + - os: osx + env: ESLINT_VERSION=5 + node_js: 10 - os: osx env: ESLINT_VERSION=4 node_js: 8 @@ -40,6 +44,9 @@ matrix: - os: osx env: ESLINT_VERSION=2 node_js: 4 + exclude: + - node_js: '4' + env: ESLINT_VERSION=5 before_install: - 'nvm install-latest-npm' diff --git a/appveyor.yml b/appveyor.yml index b2e2a2d31..0176e1254 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,10 +1,16 @@ # Test against this version of Node.js environment: matrix: + - nodejs_version: "10" - nodejs_version: "8" - nodejs_version: "6" - nodejs_version: "4" +matrix: + fast_finish: true + allow_failures: + - nodejs_version: "4" # for eslint 5 + # platform: # - x86 # - x64 diff --git a/config/recommended.js b/config/recommended.js index a72a8b13d..70514eed3 100644 --- a/config/recommended.js +++ b/config/recommended.js @@ -23,7 +23,6 @@ module.exports = { // all of them) parserOptions: { sourceType: 'module', - ecmaVersion: 6, - ecmaFeatures: { experimentalObjectRestSpread: true }, + ecmaVersion: 2018, }, } diff --git a/package.json b/package.json index 6e0df24f2..968e21781 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "chai": "^3.5.0", "coveralls": "^3.0.0", "cross-env": "^4.0.0", - "eslint": "2.x - 4.x", + "eslint": "2.x - 5.x", "eslint-import-resolver-node": "file:./resolvers/node", "eslint-import-resolver-typescript": "^1.0.2", "eslint-import-resolver-webpack": "file:./resolvers/webpack", @@ -70,7 +70,7 @@ "typescript-eslint-parser": "^15.0.0" }, "peerDependencies": { - "eslint": "2.x - 4.x" + "eslint": "2.x - 5.x" }, "dependencies": { "contains-path": "^0.1.0", diff --git a/tests/src/rules/namespace.js b/tests/src/rules/namespace.js index 19a69a8d9..1cfee2b54 100644 --- a/tests/src/rules/namespace.js +++ b/tests/src/rules/namespace.js @@ -96,9 +96,7 @@ const valid = [ test({ code: `import * as names from './named-exports'; const {a, b, ...rest} = names;`, parserOptions: { - ecmaFeatures: { - experimentalObjectRestSpread: true, - }, + ecmaVersion: 2018, }, }), test({ From 9db789b3582037f55ebfface305d1f5ce2cf2e5b Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 24 Jun 2018 00:43:25 -0700 Subject: [PATCH 2/2] [Fix] `namespace`: ensure this rule works in ES2018 --- src/rules/namespace.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rules/namespace.js b/src/rules/namespace.js index 71dd57db8..93e589159 100644 --- a/src/rules/namespace.js +++ b/src/rules/namespace.js @@ -161,7 +161,7 @@ module.exports = { if (pattern.type !== 'ObjectPattern') return for (let property of pattern.properties) { - if (property.type === 'ExperimentalRestProperty') { + if (property.type === 'ExperimentalRestProperty' || !property.key) { continue }