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..bac982a155 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,9 +1,23 @@ # Test against this version of Node.js environment: matrix: - - nodejs_version: "8" - - nodejs_version: "6" - - nodejs_version: "4" + - nodejs_version: "8" + eslint_version: "4" + + - nodejs_version: "8" + eslint_version: "3" + + - nodejs_version: "8" + eslint_version: "2" + + - nodejs_version: "6" + eslint_version: "4" + + - nodejs_version: "6" + eslint_version: "3" + + - nodejs_version: "6" + eslint_version: "2" # platform: # - x86 @@ -14,12 +28,9 @@ 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 - npm install + - npm install eslint@%eslint_version% --ignore-scripts || true # todo: learn how to do this for all .\resolvers\* on Windows - cd .\resolvers\webpack && npm install && cd ..\.. 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) {