From a8ca5bbfb04fded3723ffc81c43b9c6c38bc09db Mon Sep 17 00:00:00 2001
From: Thomas Sileghem
Date: Mon, 12 Jun 2017 14:30:56 +0100
Subject: [PATCH] chore(eslint): upgrade to eslint@4
---
.travis.yml | 10 +++++++++-
appveyor.yml | 8 ++++----
package.json | 2 +-
src/rules/no-named-default.js | 2 +-
tests/src/rules/default.js | 8 ++++++--
tests/src/rules/named.js | 2 +-
tests/src/utils.js | 7 ++++---
7 files changed, 26 insertions(+), 13 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index 67643e74cc..13e4afec85 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,9 +8,17 @@ os:
- linux
- osx
+env:
+ - ESLINT_VERSION=2
+ - ESLINT_VERSION=3
+ - ESLINT_VERSION=4
+
install:
- - npm -g install npm@3
+ - if [ ${TRAVIS_NODE_VERSION} == "4" ]; then
+ npm install -g npm@3;
+ fi
- npm install
+ - npm install eslint@$ESLINT_VERSION --ignore-scripts || true
# install all resolver deps
- "for resolver in ./resolvers/*; do cd $resolver && npm install && cd ../..; done"
diff --git a/appveyor.yml b/appveyor.yml
index 0e86dc9e7a..406099f667 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -14,11 +14,11 @@ install:
# Get the latest stable version of Node.js or io.js
- ps: Install-Product node $env:nodejs_version
- # update npm (only needed for Node 0.10)
- - npm -g install npm@3
- # - set PATH=%APPDATA%\npm;%PATH%
-
# install modules
+ - ps: >-
+ if ($env:nodejs_version -eq "4") {
+ npm install -g npm@3;
+ }
- npm install
# todo: learn how to do this for all .\resolvers\* on Windows
diff --git a/package.json b/package.json
index f39f562585..24f87d6021 100644
--- a/package.json
+++ b/package.json
@@ -74,7 +74,7 @@
"typescript-eslint-parser": "^2.1.0"
},
"peerDependencies": {
- "eslint": "2.x - 3.x"
+ "eslint": "2.x - 4.x"
},
"dependencies": {
"builtin-modules": "^1.1.1",
diff --git a/src/rules/no-named-default.js b/src/rules/no-named-default.js
index 3185157f30..0625c1f1ea 100644
--- a/src/rules/no-named-default.js
+++ b/src/rules/no-named-default.js
@@ -10,7 +10,7 @@ module.exports = {
if (im.type === 'ImportSpecifier' && im.imported.name === 'default') {
context.report({
node: im.local,
- message: `Use default import syntax to import \'${im.local.name}\'.` })
+ message: `Use default import syntax to import '${im.local.name}'.` })
}
})
},
diff --git a/tests/src/rules/default.js b/tests/src/rules/default.js
index 5186e56ca4..027c5a93de 100644
--- a/tests/src/rules/default.js
+++ b/tests/src/rules/default.js
@@ -58,8 +58,12 @@ ruleTester.run('default', rule, {
// #94: redux export of execution result,
test({ code: 'import connectedApp from "./redux"' }),
- test({ code: 'import App from "./jsx/App"'
- , ecmaFeatures: { jsx: true, modules: true } }),
+ test({
+ code: 'import App from "./jsx/App"',
+ parserOptions: {
+ ecmaFeatures: { jsx: true, modules: true },
+ },
+ }),
// from no-errors
test({
diff --git a/tests/src/rules/named.js b/tests/src/rules/named.js
index f1c40b4749..f027a5b3db 100644
--- a/tests/src/rules/named.js
+++ b/tests/src/rules/named.js
@@ -135,7 +135,7 @@ ruleTester.run('named', rule, {
test({
code: 'import { a } from "./re-export-names"',
- args: [2, 'es6-only'],
+ options: [2, 'es6-only'],
errors: [error('a', './re-export-names')],
}),
diff --git a/tests/src/utils.js b/tests/src/utils.js
index 7a13ed4329..144969f5b0 100644
--- a/tests/src/utils.js
+++ b/tests/src/utils.js
@@ -12,11 +12,12 @@ export const FILENAME = testFilePath('foo.js')
export function test(t) {
return Object.assign({
filename: FILENAME,
- parserOptions: {
+ }, t, {
+ parserOptions: Object.assign({
sourceType: 'module',
ecmaVersion: 6,
- },
- }, t)
+ }, t.parserOptions),
+ })
}
export function testContext(settings) {