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 17, 2017
1 parent 3f9e4bf commit 72472fd
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 10 deletions.
8 changes: 7 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
language: node_js
node_js:
- 6
- 7
- 8

os:
- linux
- osx

env:
- ESLINT_VERSION=2
- ESLINT_VERSION=3
- ESLINT_VERSION=4

install:
- npm -g install npm@3
- 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
20 changes: 18 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
# Test against this version of Node.js
environment:
environment:
matrix:
- nodejs_version: "7"
- nodejs_version: "6"
- 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
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,14 @@
"typescript-eslint-parser": "^2.1.0"
},
"peerDependencies": {
"eslint": "2.x - 3.x"
"eslint": "2.x - 4.x"
},
"dependencies": {
"builtin-modules": "^1.1.1",
"contains-path": "^0.1.0",
"debug": "^2.2.0",
"doctrine": "1.5.0",
"escope": "^3.6.0",
"eslint-import-resolver-node": "^0.2.0",
"eslint-module-utils": "^2.0.0",
"has": "^1.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-amd.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ module.exports = {
return {

'CallExpression': function (node) {
if (context.getScope().type !== 'module') return
if (context.getScope().type !== 'module' && context.getScope().type !== 'global') return

if (node.callee.type !== 'Identifier') return
if (node.callee.name !== 'require' &&
Expand Down
2 changes: 1 addition & 1 deletion src/rules/no-commonjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ module.exports = {

},
'CallExpression': function (call) {
if (context.getScope().type !== 'module') return
if (context.getScope().type !== 'module' && context.getScope().type !== 'global') return

if (call.callee.type !== 'Identifier') return
if (call.callee.name !== 'require') return
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
3 changes: 1 addition & 2 deletions tests/src/rules/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ 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"'}),

// from no-errors
test({
Expand Down
1 change: 0 additions & 1 deletion tests/src/rules/named.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,6 @@ ruleTester.run('named', rule, {

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

Expand Down

0 comments on commit 72472fd

Please sign in to comment.