diff --git a/.travis.yml b/.travis.yml index 67643e74c..13e4afec8 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 0e86dc9e7..406099f66 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 f39f56258..24f87d602 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 3185157f3..0625c1f1e 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 5186e56ca..027c5a93d 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 f1c40b474..f027a5b3d 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 7a13ed432..144969f5b 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) {