Skip to content

Commit a8ca5bb

Browse files
committed
chore(eslint): upgrade to eslint@4
1 parent b1eeade commit a8ca5bb

File tree

7 files changed

+26
-13
lines changed

7 files changed

+26
-13
lines changed

.travis.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,17 @@ os:
88
- linux
99
- osx
1010

11+
env:
12+
- ESLINT_VERSION=2
13+
- ESLINT_VERSION=3
14+
- ESLINT_VERSION=4
15+
1116
install:
12-
- npm -g install npm@3
17+
- if [ ${TRAVIS_NODE_VERSION} == "4" ]; then
18+
npm install -g npm@3;
19+
fi
1320
- npm install
21+
- npm install eslint@$ESLINT_VERSION --ignore-scripts || true
1422
# install all resolver deps
1523
- "for resolver in ./resolvers/*; do cd $resolver && npm install && cd ../..; done"
1624

appveyor.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ install:
1414
# Get the latest stable version of Node.js or io.js
1515
- ps: Install-Product node $env:nodejs_version
1616

17-
# update npm (only needed for Node 0.10)
18-
- npm -g install npm@3
19-
# - set PATH=%APPDATA%\npm;%PATH%
20-
2117
# install modules
18+
- ps: >-
19+
if ($env:nodejs_version -eq "4") {
20+
npm install -g npm@3;
21+
}
2222
- npm install
2323

2424
# todo: learn how to do this for all .\resolvers\* on Windows

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"typescript-eslint-parser": "^2.1.0"
7575
},
7676
"peerDependencies": {
77-
"eslint": "2.x - 3.x"
77+
"eslint": "2.x - 4.x"
7878
},
7979
"dependencies": {
8080
"builtin-modules": "^1.1.1",

src/rules/no-named-default.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ module.exports = {
1010
if (im.type === 'ImportSpecifier' && im.imported.name === 'default') {
1111
context.report({
1212
node: im.local,
13-
message: `Use default import syntax to import \'${im.local.name}\'.` })
13+
message: `Use default import syntax to import '${im.local.name}'.` })
1414
}
1515
})
1616
},

tests/src/rules/default.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,12 @@ ruleTester.run('default', rule, {
5858

5959
// #94: redux export of execution result,
6060
test({ code: 'import connectedApp from "./redux"' }),
61-
test({ code: 'import App from "./jsx/App"'
62-
, ecmaFeatures: { jsx: true, modules: true } }),
61+
test({
62+
code: 'import App from "./jsx/App"',
63+
parserOptions: {
64+
ecmaFeatures: { jsx: true, modules: true },
65+
},
66+
}),
6367

6468
// from no-errors
6569
test({

tests/src/rules/named.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ ruleTester.run('named', rule, {
135135

136136
test({
137137
code: 'import { a } from "./re-export-names"',
138-
args: [2, 'es6-only'],
138+
options: [2, 'es6-only'],
139139
errors: [error('a', './re-export-names')],
140140
}),
141141

tests/src/utils.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ export const FILENAME = testFilePath('foo.js')
1212
export function test(t) {
1313
return Object.assign({
1414
filename: FILENAME,
15-
parserOptions: {
15+
}, t, {
16+
parserOptions: Object.assign({
1617
sourceType: 'module',
1718
ecmaVersion: 6,
18-
},
19-
}, t)
19+
}, t.parserOptions),
20+
})
2021
}
2122

2223
export function testContext(settings) {

0 commit comments

Comments
 (0)