-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Backports PR #9357 **Commit 1:** upgrade eslint, all related deps, and config files * Original sha: 054e798 * Authored by spalger <[email protected]> on 2016-08-24T23:39:11Z * Committed by spalger <[email protected]> on 2016-12-02T23:04:20Z **Commit 2:** replace gruntify-eslint with basic eslint-cli wrapper * Original sha: 71732e7 * Authored by spalger <[email protected]> on 2016-09-02T21:33:02Z * Committed by spalger <[email protected]> on 2016-12-02T23:41:36Z **Commit 3:** arrow-IIFEs must be invoked outside of the parens * Original sha: b05662c * Authored by spalger <[email protected]> on 2016-08-25T17:47:57Z * Committed by spalger <[email protected]> on 2016-12-02T23:41:40Z **Commit 4:** move import statements before their use * Original sha: 3572ab8 * Authored by spalger <[email protected]> on 2016-08-25T17:48:30Z * Committed by spalger <[email protected]> on 2016-12-02T23:41:40Z **Commit 5:** reindent to satisfy new indentation check algorithm * Original sha: b31dae1 * Authored by spalger <[email protected]> on 2016-08-25T17:49:47Z * Committed by spalger <[email protected]> on 2016-12-02T23:41:58Z **Commit 6:** place missing semicolon * Original sha: 7b39475 * Authored by spalger <[email protected]> on 2016-09-06T22:27:10Z * Committed by spalger <[email protected]> on 2016-12-02T23:42:04Z **Commit 7:** ignore copy-pasted decode geohash code * Original sha: 3c02df9 * Authored by spalger <[email protected]> on 2016-09-10T01:49:42Z * Committed by spalger <[email protected]> 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 <[email protected]> on 2016-12-10T04:14:32Z **Commit 9:** [grunt/eslint] fix argument spacing * Original sha: 6fa2c6c * Authored by spalger <[email protected]> on 2016-12-10T04:22:42Z **Commit 10:** [gurnt/eslint] add comment about contents of report * Original sha: 71834ca * Authored by spalger <[email protected]> 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 <[email protected]> on 2016-12-12T20:17:05Z **Commit 12:** [grunt/tasks] use `export default` * Original sha: 803c0da * Authored by spalger <[email protected]> on 2016-12-12T20:19:27Z
- Loading branch information
1 parent
3aea8e2
commit f9690a6
Showing
14 changed files
with
164 additions
and
172 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,9 @@ | ||
/optimize | ||
/src/fixtures/vislib/mock_data | ||
/src/ui/public/angular-bootstrap | ||
/test/fixtures/scenarios | ||
/src/core_plugins/console/public/webpackShims | ||
/src/core_plugins/console/public/tests/webpackShims | ||
/src/core_plugins/timelion/bower_components | ||
/src/core_plugins/timelion/vendor_components | ||
test/fixtures/scenarios | ||
optimize | ||
test/fixtures/scenarios | ||
/src/ui/public/utils/decode_geo_hash.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,8 @@ | ||
--- | ||
extends: '@elastic/kibana' | ||
rules: | ||
no-unused-vars: off | ||
no-var: off | ||
prefer-const: off | ||
no-extra-semi: off | ||
quotes: off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,36 @@ | ||
--- | ||
|
||
root: true | ||
extends: '@elastic/kibana' | ||
extends: '../../../.eslintrc' | ||
|
||
rules: | ||
block-scoped-var: [0] | ||
camelcase: [0] | ||
curly: [0] | ||
dot-location: [0] | ||
dot-notation: [0] | ||
eqeqeq: [0] | ||
guard-for-in: [0] | ||
indent: [0] | ||
max-len: [0] | ||
new-cap: [0] | ||
no-caller: [0] | ||
no-empty: [0] | ||
no-extend-native: [0] | ||
no-loop-func: [0] | ||
no-multi-str: [0] | ||
no-nested-ternary: [0] | ||
no-proto: [0] | ||
no-sequences: [0] | ||
no-undef: [0] | ||
no-use-before-define: [0] | ||
one-var: [0] | ||
quotes: [0] | ||
space-before-blocks: [0] | ||
space-in-parens: [0] | ||
space-infix-ops: [0] | ||
semi: [0] | ||
strict: [0] | ||
wrap-iife: [0] | ||
block-scoped-var: off | ||
camelcase: off | ||
curly: off | ||
dot-location: off | ||
dot-notation: off | ||
eqeqeq: off | ||
guard-for-in: off | ||
indent: off | ||
max-len: off | ||
new-cap: off | ||
no-caller: off | ||
no-empty: off | ||
no-extend-native: off | ||
no-loop-func: off | ||
no-multi-str: off | ||
no-nested-ternary: off | ||
no-proto: off | ||
no-sequences: off | ||
no-undef: off | ||
no-use-before-define: off | ||
one-var: off | ||
quotes: off | ||
space-before-blocks: off | ||
space-in-parens: off | ||
space-infix-ops: off | ||
semi: off | ||
strict: off | ||
wrap-iife: off | ||
no-var: off | ||
prefer-const: off |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,4 +10,4 @@ export default { | |
}, | ||
on: _.noop, | ||
off: _.noop | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,33 @@ | ||
var resolve = require('path').resolve; | ||
import { resolve } from 'path'; | ||
export default grunt => ({ | ||
options: { | ||
paths: [ | ||
'Gruntfile.js', | ||
'bin', | ||
'config', | ||
'src', | ||
'tasks', | ||
'test', | ||
'utilities', | ||
], | ||
}, | ||
|
||
module.exports = function (grunt) { | ||
return { | ||
// just lint the source dir | ||
source: { | ||
options: { | ||
cache: resolve(grunt.config.get('root'), '.eslint.fixSource.cache') | ||
}, | ||
source: { | ||
options: { | ||
cache: resolve(grunt.config.get('root'), '.eslint.fixSource.cache') | ||
} | ||
}, | ||
|
||
files: { | ||
src: '<%= lintThese %>' | ||
} | ||
}, | ||
fixSource: { | ||
options: { | ||
cache: resolve(grunt.config.get('root'), '.eslint.fixSource.cache'), | ||
fix: true | ||
} | ||
}, | ||
|
||
// lint the source and fix any fixable errors | ||
fixSource: { | ||
options: { | ||
cache: resolve(grunt.config.get('root'), '.eslint.fixSource.cache'), | ||
fix: true | ||
}, | ||
|
||
files: { | ||
src: '<%= lintThese %>' | ||
} | ||
}, | ||
|
||
staged: {} | ||
}; | ||
}; | ||
staged: { | ||
options: { | ||
paths: null // overridden by lintStagedFiles task | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
import { CLIEngine } from 'eslint'; | ||
|
||
const OPTION_DEFAULTS = { | ||
paths: null, | ||
cache: null, | ||
fix: false | ||
}; | ||
|
||
export default grunt => { | ||
grunt.registerMultiTask('eslint', function () { | ||
const options = this.options(OPTION_DEFAULTS); | ||
|
||
if (!options.paths) { | ||
grunt.fatal(new Error('No eslint.options.paths specified')); | ||
return; | ||
} | ||
|
||
const cli = new CLIEngine({ | ||
cache: options.cache, | ||
fix: options.fix, | ||
cwd: grunt.config.get('root'), | ||
}); | ||
|
||
// report includes an entire list of files checked and the | ||
// fixes, errors, and warning for each. | ||
const report = cli.executeOnFiles(options.paths); | ||
|
||
// output fixes to disk | ||
if (options.fix) { | ||
CLIEngine.outputFixes(report); | ||
} | ||
|
||
// log the formatted linting report | ||
const formatter = cli.getFormatter(); | ||
|
||
const errTypes = []; | ||
if (report.errorCount > 0) errTypes.push('errors'); | ||
if (report.warningCount > 0) errTypes.push('warning'); | ||
if (!errTypes.length) return; | ||
|
||
grunt.log.write(formatter(report.results)); | ||
grunt.fatal(`eslint ${errTypes.join(' & ')}`); | ||
}); | ||
}; |
Oops, something went wrong.