-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
Upgrade eslint #9357
Upgrade eslint #9357
Conversation
733cc1b
to
3c02df9
Compare
FYI this will also address #7622 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks sweet overall. I had one question.
'!<%= src %>/core_plugins/timelion/vendor_components/**/*.js', | ||
'!<%= src %>/fixtures/**/*.js', | ||
'!<%= root %>/test/fixtures/scenarios/**/*.js' | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
...extraPaths | ||
].map(path => resolve(path)); | ||
|
||
this.watcher = chokidar.watch(uniq(watchPaths), { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Really nice attention to detail dude... I ❤️ it
if (report.warningCount > 0) errTypes.push('warning'); | ||
if (!errTypes.length) return; | ||
|
||
grunt.log.write(formatter(report.results)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we get to this point if there are no errors? If there are no errors, do we still want to see the report results? Without knowing what the report contains, it seems like this could be useful information?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The report actually only contains errors and warnings, so if there are none of those then there isn't anything to report
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. How about renamingreport
to errorReport
or adding a comment to make that clearer? Otherwise I can see how someone might have the same question I had from reading this code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added a comment describing what the report is. Since it contains errors, warnings, and fix info, errorReport
didn't seem appropriate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweeeeeeet!
@spalger Can you update the PR description with an explanation of why the new task was necessary and such? |
test/fixtures/scenarios | ||
optimize | ||
test/fixtures/scenarios | ||
/src/ui/public/utils/decode_geo_hash.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this specific file excluded?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's copied from an external source
@@ -165,17 +165,17 @@ | |||
"wreck": "6.2.0" | |||
}, | |||
"devDependencies": { | |||
"@elastic/eslint-config-kibana": "0.0.3", | |||
"@elastic/eslint-config-kibana": "0.2.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once all of this eslint stuff is done, let's bump this to 1.0.0.
@@ -189,7 +189,6 @@ | |||
"grunt-karma": "2.0.0", | |||
"grunt-run": "0.6.0", | |||
"grunt-simple-mocha": "0.4.0", | |||
"gruntify-eslint": "1.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
@@ -24,7 +24,7 @@ export default class MockClusterFork extends EventEmitter { | |||
dead = true; | |||
this.emit('exit'); | |||
cluster.emit('exit', this, this.exitCode || 0); | |||
}()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How did this ever work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The babel parser missed the standard there apparently. it's valid for function expressions, just not arrow function expressions.
@@ -1,30 +1,33 @@ | |||
var resolve = require('path').resolve; | |||
import { resolve } from 'path'; | |||
module.exports = grunt => ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export default
?
fix: false | ||
}; | ||
|
||
module.exports = grunt => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
export default
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left a few comments (mostly questions).
@epixa I believe that addresses your feedback |
LGTM once the build is green |
Backports PR #9357 **Commit 1:** upgrade eslint, all related deps, and config files * Original sha: 054e798 * Authored by spalger <email@spalger.com> on 2016-08-24T23:39:11Z * Committed by spalger <spalger@users.noreply.github.com> on 2016-12-02T23:04:20Z **Commit 2:** replace gruntify-eslint with basic eslint-cli wrapper * Original sha: 71732e7 * Authored by spalger <email@spalger.com> on 2016-09-02T21:33:02Z * Committed by spalger <spalger@users.noreply.github.com> on 2016-12-02T23:41:36Z **Commit 3:** arrow-IIFEs must be invoked outside of the parens * Original sha: b05662c * Authored by spalger <email@spalger.com> on 2016-08-25T17:47:57Z * Committed by spalger <spalger@users.noreply.github.com> on 2016-12-02T23:41:40Z **Commit 4:** move import statements before their use * Original sha: 3572ab8 * Authored by spalger <email@spalger.com> on 2016-08-25T17:48:30Z * Committed by spalger <spalger@users.noreply.github.com> on 2016-12-02T23:41:40Z **Commit 5:** reindent to satisfy new indentation check algorithm * Original sha: b31dae1 * Authored by spalger <email@spalger.com> on 2016-08-25T17:49:47Z * Committed by spalger <spalger@users.noreply.github.com> on 2016-12-02T23:41:58Z **Commit 6:** place missing semicolon * Original sha: 7b39475 * Authored by spalger <email@spalger.com> on 2016-09-06T22:27:10Z * Committed by spalger <spalger@users.noreply.github.com> on 2016-12-02T23:42:04Z **Commit 7:** ignore copy-pasted decode geohash code * Original sha: 3c02df9 * Authored by spalger <email@spalger.com> on 2016-09-10T01:49:42Z * Committed by spalger <spalger@users.noreply.github.com> on 2016-12-02T23:42:04Z **Commit 8:** Merge branch 'master' of github.com:elastic/kibana into upgrade/eslint-try2 * Original sha: 1224b18 * Authored by spalger <spalger@users.noreply.github.com> on 2016-12-10T04:14:32Z **Commit 9:** [grunt/eslint] fix argument spacing * Original sha: 6fa2c6c * Authored by spalger <spalger@users.noreply.github.com> on 2016-12-10T04:22:42Z **Commit 10:** [gurnt/eslint] add comment about contents of report * Original sha: 71834ca * Authored by spalger <spalger@users.noreply.github.com> on 2016-12-10T07:59:11Z **Commit 11:** Merge branch 'master' of github.com:elastic/kibana into upgrade/eslint-try2 * Original sha: 76e77a7 * Authored by spalger <spalger@users.noreply.github.com> on 2016-12-12T20:17:05Z **Commit 12:** [grunt/tasks] use `export default` * Original sha: 803c0da * Authored by spalger <spalger@users.noreply.github.com> on 2016-12-12T20:19:27Z
Backports PR #9357 **Commit 1:** upgrade eslint, all related deps, and config files * Original sha: 054e798 * Authored by spalger <email@spalger.com> on 2016-08-24T23:39:11Z * Committed by spalger <spalger@users.noreply.github.com> on 2016-12-02T23:04:20Z **Commit 2:** replace gruntify-eslint with basic eslint-cli wrapper * Original sha: 71732e7 * Authored by spalger <email@spalger.com> on 2016-09-02T21:33:02Z * Committed by spalger <spalger@users.noreply.github.com> on 2016-12-02T23:41:36Z **Commit 3:** arrow-IIFEs must be invoked outside of the parens * Original sha: b05662c * Authored by spalger <email@spalger.com> on 2016-08-25T17:47:57Z * Committed by spalger <spalger@users.noreply.github.com> on 2016-12-02T23:41:40Z **Commit 4:** move import statements before their use * Original sha: 3572ab8 * Authored by spalger <email@spalger.com> on 2016-08-25T17:48:30Z * Committed by spalger <spalger@users.noreply.github.com> on 2016-12-02T23:41:40Z **Commit 5:** reindent to satisfy new indentation check algorithm * Original sha: b31dae1 * Authored by spalger <email@spalger.com> on 2016-08-25T17:49:47Z * Committed by spalger <spalger@users.noreply.github.com> on 2016-12-02T23:41:58Z **Commit 6:** place missing semicolon * Original sha: 7b39475 * Authored by spalger <email@spalger.com> on 2016-09-06T22:27:10Z * Committed by spalger <spalger@users.noreply.github.com> on 2016-12-02T23:42:04Z **Commit 7:** ignore copy-pasted decode geohash code * Original sha: 3c02df9 * Authored by spalger <email@spalger.com> on 2016-09-10T01:49:42Z * Committed by spalger <spalger@users.noreply.github.com> on 2016-12-02T23:42:04Z **Commit 8:** Merge branch 'master' of github.com:elastic/kibana into upgrade/eslint-try2 * Original sha: 1224b18 * Authored by spalger <spalger@users.noreply.github.com> on 2016-12-10T04:14:32Z **Commit 9:** [grunt/eslint] fix argument spacing * Original sha: 6fa2c6c * Authored by spalger <spalger@users.noreply.github.com> on 2016-12-10T04:22:42Z **Commit 10:** [gurnt/eslint] add comment about contents of report * Original sha: 71834ca * Authored by spalger <spalger@users.noreply.github.com> on 2016-12-10T07:59:11Z **Commit 11:** Merge branch 'master' of github.com:elastic/kibana into upgrade/eslint-try2 * Original sha: 76e77a7 * Authored by spalger <spalger@users.noreply.github.com> on 2016-12-12T20:17:05Z **Commit 12:** [grunt/tasks] use `export default` * Original sha: 803c0da * Authored by spalger <spalger@users.noreply.github.com> on 2016-12-12T20:19:27Z
A prereq for #8315
Upgrades eslint and
@elastic/eslint-config-kibana
to their latest versions.Some of the new rules from
@elastic/eslint-config-kibana
had to be disabled and should be reenabled one-by-one as a part of #9355As a part of this change gruntify-eslint was replaced with a custom grunt task. This was necessary because gruntify-eslint:
Fixes #7622