Skip to content

Commit ca8c28b

Browse files
committed
chore(eslint): upgrade to eslint@4
1 parent 3f9e4bf commit ca8c28b

File tree

8 files changed

+30
-15
lines changed

8 files changed

+30
-15
lines changed

Diff for: .travis.yml

+7-2
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
language: node_js
22
node_js:
33
- 6
4-
- 7
4+
- 8
55

66
os:
77
- linux
88
- osx
99

10+
env:
11+
- ESLINT_VERSION=2
12+
- ESLINT_VERSION=3
13+
- ESLINT_VERSION=4
14+
1015
install:
11-
- npm -g install npm@3
1216
- npm install
17+
- npm install eslint@$ESLINT_VERSION --ignore-scripts || true
1318
# install all resolver deps
1419
- "for resolver in ./resolvers/*; do cd $resolver && npm install && cd ../..; done"
1520

Diff for: appveyor.yml

+18-6
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,23 @@
11
# Test against this version of Node.js
22
environment:
33
matrix:
4-
- nodejs_version: "7"
5-
- nodejs_version: "6"
4+
- nodejs_version: "8"
5+
ESLINT_VERSION: "4"
6+
7+
- nodejs_version: "8"
8+
ESLINT_VERSION: "3"
9+
10+
- nodejs_version: "8"
11+
ESLINT_VERSION: "2"
12+
13+
- nodejs_version: "6"
14+
ESLINT_VERSION: "4"
15+
16+
- nodejs_version: "6"
17+
ESLINT_VERSION: "3"
18+
19+
- nodejs_version: "6"
20+
ESLINT_VERSION: "2"
621

722
# platform:
823
# - x86
@@ -13,12 +28,9 @@ install:
1328
# Get the latest stable version of Node.js or io.js
1429
- ps: Install-Product node $env:nodejs_version
1530

16-
# update npm (only needed for Node 0.10)
17-
- npm -g install npm@3
18-
# - set PATH=%APPDATA%\npm;%PATH%
19-
2031
# install modules
2132
- npm install
33+
- npm install eslint@$ESLINT_VERSION --ignore-scripts || true
2234

2335
# todo: learn how to do this for all .\resolvers\* on Windows
2436
- cd .\resolvers\webpack && npm install && cd ..\..

Diff for: 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",

Diff for: src/rules/no-amd.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ module.exports = {
1717
return {
1818

1919
'CallExpression': function (node) {
20-
if (context.getScope().type !== 'module') return
20+
if (context.getScope().type !== 'module' && context.getScope().type !== 'global') return
2121

2222
if (node.callee.type !== 'Identifier') return
2323
if (node.callee.name !== 'require' &&

Diff for: src/rules/no-commonjs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ module.exports = {
4141

4242
},
4343
'CallExpression': function (call) {
44-
if (context.getScope().type !== 'module') return
44+
if (context.getScope().type !== 'module' && context.getScope().type !== 'global') return
4545

4646
if (call.callee.type !== 'Identifier') return
4747
if (call.callee.name !== 'require') return

Diff for: 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
},

Diff for: tests/src/rules/default.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ 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({ code: 'import App from "./jsx/App"'}),
6362

6463
// from no-errors
6564
test({

Diff for: tests/src/rules/named.js

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

136136
test({
137137
code: 'import { a } from "./re-export-names"',
138-
args: [2, 'es6-only'],
139138
errors: [error('a', './re-export-names')],
140139
}),
141140

0 commit comments

Comments
 (0)