Skip to content

Commit

Permalink
chore(eslint): upgrade to eslint@4
Browse files Browse the repository at this point in the history
  • Loading branch information
mastilver committed Jun 22, 2017
1 parent b1eeade commit 528fc71
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 13 deletions.
10 changes: 9 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
7 changes: 3 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@ 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
- if [ %nodejs_version% == "4" ]; then
npm install -g npm@3;
fi
- npm install

# todo: learn how to do this for all .\resolvers\* on Windows
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-named-default.js
Original file line number Diff line number Diff line change
Expand Up @@ -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}'.` })
}
})
},
Expand Down
8 changes: 6 additions & 2 deletions tests/src/rules/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion tests/src/rules/named.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')],
}),

Expand Down
7 changes: 4 additions & 3 deletions tests/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 528fc71

Please sign in to comment.