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 13, 2017
1 parent ebaa8e3 commit d6be911
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 8 deletions.
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,15 @@ 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
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,18 @@
"rimraf": "2.5.2",
"sinon": "^2.3.2",
"typescript": "^2.0.3",
"typescript-eslint-parser": "^2.1.0"
"typescript-eslint-parser": "^2.1.0",
"webpack": "^2.6.1"
},
"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 d6be911

Please sign in to comment.