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 eec46df
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 15 deletions.
9 changes: 7 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
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
25 changes: 19 additions & 6 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 All @@ -13,12 +29,9 @@ install:
# Get the latest stable version of Node.js or io.js
- ps: Install-Product node $env:nodejs_version

# update npm (only needed for Node 0.10)
- npm -g install npm@3
# - set PATH=%APPDATA%\npm;%PATH%

# install modules
- npm install
- npm install eslint@$ESLINT_VERSION --ignore-scripts || true

# todo: learn how to do this for all .\resolvers\* on Windows
- cd .\resolvers\webpack && npm install && cd ..\..
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"typescript-eslint-parser": "^2.1.0"
},
"peerDependencies": {
"eslint": "2.x - 3.x"
"eslint": "2.x - 4.x"
},
"dependencies": {
"builtin-modules": "^1.1.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 eec46df

Please sign in to comment.