Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(eslint): upgrade to eslint@4 #871

Merged
merged 1 commit into from
Jun 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,17 @@ os:
- linux
- osx

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

install:
- npm -g install npm@3
- if [ ${TRAVIS_NODE_VERSION} == "4" ]; then
npm install -g npm@3;
fi
- 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
8 changes: 4 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ 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
- ps: >-
if ($env:nodejs_version -eq "4") {
npm install -g npm@3;
}
- npm install

# todo: learn how to do this for all .\resolvers\* on Windows
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-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
8 changes: 6 additions & 2 deletions tests/src/rules/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,12 @@ 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 } }),
Copy link
Member

@ljharb ljharb Jun 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these should be passed inside parserOptions, instead of removed.

test({
code: 'import App from "./jsx/App"',
parserOptions: {
ecmaFeatures: { jsx: true, modules: true },
},
}),

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

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

@ljharb ljharb Jun 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why need this line be removed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh actually, I think this line is dead code and can be removed. es6-only was a v1 option that was removed ages ago.

it's fine if it's just options now though, can clean up later

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

options: [2, 'es6-only'],
errors: [error('a', './re-export-names')],
}),

Expand Down
7 changes: 4 additions & 3 deletions tests/src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export const FILENAME = testFilePath('foo.js')
export function test(t) {
return Object.assign({
filename: FILENAME,
parserOptions: {
}, t, {
parserOptions: Object.assign({
sourceType: 'module',
ecmaVersion: 6,
},
}, t)
}, t.parserOptions),
})
}

export function testContext(settings) {
Expand Down