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
= committed Jun 12, 2017
1 parent 3c46d30 commit a93d90e
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 7 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"chai": "^3.4.0",
"coveralls": "^2.11.4",
"cross-env": "^4.0.0",
"eslint": "3.x",
"eslint": "^4.0.0",
"eslint-import-resolver-node": "file:./resolvers/node",
"eslint-import-resolver-webpack": "file:./resolvers/webpack",
"eslint-module-utils": "file:./utils",
Expand All @@ -81,6 +81,7 @@
"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 a93d90e

Please sign in to comment.