From 05cbb929658590024e231a0791311c8b859e194f Mon Sep 17 00:00:00 2001 From: CJ Cenizal Date: Wed, 25 Oct 2017 15:08:05 -0700 Subject: [PATCH] [eslint-config-kibana] Apply AirBnB spacing rules (#14522) * Add AirBnB key-spacing rule. * Add AirBnB comma-spacing rule. --- package.json | 2 +- packages/eslint-config-kibana/.eslintrc.js | 3 +- packages/eslint-config-kibana/package.json | 2 +- .../console/api_server/es_5_0/indices.js | 4 +- .../mode/script_highlight_rules.js | 40 +++++------ .../public/src/sense_editor/mode/worker.js | 8 +-- .../mode/x_json_highlight_rules.js | 2 +- src/core_plugins/console/public/src/utils.js | 2 +- .../lib/__tests__/health_check.js | 2 +- .../kbn_vislib_vis_types/public/area.js | 2 +- .../kbn_vislib_vis_types/public/gauge.js | 4 +- .../kbn_vislib_vis_types/public/goal.js | 2 +- .../kbn_vislib_vis_types/public/histogram.js | 2 +- .../kbn_vislib_vis_types/public/line.js | 2 +- .../kbn_vislib_vis_types/public/metric.js | 2 +- .../field_formats/types/__tests__/boolean.js | 2 +- .../dashboard/__tests__/saved_dashboards.js | 2 +- .../kibana/public/dashboard/index.js | 2 +- .../dashboard/panel/panel_options_menu.js | 2 +- .../hacks/__tests__/hide_empty_tools.js | 2 +- .../public/discover/directives/timechart.js | 2 +- .../field_formats/__tests__/_boolean.js | 2 +- .../indexed_fields_table.js | 2 +- .../scripted_fields_table/date_scripts.js | 16 ++--- .../management/sections/objects/_objects.js | 4 +- src/core_plugins/metrics/index.js | 2 +- .../lib/__tests__/collection_actions.js | 4 +- .../public/components/vis_types/top_n/vis.js | 2 +- .../metrics/public/kbn_vis_types/index.js | 2 +- .../lib/__tests__/get_last_value.js | 6 +- .../lib/vis_data/helpers/get_agg_value.js | 2 +- .../lib/vis_data/helpers/get_buckets_path.js | 2 +- .../lib/vis_data/helpers/get_split_colors.js | 4 +- .../annotations/date_histogram.js | 2 +- .../series/date_histogram.js | 2 +- .../series/__tests__/_series_agg.js | 24 +++---- .../series/__tests__/percentile.js | 12 ++-- .../series/__tests__/std_metric.js | 2 +- .../table_vis/public/table_vis.js | 2 +- .../tagcloud/public/tag_cloud_vis.js | 2 +- .../public/__tests__/geohash_layer.js | 2 +- .../tile_map/public/__tests__/kibana_map.js | 10 +-- .../tile_map/public/maps_visualization.js | 2 +- .../public/services/tick_formatters.js | 8 +-- .../timelion/server/handlers/chain_runner.js | 2 +- .../timelion/server/routes/validate_es.js | 2 +- .../series_functions/__tests__/color.js | 2 +- .../series_functions/__tests__/condition.js | 2 +- .../server/series_functions/__tests__/es.js | 72 +++++++++---------- .../server/series_functions/__tests__/fit.js | 6 +- .../__tests__/helpers/get_series.js | 2 +- .../series_functions/__tests__/legend.js | 2 +- .../series_functions/__tests__/quandl.js | 4 +- .../series_functions/es/lib/build_request.js | 4 +- .../server/series_functions/graphite.js | 2 +- .../timelion/server/series_functions/label.js | 2 +- .../server/series_functions/movingaverage.js | 4 +- .../server/series_functions/quandl.js | 4 +- .../server/series_functions/worldbank.js | 4 +- .../timelion/server/series_functions/yaxis.js | 14 ++-- .../lib/archives/__tests__/format.js | 4 +- .../lib/archives/__tests__/parse.js | 2 +- src/fixtures/search_response.js | 4 +- src/server/config/transform_deprecations.js | 2 +- .../client/__tests__/saved_objects_client.js | 2 +- src/server/status/__tests__/cgroup.js | 4 +- src/server/status/metrics.js | 6 +- src/ui/i18n/__tests__/i18n.js | 28 ++++---- src/ui/public/__tests__/errors.js | 2 +- .../point_series/__tests__/_get_point.js | 2 +- src/ui/public/agg_table/__tests__/_table.js | 2 +- .../buckets/date_histogram/_editor.js | 2 +- .../__tests__/metrics/parent_pipeline.js | 16 ++--- src/ui/public/agg_types/buckets/geo_hash.js | 4 +- .../public/courier/__tests__/saved_object.js | 8 +-- .../__tests__/segmented_create_queue.js | 4 +- .../public/directives/__tests__/timepicker.js | 16 ++--- .../doc_table/__tests__/actions/filter.js | 8 +-- .../filter_bar/__tests__/push_filter.js | 2 +- .../lib/__tests__/extract_time_filter.js | 4 +- .../__tests__/filter_out_time_based_filter.js | 2 +- .../__tests__/_index_pattern.js | 2 +- .../indexed_array/__tests__/indexed_array.js | 2 +- src/ui/public/kuery/functions/exists.js | 2 +- src/ui/public/kuery/functions/is.js | 4 +- .../notify/__tests__/lib/_format_es_msg.js | 14 ++-- .../notify/__tests__/lib/_format_msg.js | 8 +-- src/ui/public/notify/__tests__/notifier.js | 4 +- src/ui/public/promises/__tests__/promises.js | 2 +- src/ui/public/timefilter/timefilter.js | 2 +- src/ui/public/timepicker/refresh_intervals.js | 26 +++---- src/ui/public/timepicker/timepicker.js | 2 +- src/ui/public/utils/__tests__/brush_event.js | 8 +-- src/ui/public/utils/__tests__/scanner.js | 6 +- src/ui/public/vis/__tests__/_agg_config.js | 2 +- .../vis/__tests__/map/service_settings.js | 4 +- .../lib/layout/splits/column_chart/splits.js | 28 ++++---- .../lib/layout/splits/gauge_chart/splits.js | 28 ++++---- .../vislib/__tests__/visualizations/chart.js | 12 ++-- .../public/vislib/lib/types/point_series.js | 8 +-- src/ui/public/vislib/lib/vis_config.js | 2 +- src/ui/public/visualize/visualization.js | 4 +- .../public/visualize/visualization_editor.js | 2 +- src/ui/public/visualize/visualize.js | 2 +- src/utils/streams/__tests__/concat_stream.js | 12 ++-- src/utils/streams/__tests__/list_stream.js | 6 +- .../streams/__tests__/promise_from_streams.js | 2 +- src/utils/streams/__tests__/reduce_stream.js | 2 +- src/utils/strings/__tests__/prose.js | 18 ++--- test/functional/apps/console/_console.js | 2 +- test/functional/apps/console/index.js | 2 +- test/functional/apps/context/index.js | 2 +- .../apps/discover/_collapse_expand.js | 4 +- .../functional/apps/discover/_shared_links.js | 6 +- .../apps/discover/_source_filters.js | 2 +- test/functional/apps/discover/index.js | 2 +- .../apps/management/_scripted_fields.js | 6 +- .../management/_scripted_fields_filter.js | 6 +- test/functional/apps/visualize/_area_chart.js | 2 +- test/functional/page_objects/common_page.js | 6 +- .../functional/page_objects/dashboard_page.js | 6 +- .../functional/page_objects/visualize_page.js | 4 +- ui_framework/doc_site/src/views/tabs/tabs.js | 2 +- .../collapse_button/collapse_button.test.js | 2 +- .../gallery/gallery_item/gallery_item_icon.js | 2 +- ui_framework/src/components/menu/menu.js | 2 +- ui_framework/src/components/menu/menu_item.js | 2 +- 127 files changed, 367 insertions(+), 366 deletions(-) diff --git a/package.json b/package.json index 3ef0ffd1fe09..4cbd2e63a07e 100644 --- a/package.json +++ b/package.json @@ -213,7 +213,7 @@ "yauzl": "2.7.0" }, "devDependencies": { - "@elastic/eslint-config-kibana": "0.12.0", + "@elastic/eslint-config-kibana": "0.13.0", "@elastic/eslint-import-resolver-kibana": "0.8.1", "@elastic/eslint-plugin-kibana-custom": "1.0.3", "angular-mocks": "1.4.7", diff --git a/packages/eslint-config-kibana/.eslintrc.js b/packages/eslint-config-kibana/.eslintrc.js index 4ec946a4706a..c52865df42cc 100644 --- a/packages/eslint-config-kibana/.eslintrc.js +++ b/packages/eslint-config-kibana/.eslintrc.js @@ -26,6 +26,7 @@ module.exports = { 'block-scoped-var': 'error', camelcase: [ 'error', { properties: 'never' } ], 'comma-dangle': 'off', + 'comma-spacing': ['error', { before: false, after: true }], 'comma-style': [ 'error', 'last' ], 'consistent-return': 'off', curly: [ 'error', 'multi-line' ], @@ -34,7 +35,7 @@ module.exports = { eqeqeq: [ 'error', 'allow-null' ], 'guard-for-in': 'error', indent: [ 'error', 2, { SwitchCase: 1 } ], - 'key-spacing': [ 'off', { align: 'value' } ], + 'key-spacing': ['error', { beforeColon: false, afterColon: true }], 'max-len': [ 'error', 140, 2, { ignoreComments: true, ignoreUrls: true } ], 'new-cap': [ 'error', { capIsNewExceptions: [ 'Private' ] } ], 'no-bitwise': 'off', diff --git a/packages/eslint-config-kibana/package.json b/packages/eslint-config-kibana/package.json index efc76082dda0..62f48bead549 100644 --- a/packages/eslint-config-kibana/package.json +++ b/packages/eslint-config-kibana/package.json @@ -1,6 +1,6 @@ { "name": "@elastic/eslint-config-kibana", - "version": "0.12.0", + "version": "0.13.0", "description": "The eslint config used by the kibana team", "main": ".eslintrc.js", "scripts": { diff --git a/src/core_plugins/console/api_server/es_5_0/indices.js b/src/core_plugins/console/api_server/es_5_0/indices.js index 9dc7b4f92766..45f898f51d89 100644 --- a/src/core_plugins/console/api_server/es_5_0/indices.js +++ b/src/core_plugins/console/api_server/es_5_0/indices.js @@ -169,7 +169,7 @@ export default function (api) { }); api.addEndpointDescription('_get_index_settings', { - methods: ['GET',], + methods: ['GET', ], patterns: [ "{indices}/_settings", ], @@ -179,7 +179,7 @@ export default function (api) { }); api.addEndpointDescription('_get_index', { - methods: ['GET',], + methods: ['GET', ], patterns: [ "{indices}", "{indices}/{feature}" diff --git a/src/core_plugins/console/public/src/sense_editor/mode/script_highlight_rules.js b/src/core_plugins/console/public/src/sense_editor/mode/script_highlight_rules.js index e613c80f20fc..fe0947224ff8 100644 --- a/src/core_plugins/console/public/src/sense_editor/mode/script_highlight_rules.js +++ b/src/core_plugins/console/public/src/sense_editor/mode/script_highlight_rules.js @@ -16,48 +16,48 @@ export function ScriptHighlightRules() { regex: "\\/\\/.*$" }, { - token : "script.string.regexp", - regex : "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" + token: "script.string.regexp", + regex: "[/](?:(?:\\[(?:\\\\]|[^\\]])+\\])|(?:\\\\/|[^\\]/]))*[/]\\w*\\s*(?=[).,;]|$)" }, { - token : "script.string", // single line - regex : "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" + token: "script.string", // single line + regex: "['](?:(?:\\\\.)|(?:[^'\\\\]))*?[']" }, { - token : "script.constant.numeric", // hex - regex : "0[xX][0-9a-fA-F]+\\b" + token: "script.constant.numeric", // hex + regex: "0[xX][0-9a-fA-F]+\\b" }, { - token : "script.constant.numeric", // float - regex : "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" + token: "script.constant.numeric", // float + regex: "[+-]?\\d+(?:(?:\\.\\d*)?(?:[eE][+-]?\\d+)?)?\\b" }, { - token : "script.constant.language.boolean", - regex : "(?:true|false)\\b" + token: "script.constant.language.boolean", + regex: "(?:true|false)\\b" }, { token: "script.keyword", regex: painlessKeywords }, { - token : "script.text", - regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" + token: "script.text", + regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b" }, { - token : "script.keyword.operator", - regex : "\\?\\.|\\*\\.|=~|==~|!|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|->|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|typeof|void)" + token: "script.keyword.operator", + regex: "\\?\\.|\\*\\.|=~|==~|!|%|&|\\*|\\-\\-|\\-|\\+\\+|\\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|->|!|&&|\\|\\||\\?\\:|\\*=|%=|\\+=|\\-=|&=|\\^=|\\b(?:in|instanceof|new|typeof|void)" }, { - token : "script.lparen", - regex : "[[({]" + token: "script.lparen", + regex: "[[({]" }, { - token : "script.rparen", - regex : "[\\])}]" + token: "script.rparen", + regex: "[\\])}]" }, { - token : "script.text", - regex : "\\s+" + token: "script.text", + regex: "\\s+" } ] } diff --git a/src/core_plugins/console/public/src/sense_editor/mode/worker.js b/src/core_plugins/console/public/src/sense_editor/mode/worker.js index 0c4c04379dbd..65cc4015ad2f 100644 --- a/src/core_plugins/console/public/src/sense_editor/mode/worker.js +++ b/src/core_plugins/console/public/src/sense_editor/mode/worker.js @@ -210,7 +210,7 @@ define('ace/lib/oop', ['require', 'exports', 'module' ], function (require, expo }; }); -define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'ace/lib/lang'], function (require, exports) { +define('ace/worker/mirror', ['require', 'exports', 'module', 'ace/document', 'ace/lib/lang'], function (require, exports) { "use strict"; var Document = require("../document").Document; @@ -259,7 +259,7 @@ define('ace/worker/mirror', ['require', 'exports', 'module' , 'ace/document', 'a }); -define('ace/document', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter', +define('ace/document', ['require', 'exports', 'module', 'ace/lib/oop', 'ace/lib/event_emitter', 'ace/range', 'ace/anchor'], function (require, exports) { "use strict"; @@ -988,7 +988,7 @@ define('ace/range', ['require', 'exports', 'module' ], function (require, export exports.Range = Range; }); -define('ace/anchor', ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/lib/event_emitter'], function (require, exports) { +define('ace/anchor', ['require', 'exports', 'module', 'ace/lib/oop', 'ace/lib/event_emitter'], function (require, exports) { "use strict"; var oop = require("./lib/oop"); @@ -1738,7 +1738,7 @@ define("sense_editor/mode/worker_parser", ['require', 'exports', 'module' ], fun }); -define("sense_editor/mode/worker", ['require', 'exports', 'module' , 'ace/lib/oop', 'ace/worker/mirror', +define("sense_editor/mode/worker", ['require', 'exports', 'module', 'ace/lib/oop', 'ace/worker/mirror', 'sense_editor/mode/worker_parser'], function (require, exports) { "use strict"; diff --git a/src/core_plugins/console/public/src/sense_editor/mode/x_json_highlight_rules.js b/src/core_plugins/console/public/src/sense_editor/mode/x_json_highlight_rules.js index e22587c756ad..4b1d0e3d1c06 100644 --- a/src/core_plugins/console/public/src/sense_editor/mode/x_json_highlight_rules.js +++ b/src/core_plugins/console/public/src/sense_editor/mode/x_json_highlight_rules.js @@ -106,6 +106,6 @@ export function addToRules(otherRules, embedUnder) { otherRules.embedRules(ScriptHighlightRules, "script-", [{ token: "punctuation.end_triple_quote", regex: '"""', - next : "pop", + next: "pop", }]); } diff --git a/src/core_plugins/console/public/src/utils.js b/src/core_plugins/console/public/src/utils.js index 78e49c35b4bf..552f3188059b 100644 --- a/src/core_plugins/console/public/src/utils.js +++ b/src/core_plugins/console/public/src/utils.js @@ -40,7 +40,7 @@ utils.reformatData = function (data, indent) { }; utils.collapseLiteralStrings = function (data) { - return data.replace(/"""(?:\s*\r?\n)?((?:.|\r?\n)*?)(?:\r?\n\s*)?"""/g,function (match, literal) { + return data.replace(/"""(?:\s*\r?\n)?((?:.|\r?\n)*?)(?:\r?\n\s*)?"""/g, function (match, literal) { return JSON.stringify(literal); }); } diff --git a/src/core_plugins/elasticsearch/lib/__tests__/health_check.js b/src/core_plugins/elasticsearch/lib/__tests__/health_check.js index 0b38ae12a010..56048dce8542 100644 --- a/src/core_plugins/elasticsearch/lib/__tests__/health_check.js +++ b/src/core_plugins/elasticsearch/lib/__tests__/health_check.js @@ -103,7 +103,7 @@ describe('plugins/elasticsearch', () => { // call the server extension const reply = sinon.stub(); - const [,handler] = server.ext.firstCall.args; + const [, handler] = server.ext.firstCall.args; handler({}, reply); // ensure that the handler called reply and unregistered the time diff --git a/src/core_plugins/kbn_vislib_vis_types/public/area.js b/src/core_plugins/kbn_vislib_vis_types/public/area.js index 9d0c8bb515df..d916a1e42496 100644 --- a/src/core_plugins/kbn_vislib_vis_types/public/area.js +++ b/src/core_plugins/kbn_vislib_vis_types/public/area.js @@ -124,7 +124,7 @@ export default function PointSeriesVisType(Private) { group: 'metrics', name: 'metric', title: 'Y-Axis', - aggFilter: ['!geo_centroid','!geo_bounds'], + aggFilter: ['!geo_centroid', '!geo_bounds'], min: 1, defaults: [ { schema: 'metric', type: 'count' } diff --git a/src/core_plugins/kbn_vislib_vis_types/public/gauge.js b/src/core_plugins/kbn_vislib_vis_types/public/gauge.js index f5550ba39d81..9bd28f30e117 100644 --- a/src/core_plugins/kbn_vislib_vis_types/public/gauge.js +++ b/src/core_plugins/kbn_vislib_vis_types/public/gauge.js @@ -18,7 +18,7 @@ export default function GaugeVisType(Private) { category: CATEGORY.DATA, visConfig: { defaults: { - type:'gauge', + type: 'gauge', addTooltip: true, addLegend: true, @@ -78,7 +78,7 @@ export default function GaugeVisType(Private) { min: 1, aggFilter: [ '!std_dev', '!geo_centroid', '!percentiles', '!percentile_ranks', - '!derivative', '!serial_diff', '!moving_avg', '!cumulative_sum','!geo_bounds'], + '!derivative', '!serial_diff', '!moving_avg', '!cumulative_sum', '!geo_bounds'], defaults: [ { schema: 'metric', type: 'count' } ] diff --git a/src/core_plugins/kbn_vislib_vis_types/public/goal.js b/src/core_plugins/kbn_vislib_vis_types/public/goal.js index 6ea27f770403..9872a46dccd9 100644 --- a/src/core_plugins/kbn_vislib_vis_types/public/goal.js +++ b/src/core_plugins/kbn_vislib_vis_types/public/goal.js @@ -72,7 +72,7 @@ export default function GoalVisType(Private) { min: 1, aggFilter: [ '!std_dev', '!geo_centroid', '!percentiles', '!percentile_ranks', - '!derivative', '!serial_diff', '!moving_avg', '!cumulative_sum','!geo_bounds'], + '!derivative', '!serial_diff', '!moving_avg', '!cumulative_sum', '!geo_bounds'], defaults: [ { schema: 'metric', type: 'count' } ] diff --git a/src/core_plugins/kbn_vislib_vis_types/public/histogram.js b/src/core_plugins/kbn_vislib_vis_types/public/histogram.js index cfd29461a6e5..5d12dc748470 100644 --- a/src/core_plugins/kbn_vislib_vis_types/public/histogram.js +++ b/src/core_plugins/kbn_vislib_vis_types/public/histogram.js @@ -126,7 +126,7 @@ export default function PointSeriesVisType(Private) { name: 'metric', title: 'Y-Axis', min: 1, - aggFilter: ['!geo_centroid','!geo_bounds'], + aggFilter: ['!geo_centroid', '!geo_bounds'], defaults: [ { schema: 'metric', type: 'count' } ] diff --git a/src/core_plugins/kbn_vislib_vis_types/public/line.js b/src/core_plugins/kbn_vislib_vis_types/public/line.js index ac8e41c17e21..f89a98a32235 100644 --- a/src/core_plugins/kbn_vislib_vis_types/public/line.js +++ b/src/core_plugins/kbn_vislib_vis_types/public/line.js @@ -126,7 +126,7 @@ export default function PointSeriesVisType(Private) { name: 'metric', title: 'Y-Axis', min: 1, - aggFilter: ['!geo_centroid','!geo_bounds'], + aggFilter: ['!geo_centroid', '!geo_bounds'], defaults: [ { schema: 'metric', type: 'count' } ] diff --git a/src/core_plugins/kbn_vislib_vis_types/public/metric.js b/src/core_plugins/kbn_vislib_vis_types/public/metric.js index 65e599d52013..63229abee0b1 100644 --- a/src/core_plugins/kbn_vislib_vis_types/public/metric.js +++ b/src/core_plugins/kbn_vislib_vis_types/public/metric.js @@ -69,7 +69,7 @@ export default function MetricVisType(Private) { name: 'metric', title: 'Metric', min: 1, - aggFilter: ['!derivative', '!geo_centroid','!geo_bounds'], + aggFilter: ['!derivative', '!geo_centroid', '!geo_bounds'], defaults: [ { schema: 'metric', type: 'count' } ] diff --git a/src/core_plugins/kibana/common/field_formats/types/__tests__/boolean.js b/src/core_plugins/kibana/common/field_formats/types/__tests__/boolean.js index 1cab26a836b1..95e79c1493d2 100644 --- a/src/core_plugins/kibana/common/field_formats/types/__tests__/boolean.js +++ b/src/core_plugins/kibana/common/field_formats/types/__tests__/boolean.js @@ -42,7 +42,7 @@ describe('Boolean Format', function () { expected: 'true' }, { - input: ' True ',//should handle trailing and mixed case + input: ' True ', //should handle trailing and mixed case expected: 'true' } ].forEach((test)=> { diff --git a/src/core_plugins/kibana/public/dashboard/__tests__/saved_dashboards.js b/src/core_plugins/kibana/public/dashboard/__tests__/saved_dashboards.js index 2da3a5b9c679..9acee593b860 100644 --- a/src/core_plugins/kibana/public/dashboard/__tests__/saved_dashboards.js +++ b/src/core_plugins/kibana/public/dashboard/__tests__/saved_dashboards.js @@ -10,6 +10,6 @@ describe('SavedDashboards Service', function () { })); it('delete returns a native promise', function () { - expect(savedDashboardLoader.delete(['1','2'])).to.be.a(Promise); + expect(savedDashboardLoader.delete(['1', '2'])).to.be.a(Promise); }); }); diff --git a/src/core_plugins/kibana/public/dashboard/index.js b/src/core_plugins/kibana/public/dashboard/index.js index 5a3219232468..160d76ab71cf 100644 --- a/src/core_plugins/kibana/public/dashboard/index.js +++ b/src/core_plugins/kibana/public/dashboard/index.js @@ -51,7 +51,7 @@ uiRoutes } }) .catch(courier.redirectWhenMissing({ - 'dashboard' : DashboardConstants.LANDING_PAGE_PATH + 'dashboard': DashboardConstants.LANDING_PAGE_PATH })); } } diff --git a/src/core_plugins/kibana/public/dashboard/panel/panel_options_menu.js b/src/core_plugins/kibana/public/dashboard/panel/panel_options_menu.js index fed9fbcfd22e..2dbbd1691d3e 100644 --- a/src/core_plugins/kibana/public/dashboard/panel/panel_options_menu.js +++ b/src/core_plugins/kibana/public/dashboard/panel/panel_options_menu.js @@ -120,7 +120,7 @@ export class PanelOptionsMenu extends React.Component { PanelOptionsMenu.propTypes = { onEditPanel: PropTypes.func.isRequired, - onToggleExpandPanel: PropTypes.func.isRequired, + onToggleExpandPanel: PropTypes.func.isRequired, isExpanded: PropTypes.bool.isRequired, onDeletePanel: PropTypes.func, // Not available when the panel is expanded. }; diff --git a/src/core_plugins/kibana/public/dev_tools/hacks/__tests__/hide_empty_tools.js b/src/core_plugins/kibana/public/dev_tools/hacks/__tests__/hide_empty_tools.js index f38c876a9258..e6d3a5be172d 100644 --- a/src/core_plugins/kibana/public/dev_tools/hacks/__tests__/hide_empty_tools.js +++ b/src/core_plugins/kibana/public/dev_tools/hacks/__tests__/hide_empty_tools.js @@ -21,7 +21,7 @@ describe('hide dev tools', function () { beforeEach(function () { navlinks = {}; - sinon.stub(chrome, 'getNavLinkById',function () { + sinon.stub(chrome, 'getNavLinkById', function () { return navlinks; }); }); diff --git a/src/core_plugins/kibana/public/discover/directives/timechart.js b/src/core_plugins/kibana/public/discover/directives/timechart.js index 30ca7beba8e1..7f73cc559049 100644 --- a/src/core_plugins/kibana/public/discover/directives/timechart.js +++ b/src/core_plugins/kibana/public/discover/directives/timechart.js @@ -7,7 +7,7 @@ uiModules return { restrict: 'E', - scope : { + scope: { data: '=' }, link: function ($scope, elem) { diff --git a/src/core_plugins/kibana/public/field_formats/__tests__/_boolean.js b/src/core_plugins/kibana/public/field_formats/__tests__/_boolean.js index daeb283261af..bfab938d62df 100644 --- a/src/core_plugins/kibana/public/field_formats/__tests__/_boolean.js +++ b/src/core_plugins/kibana/public/field_formats/__tests__/_boolean.js @@ -46,7 +46,7 @@ describe('Boolean Format', function () { expected: 'true' }, { - input: ' True ',//should handle trailing and mixed case + input: ' True ', //should handle trailing and mixed case expected: 'true' } ].forEach((test)=> { diff --git a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/indexed_fields_table/indexed_fields_table.js b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/indexed_fields_table/indexed_fields_table.js index 2c0d3aecd6c9..49b50533d8ae 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/indexed_fields_table/indexed_fields_table.js +++ b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/indexed_fields_table/indexed_fields_table.js @@ -26,7 +26,7 @@ uiModules.get('apps/management') { title: 'type' }, { title: 'format' }, { title: 'searchable', info: 'These fields can be used in the filter bar' }, - { title: 'aggregatable' , info: 'These fields can be used in visualization aggregations' }, + { title: 'aggregatable', info: 'These fields can be used in visualization aggregations' }, { title: 'excluded', info: 'Fields that are excluded from _source when it is fetched' }, { title: 'controls', sortable: false } ]; diff --git a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/scripted_fields_table/date_scripts.js b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/scripted_fields_table/date_scripts.js index fcf2a7ddf83d..559bb2a31a80 100644 --- a/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/scripted_fields_table/date_scripts.js +++ b/src/core_plugins/kibana/public/management/sections/indices/edit_index_pattern/scripted_fields_table/date_scripts.js @@ -3,15 +3,15 @@ import _ from 'lodash'; export function dateScripts(indexPattern) { const dateScripts = {}; const scripts = { - __dayOfMonth: 'dayOfMonth', - __dayOfWeek: 'dayOfWeek', - __dayOfYear: 'dayOfYear', - __hourOfDay: 'hourOfDay', - __minuteOfDay: 'minuteOfDay', + __dayOfMonth: 'dayOfMonth', + __dayOfWeek: 'dayOfWeek', + __dayOfYear: 'dayOfYear', + __hourOfDay: 'hourOfDay', + __minuteOfDay: 'minuteOfDay', __minuteOfHour: 'minuteOfHour', - __monthOfYear: 'monthOfYear', - __weekOfYear: 'weekOfWeekyear', - __year: 'year' + __monthOfYear: 'monthOfYear', + __weekOfYear: 'weekOfWeekyear', + __year: 'year' }; _.each(indexPattern.fields.byType.date, function (field) { diff --git a/src/core_plugins/kibana/public/management/sections/objects/_objects.js b/src/core_plugins/kibana/public/management/sections/objects/_objects.js index c030568450fb..3aaec6e96b94 100644 --- a/src/core_plugins/kibana/public/management/sections/objects/_objects.js +++ b/src/core_plugins/kibana/public/management/sections/objects/_objects.js @@ -225,7 +225,7 @@ uiModules.get('apps/management') obj.id = doc._id; return obj.applyESResp(doc) .then(() => { - return obj.save({ confirmOverwrite : !overwriteAll }); + return obj.save({ confirmOverwrite: !overwriteAll }); }) .catch((err) => { if (err instanceof SavedObjectNotFound && err.savedObjectType === 'index-pattern') { @@ -276,7 +276,7 @@ uiModules.get('apps/management') return; } return obj.hydrateIndexPattern(newIndexId) - .then(() => obj.save({ confirmOverwrite : !overwriteAll })); + .then(() => obj.save({ confirmOverwrite: !overwriteAll })); } ).then(refreshData); }, diff --git a/src/core_plugins/metrics/index.js b/src/core_plugins/metrics/index.js index 5dd9f8fdc735..8593f377e959 100644 --- a/src/core_plugins/metrics/index.js +++ b/src/core_plugins/metrics/index.js @@ -3,7 +3,7 @@ import visDataRoutes from './server/routes/vis'; export default function (kibana) { return new kibana.Plugin({ - require: ['kibana','elasticsearch'], + require: ['kibana', 'elasticsearch'], uiExports: { visTypes: [ diff --git a/src/core_plugins/metrics/public/components/lib/__tests__/collection_actions.js b/src/core_plugins/metrics/public/components/lib/__tests__/collection_actions.js index d3329601f812..da1c7a9d303c 100644 --- a/src/core_plugins/metrics/public/components/lib/__tests__/collection_actions.js +++ b/src/core_plugins/metrics/public/components/lib/__tests__/collection_actions.js @@ -18,7 +18,7 @@ describe('collection actions', () => { handleChange.call(null, props, { id: 1, title: 'bar' }); expect(fn.calledOnce).to.equal(true); expect(fn.firstCall.args[0]).to.eql({ - test: [{ id:1, title: 'bar' }] + test: [{ id: 1, title: 'bar' }] }); }); @@ -34,7 +34,7 @@ describe('collection actions', () => { expect(fn.calledOnce).to.equal(true); expect(newItemFn.calledOnce).to.equal(true); expect(fn.firstCall.args[0]).to.eql({ - test: [{ id:1, title: 'foo' }, { id: 2, title: 'example' }] + test: [{ id: 1, title: 'foo' }, { id: 2, title: 'example' }] }); }); diff --git a/src/core_plugins/metrics/public/components/vis_types/top_n/vis.js b/src/core_plugins/metrics/public/components/vis_types/top_n/vis.js index b3978a13869d..00d8b71bfd74 100644 --- a/src/core_plugins/metrics/public/components/vis_types/top_n/vis.js +++ b/src/core_plugins/metrics/public/components/vis_types/top_n/vis.js @@ -24,7 +24,7 @@ function sortSeries(visData, model) { }); const direction = item.terms_direction || 'desc'; if (item.terms_order_by === '_term') return acc.concat(itemSeries); - return acc.concat(sortByDirection(itemSeries, direction , s => getLastValue(s.data))); + return acc.concat(sortByDirection(itemSeries, direction, s => getLastValue(s.data))); }, []); } diff --git a/src/core_plugins/metrics/public/kbn_vis_types/index.js b/src/core_plugins/metrics/public/kbn_vis_types/index.js index 50942c02b7ea..e7b72a90e416 100644 --- a/src/core_plugins/metrics/public/kbn_vis_types/index.js +++ b/src/core_plugins/metrics/public/kbn_vis_types/index.js @@ -50,7 +50,7 @@ export default function MetricsVisProvider(Private) { interval: 'auto', axis_position: 'left', axis_formatter: 'number', - show_legend:1, + show_legend: 1, show_grid: 1 }, component: require('../components/vis_editor') diff --git a/src/core_plugins/metrics/public/visualizations/lib/__tests__/get_last_value.js b/src/core_plugins/metrics/public/visualizations/lib/__tests__/get_last_value.js index 1c70f45f62b2..df4d82086964 100644 --- a/src/core_plugins/metrics/public/visualizations/lib/__tests__/get_last_value.js +++ b/src/core_plugins/metrics/public/visualizations/lib/__tests__/get_last_value.js @@ -8,12 +8,12 @@ describe('getLastValue(data)', () => { }); it('returns the last value', () => { - const data = [[1,1]]; + const data = [[1, 1]]; expect(getLastValue(data)).to.equal(1); }); it('returns the second to last value if the last value is null (default)', () => { - const data = [[1,4], [2, null]]; + const data = [[1, 4], [2, null]]; expect(getLastValue(data)).to.equal(4); }); @@ -23,7 +23,7 @@ describe('getLastValue(data)', () => { }); it('returns the N to last value if the last N-1 values are null (default)', () => { - const data = [[1,4], [2, null], [3, null]]; + const data = [[1, 4], [2, null], [3, null]]; expect(getLastValue(data, 3)).to.equal(4); }); diff --git a/src/core_plugins/metrics/server/lib/vis_data/helpers/get_agg_value.js b/src/core_plugins/metrics/server/lib/vis_data/helpers/get_agg_value.js index 53399f9ad13e..d924f2605d89 100644 --- a/src/core_plugins/metrics/server/lib/vis_data/helpers/get_agg_value.js +++ b/src/core_plugins/metrics/server/lib/vis_data/helpers/get_agg_value.js @@ -4,7 +4,7 @@ export default (row, metric) => { // Extended Stats if (_.includes(extendStatsTypes, metric.type)) { const isStdDeviation = /^std_deviation/.test(metric.type); - const modeIsBounds = ~['upper','lower'].indexOf(metric.mode); + const modeIsBounds = ~['upper', 'lower'].indexOf(metric.mode); if (isStdDeviation && modeIsBounds) { return _.get(row, `${metric.id}.std_deviation_bounds.${metric.mode}`); } diff --git a/src/core_plugins/metrics/server/lib/vis_data/helpers/get_buckets_path.js b/src/core_plugins/metrics/server/lib/vis_data/helpers/get_buckets_path.js index 4d5b2d8e0158..911b714a7e58 100644 --- a/src/core_plugins/metrics/server/lib/vis_data/helpers/get_buckets_path.js +++ b/src/core_plugins/metrics/server/lib/vis_data/helpers/get_buckets_path.js @@ -24,7 +24,7 @@ export default (id, metrics) => { case 'std_deviation': case 'variance': case 'sum_of_squares': - if (/^std_deviation/.test(metric.type) && ~['upper','lower'].indexOf(metric.mode)) { + if (/^std_deviation/.test(metric.type) && ~['upper', 'lower'].indexOf(metric.mode)) { bucketsPath += `[std_${metric.mode}]`; } else { bucketsPath += `[${metric.type}]`; diff --git a/src/core_plugins/metrics/server/lib/vis_data/helpers/get_split_colors.js b/src/core_plugins/metrics/server/lib/vis_data/helpers/get_split_colors.js index 40d92ec56d71..e290fa93aa74 100644 --- a/src/core_plugins/metrics/server/lib/vis_data/helpers/get_split_colors.js +++ b/src/core_plugins/metrics/server/lib/vis_data/helpers/get_split_colors.js @@ -6,8 +6,8 @@ export default function getSplitColors(inputColor, size = 10, style = 'gradient' if (style === 'rainbow') { return [ - '#68BC00', '#009CE0', '#B0BC00', '#16A5A5', '#D33115', '#E27300', '#FCC400','#7B64FF', '#FA28FF', '#333333', '#808080', - '#194D33', '#0062B1', '#808900', '#0C797D', '#9F0500', '#C45100', '#FB9E00','#653294', '#AB149E', '#0F1419', '#666666' + '#68BC00', '#009CE0', '#B0BC00', '#16A5A5', '#D33115', '#E27300', '#FCC400', '#7B64FF', '#FA28FF', '#333333', '#808080', + '#194D33', '#0062B1', '#808900', '#0C797D', '#9F0500', '#C45100', '#FB9E00', '#653294', '#AB149E', '#0F1419', '#666666' ]; } else { colors.push(color.hex()); diff --git a/src/core_plugins/metrics/server/lib/vis_data/request_processors/annotations/date_histogram.js b/src/core_plugins/metrics/server/lib/vis_data/request_processors/annotations/date_histogram.js index f64ab9ad5fba..ca121683e6b3 100644 --- a/src/core_plugins/metrics/server/lib/vis_data/request_processors/annotations/date_histogram.js +++ b/src/core_plugins/metrics/server/lib/vis_data/request_processors/annotations/date_histogram.js @@ -6,7 +6,7 @@ export default function dateHistogram(req, panel, annotation) { const timeField = annotation.time_field; const { bucketSize, intervalString } = getBucketSize(req, 'auto'); const { from, to } = getTimerange(req); - const { timezone:time_zone } = req.payload.timerange; + const { timezone: time_zone } = req.payload.timerange; _.set(doc, `aggs.${annotation.id}.date_histogram`, { field: timeField, interval: intervalString, diff --git a/src/core_plugins/metrics/server/lib/vis_data/request_processors/series/date_histogram.js b/src/core_plugins/metrics/server/lib/vis_data/request_processors/series/date_histogram.js index fcbb07a6f273..618a0003da01 100644 --- a/src/core_plugins/metrics/server/lib/vis_data/request_processors/series/date_histogram.js +++ b/src/core_plugins/metrics/server/lib/vis_data/request_processors/series/date_histogram.js @@ -7,7 +7,7 @@ export default function dateHistogram(req, panel, series) { const { timeField, interval } = getIntervalAndTimefield(panel, series); const { intervalString } = getBucketSize(req, interval); const { from, to } = offsetTime(req, series.offset_time); - const { timezone:time_zone } = req.payload.timerange; + const { timezone: time_zone } = req.payload.timerange; set(doc, `aggs.${series.id}.aggs.timeseries.date_histogram`, { field: timeField, diff --git a/src/core_plugins/metrics/server/lib/vis_data/response_processors/series/__tests__/_series_agg.js b/src/core_plugins/metrics/server/lib/vis_data/response_processors/series/__tests__/_series_agg.js index d089f770c657..7e9f91f8aaa6 100644 --- a/src/core_plugins/metrics/server/lib/vis_data/response_processors/series/__tests__/_series_agg.js +++ b/src/core_plugins/metrics/server/lib/vis_data/response_processors/series/__tests__/_series_agg.js @@ -3,33 +3,33 @@ import seriesAgg from '../_series_agg'; describe('seriesAgg', () => { const series = [ - [[0,2],[1,1],[2,3]], - [[0,4],[1,2],[2,3]], - [[0,2],[1,1],[2,3]] + [[0, 2], [1, 1], [2, 3]], + [[0, 4], [1, 2], [2, 3]], + [[0, 2], [1, 1], [2, 3]] ]; describe('basic', () => { it('returns the series sum', () => { expect(seriesAgg.sum(series)).to.eql([ - [[0,8], [1,4], [2,9]] + [[0, 8], [1, 4], [2, 9]] ]); }); it('returns the series max', () => { expect(seriesAgg.max(series)).to.eql([ - [[0,4], [1,2], [2,3]] + [[0, 4], [1, 2], [2, 3]] ]); }); it('returns the series min', () => { expect(seriesAgg.min(series)).to.eql([ - [[0,2], [1,1], [2,3]] + [[0, 2], [1, 1], [2, 3]] ]); }); it('returns the series mean', () => { expect(seriesAgg.mean(series)).to.eql([ - [[0,(8 / 3)], [1,(4 / 3)], [2,3]] + [[0, (8 / 3)], [1, (4 / 3)], [2, 3]] ]); }); }); @@ -37,26 +37,26 @@ describe('seriesAgg', () => { describe('overall', () => { it('returns the series overall sum', () => { expect(seriesAgg.overall_sum(series)).to.eql([ - [[0,21], [1,21], [2,21]] + [[0, 21], [1, 21], [2, 21]] ]); }); it('returns the series overall max', () => { expect(seriesAgg.overall_max(series)).to.eql([ - [[0,4], [1,4], [2,4]] + [[0, 4], [1, 4], [2, 4]] ]); }); it('returns the series overall min', () => { expect(seriesAgg.overall_min(series)).to.eql([ - [[0,1], [1,1], [2,1]] + [[0, 1], [1, 1], [2, 1]] ]); }); it('returns the series overall mean', () => { const value = ((8) + (4) + 9) / 3; expect(seriesAgg.overall_avg(series)).to.eql([ - [[0,value], [1,value], [2,value]] + [[0, value], [1, value], [2, value]] ]); }); @@ -65,7 +65,7 @@ describe('seriesAgg', () => { describe('cumlative sum', () => { it('returns the series cumlative sum', () => { expect(seriesAgg.cumlative_sum(series)).to.eql([ - [[0,8], [1,12], [2,21]] + [[0, 8], [1, 12], [2, 21]] ]); }); }); diff --git a/src/core_plugins/metrics/server/lib/vis_data/response_processors/series/__tests__/percentile.js b/src/core_plugins/metrics/server/lib/vis_data/response_processors/series/__tests__/percentile.js index 2be59fa7409e..f64109fea72f 100644 --- a/src/core_plugins/metrics/server/lib/vis_data/response_processors/series/__tests__/percentile.js +++ b/src/core_plugins/metrics/server/lib/vis_data/response_processors/series/__tests__/percentile.js @@ -86,8 +86,8 @@ describe('percentile(resp, panel, series)', () => { expect(results[0]).to.have.property('points'); expect(results[0].points).to.eql({ show: false }); expect(results[0].data).to.eql([ - [1,1], - [2,1.2] + [1, 1], + [2, 1.2] ]); expect(results[1]).to.have.property('id', '10-90:test:90'); @@ -103,8 +103,8 @@ describe('percentile(resp, panel, series)', () => { expect(results[1]).to.have.property('points'); expect(results[1].points).to.eql({ show: false }); expect(results[1].data).to.eql([ - [1,5], - [2,5.3] + [1, 5], + [2, 5.3] ]); expect(results[2]).to.have.property('id', '50:test'); @@ -127,8 +127,8 @@ describe('percentile(resp, panel, series)', () => { expect(results[2]).to.have.property('points'); expect(results[2].points).to.eql({ show: true, lineWidth: 1, radius: 1 }); expect(results[2].data).to.eql([ - [1,2.5], - [2,2.7] + [1, 2.5], + [2, 2.7] ]); diff --git a/src/core_plugins/metrics/server/lib/vis_data/response_processors/series/__tests__/std_metric.js b/src/core_plugins/metrics/server/lib/vis_data/response_processors/series/__tests__/std_metric.js index f9d5be1760e9..12b9fea086f1 100644 --- a/src/core_plugins/metrics/server/lib/vis_data/response_processors/series/__tests__/std_metric.js +++ b/src/core_plugins/metrics/server/lib/vis_data/response_processors/series/__tests__/std_metric.js @@ -75,7 +75,7 @@ describe('stdMetric(resp, panel, series)', () => { expect(results[0]).to.have.property('stack'); expect(results[0]).to.have.property('bars'); expect(results[0]).to.have.property('points'); - expect(results[0].data).to.eql([ [1,1], [2,2] ]); + expect(results[0].data).to.eql([ [1, 1], [2, 2] ]); }); }); diff --git a/src/core_plugins/table_vis/public/table_vis.js b/src/core_plugins/table_vis/public/table_vis.js index 47a335ccecfd..1f3f9a063912 100644 --- a/src/core_plugins/table_vis/public/table_vis.js +++ b/src/core_plugins/table_vis/public/table_vis.js @@ -58,7 +58,7 @@ function TableVisTypeProvider(Private) { group: 'metrics', name: 'metric', title: 'Metric', - aggFilter: ['!geo_centroid','!geo_bounds'], + aggFilter: ['!geo_centroid', '!geo_bounds'], min: 1, defaults: [ { type: 'count', schema: 'metric' } diff --git a/src/core_plugins/tagcloud/public/tag_cloud_vis.js b/src/core_plugins/tagcloud/public/tag_cloud_vis.js index df1975d701fa..180757e86540 100644 --- a/src/core_plugins/tagcloud/public/tag_cloud_vis.js +++ b/src/core_plugins/tagcloud/public/tag_cloud_vis.js @@ -41,7 +41,7 @@ VisTypesRegistryProvider.register(function TagCloudProvider(Private) { title: 'Tag Size', min: 1, max: 1, - aggFilter: ['!std_dev', '!percentiles', '!percentile_ranks', '!derivative','!geo_bounds','!geo_centroid'], + aggFilter: ['!std_dev', '!percentiles', '!percentile_ranks', '!derivative', '!geo_bounds', '!geo_centroid'], defaults: [ { schema: 'metric', type: 'count' } ] diff --git a/src/core_plugins/tile_map/public/__tests__/geohash_layer.js b/src/core_plugins/tile_map/public/__tests__/geohash_layer.js index fd59197daec2..684a85f78f62 100644 --- a/src/core_plugins/tile_map/public/__tests__/geohash_layer.js +++ b/src/core_plugins/tile_map/public/__tests__/geohash_layer.js @@ -56,7 +56,7 @@ describe('kibana_map tests', function () { [ { - options: { mapType: 'Scaled Circle Markers' }, + options: { mapType: 'Scaled Circle Markers' }, expected: scaledCircleMarkersPng }, { diff --git a/src/core_plugins/tile_map/public/__tests__/kibana_map.js b/src/core_plugins/tile_map/public/__tests__/kibana_map.js index f79a72b9b337..de05394b045d 100644 --- a/src/core_plugins/tile_map/public/__tests__/kibana_map.js +++ b/src/core_plugins/tile_map/public/__tests__/kibana_map.js @@ -37,7 +37,7 @@ describe('kibana_map tests', function () { kibanaMap = new KibanaMap(domNode, { minZoom: 1, maxZoom: 10, - center: [0,0], + center: [0, 0], zoom: 0 }); }); @@ -86,7 +86,7 @@ describe('kibana_map tests', function () { kibanaMap = new KibanaMap(domNode, { minZoom: 1, maxZoom: 10, - center: [0,0], + center: [0, 0], zoom: 2 }); }); @@ -106,7 +106,7 @@ describe('kibana_map tests', function () { kibanaMap = new KibanaMap(noHeightNode, { minZoom: 1, maxZoom: 10, - center: [0,0], + center: [0, 0], zoom: 10 }); }); @@ -130,7 +130,7 @@ describe('kibana_map tests', function () { kibanaMap = new KibanaMap(noWidthNode, { minZoom: 1, maxZoom: 10, - center: [0,0], + center: [0, 0], zoom: 10 }); }); @@ -199,7 +199,7 @@ describe('kibana_map tests', function () { kibanaMap = new KibanaMap(domNode, { minZoom: 1, maxZoom: 10, - center: [0,0], + center: [0, 0], zoom: 0 }); }); diff --git a/src/core_plugins/tile_map/public/maps_visualization.js b/src/core_plugins/tile_map/public/maps_visualization.js index a6ac81cca737..232c147af382 100644 --- a/src/core_plugins/tile_map/public/maps_visualization.js +++ b/src/core_plugins/tile_map/public/maps_visualization.js @@ -330,7 +330,7 @@ export function MapsVisualizationProvider(serviceSettings, Notifier, getAppState searchSource.aggs(function () { const geoBoundsAgg = new AggConfig(agg.vis, { type: 'geo_bounds', - enabled:true, + enabled: true, params: { field: agg.getField() }, diff --git a/src/core_plugins/timelion/public/services/tick_formatters.js b/src/core_plugins/timelion/public/services/tick_formatters.js index 402d359e0604..2014fbc63634 100644 --- a/src/core_plugins/timelion/public/services/tick_formatters.js +++ b/src/core_plugins/timelion/public/services/tick_formatters.js @@ -21,7 +21,7 @@ function baseTickFormatter(value, axis) { export default function tickFormatters() { const formatters = { 'bits': function (val) { - const labels = ['b','kb','mb','gb','tb','pb']; + const labels = ['b', 'kb', 'mb', 'gb', 'tb', 'pb']; let index = 0; while (val >= 1000 && index < labels.length) { val /= 1000; @@ -30,7 +30,7 @@ export default function tickFormatters() { return (Math.round(val * 100) / 100) + labels[index]; }, 'bits/s': function (val) { - const labels = ['b/s','kb/s','mb/s','gb/s','tb/s','pb/s']; + const labels = ['b/s', 'kb/s', 'mb/s', 'gb/s', 'tb/s', 'pb/s']; let index = 0; while (val >= 1000 && index < labels.length) { val /= 1000; @@ -39,7 +39,7 @@ export default function tickFormatters() { return (Math.round(val * 100) / 100) + labels[index]; }, 'bytes': function (val) { - const labels = ['B','KB','MB','GB','TB','PB']; + const labels = ['B', 'KB', 'MB', 'GB', 'TB', 'PB']; let index = 0; while (val >= 1024 && index < labels.length) { val /= 1024; @@ -48,7 +48,7 @@ export default function tickFormatters() { return (Math.round(val * 100) / 100) + labels[index]; }, 'bytes/s': function (val) { - const labels = ['B/s','KB/s','MB/s','GB/s','TB/s','PB/s']; + const labels = ['B/s', 'KB/s', 'MB/s', 'GB/s', 'TB/s', 'PB/s']; let index = 0; while (val >= 1024 && index < labels.length) { val /= 1024; diff --git a/src/core_plugins/timelion/server/handlers/chain_runner.js b/src/core_plugins/timelion/server/handlers/chain_runner.js index 0f677c74eea8..a60c8e858e0f 100644 --- a/src/core_plugins/timelion/server/handlers/chain_runner.js +++ b/src/core_plugins/timelion/server/handlers/chain_runner.js @@ -93,7 +93,7 @@ export default function chainRunner(tlConfig) { } return promise.then(function (result) { - return invokeChain({ type:'chain', chain: chain }, [result]); + return invokeChain({ type: 'chain', chain: chain }, [result]); }); } diff --git a/src/core_plugins/timelion/server/routes/validate_es.js b/src/core_plugins/timelion/server/routes/validate_es.js index 7802c09a6196..ade9f65cfc3d 100644 --- a/src/core_plugins/timelion/server/routes/validate_es.js +++ b/src/core_plugins/timelion/server/routes/validate_es.js @@ -10,7 +10,7 @@ export default function (server) { const body = { index: uiSettings['es.default_index'], - fields:timefield + fields: timefield }; callWithRequest(request, 'fieldStats', body).then(function (resp) { diff --git a/src/core_plugins/timelion/server/series_functions/__tests__/color.js b/src/core_plugins/timelion/server/series_functions/__tests__/color.js index 40c40cb5ed90..8afc14ece9ba 100644 --- a/src/core_plugins/timelion/server/series_functions/__tests__/color.js +++ b/src/core_plugins/timelion/server/series_functions/__tests__/color.js @@ -23,7 +23,7 @@ describe(filename, () => { const expected = ['#000000', '#111111', '#222222', '#333333']; const fourLongList = { type: 'seriesList', - list: seriesList.list.slice(0,4) + list: seriesList.list.slice(0, 4) }; return invoke(fn, [fourLongList, '#000:#333']).then((r) => { const colors = _.map(r.output.list, 'color'); diff --git a/src/core_plugins/timelion/server/series_functions/__tests__/condition.js b/src/core_plugins/timelion/server/series_functions/__tests__/condition.js index 96236853c270..762c424dbe75 100644 --- a/src/core_plugins/timelion/server/series_functions/__tests__/condition.js +++ b/src/core_plugins/timelion/server/series_functions/__tests__/condition.js @@ -12,7 +12,7 @@ describe(filename, function () { let seriesList; beforeEach(function () { seriesList = require('./fixtures/seriesList.js')(); - comparable = getSeriesList('',[ + comparable = getSeriesList('', [ [moment.utc('1980-01-01T00:00:00.000Z'), 12], [moment.utc('1981-01-01T00:00:00.000Z'), 33], [moment.utc('1982-01-01T00:00:00.000Z'), 82], diff --git a/src/core_plugins/timelion/server/series_functions/__tests__/es.js b/src/core_plugins/timelion/server/series_functions/__tests__/es.js index 9151619c3e1c..a9ac28c260a9 100644 --- a/src/core_plugins/timelion/server/series_functions/__tests__/es.js +++ b/src/core_plugins/timelion/server/series_functions/__tests__/es.js @@ -16,7 +16,7 @@ import invoke from './helpers/invoke_series_fn.js'; function stubResponse(response) { return { server: { - plugins:{ + plugins: { elasticsearch: { getCluster: sinon.stub().withArgs('data').returns({ callWithRequest: function () { @@ -153,7 +153,7 @@ describe(filename, () => { from: 1, to: 5, }, - request: { payload: { extended: { es: { filter:{ + request: { payload: { extended: { es: { filter: { bool: { must: [ { query: { query_string: { query: 'foo' } } } @@ -229,7 +229,7 @@ describe(filename, () => { ]; expect(fn(buckets)).to.eql({ - count:[[1000,3],[2000,14],[3000,15]] + count: [[1000, 3], [2000, 14], [3000, 15]] }); }); @@ -241,8 +241,8 @@ describe(filename, () => { ]; expect(fn(buckets)).to.eql({ - count:[[1000,3],[2000,14],[3000,15]], - max: [[1000,92],[2000,65],[3000,35]] + count: [[1000, 3], [2000, 14], [3000, 15]], + max: [[1000, 92], [2000, 65], [3000, 35]] }); }); }); @@ -250,82 +250,82 @@ describe(filename, () => { it('should throw an error', () => { expect(aggResponse.default(esResponse.aggregations, config)).to.eql([ { - data: [[1000,264],[2000,264]], + data: [[1000, 264], [2000, 264]], fit: 'nearest', label: 'q:QueryA > FieldA:ValueA > FieldB:Value2A > MetricA', type: 'series', - },{ - data: [[1000,398],[2000,1124]], + }, { + data: [[1000, 398], [2000, 1124]], fit: 'nearest', label: 'q:QueryA > FieldA:ValueA > FieldB:Value2A > MetricB', type: 'series', - },{ - data: [[1000,699],[2000,110]], + }, { + data: [[1000, 699], [2000, 110]], fit: 'nearest', label: 'q:QueryA > FieldA:ValueA > FieldB:Value2B > MetricA', type: 'series', - },{ - data: [[1000,457],[2000,506]], + }, { + data: [[1000, 457], [2000, 506]], fit: 'nearest', label: 'q:QueryA > FieldA:ValueA > FieldB:Value2B > MetricB', type: 'series', - },{ - data: [[1000,152],[2000,518]], + }, { + data: [[1000, 152], [2000, 518]], fit: 'nearest', label: 'q:QueryA > FieldA:ValueB > FieldB:Value2B > MetricA', type: 'series', - },{ - data: [[1000,61],[2000,77]], + }, { + data: [[1000, 61], [2000, 77]], fit: 'nearest', label: 'q:QueryA > FieldA:ValueB > FieldB:Value2B > MetricB', type: 'series', - },{ - data: [[1000,114],[2000,264]], + }, { + data: [[1000, 114], [2000, 264]], fit: 'nearest', label: 'q:QueryA > FieldA:ValueB > FieldB:Value2A > MetricA', type: 'series', - },{ - data: [[1000,23],[2000,45]], + }, { + data: [[1000, 23], [2000, 45]], fit: 'nearest', label: 'q:QueryA > FieldA:ValueB > FieldB:Value2A > MetricB', type: 'series', - },{ - data: [[1000,621],[2000,751]], + }, { + data: [[1000, 621], [2000, 751]], fit: 'nearest', label: 'q:QueryB > FieldA:ValueA > FieldB:Value2B > MetricA', type: 'series', - },{ - data: [[1000,12],[2000,12]], + }, { + data: [[1000, 12], [2000, 12]], fit: 'nearest', label: 'q:QueryB > FieldA:ValueA > FieldB:Value2B > MetricB', type: 'series', - },{ - data: [[1000,110],[2000,648]], + }, { + data: [[1000, 110], [2000, 648]], fit: 'nearest', label: 'q:QueryB > FieldA:ValueA > FieldB:Value2A > MetricA', type: 'series', - },{ - data: [[1000,11],[2000,12]], + }, { + data: [[1000, 11], [2000, 12]], fit: 'nearest', label: 'q:QueryB > FieldA:ValueA > FieldB:Value2A > MetricB', type: 'series', - },{ - data: [[1000,755],[2000,713]], + }, { + data: [[1000, 755], [2000, 713]], fit: 'nearest', label: 'q:QueryB > FieldA:ValueC > FieldB:Value2C > MetricA', type: 'series', - },{ - data: [[1000,10],[2000,18]], + }, { + data: [[1000, 10], [2000, 18]], fit: 'nearest', label: 'q:QueryB > FieldA:ValueC > FieldB:Value2C > MetricB', type: 'series', - },{ - data: [[1000,391],[2000,802]], + }, { + data: [[1000, 391], [2000, 802]], fit: 'nearest', label: 'q:QueryB > FieldA:ValueC > FieldB:Value2A > MetricA', type: 'series', - },{ - data: [[1000,4],[2000,4]], + }, { + data: [[1000, 4], [2000, 4]], fit: 'nearest', label: 'q:QueryB > FieldA:ValueC > FieldB:Value2A > MetricB', type: 'series', diff --git a/src/core_plugins/timelion/server/series_functions/__tests__/fit.js b/src/core_plugins/timelion/server/series_functions/__tests__/fit.js index 216f39841ed4..d0db419aa547 100644 --- a/src/core_plugins/timelion/server/series_functions/__tests__/fit.js +++ b/src/core_plugins/timelion/server/series_functions/__tests__/fit.js @@ -10,7 +10,7 @@ describe(filename, function () { describe('carry', function () { it('should maintain the previous value until it changes', function () { - const seriesList = getSeriesList('',[ + const seriesList = getSeriesList('', [ [moment.utc('1980-01-01T00:00:00.000Z'), 5], [moment.utc('1981-01-01T00:00:00.000Z'), null], [moment.utc('1982-01-01T00:00:00.000Z'), 3.4], @@ -27,7 +27,7 @@ describe(filename, function () { describe('nearest', function () { it('should use the closest temporal value to fill the null', function () { - const seriesList = getSeriesList('',[ + const seriesList = getSeriesList('', [ [moment.utc('1980-01-01T00:00:00.000Z'), 5], [moment.utc('1981-01-01T00:00:00.000Z'), null], [moment.utc('1981-05-01T00:00:00.000Z'), 3.4], @@ -46,7 +46,7 @@ describe(filename, function () { describe('average', function () { it('should produce a smooth, straight line between points', function () { - const seriesList = getSeriesList('',[ + const seriesList = getSeriesList('', [ [moment.utc('1980-01-01T00:00:00.000Z'), 10], [moment.utc('1981-07-01T00:00:00.000Z'), null], [moment.utc('1982-01-01T00:00:00.000Z'), null], diff --git a/src/core_plugins/timelion/server/series_functions/__tests__/helpers/get_series.js b/src/core_plugins/timelion/server/series_functions/__tests__/helpers/get_series.js index 782fabbb7387..571e03e6d12b 100644 --- a/src/core_plugins/timelion/server/series_functions/__tests__/helpers/get_series.js +++ b/src/core_plugins/timelion/server/series_functions/__tests__/helpers/get_series.js @@ -3,7 +3,7 @@ import _ from 'lodash'; export default function getSeries(name, buckets, points) { const fill = _.partial(_.zip, _.map(buckets, function (bucket) { return bucket.valueOf(); })); return { - data: fill(points), + data: fill(points), type: 'series', label: name }; diff --git a/src/core_plugins/timelion/server/series_functions/__tests__/legend.js b/src/core_plugins/timelion/server/series_functions/__tests__/legend.js index 1f821e98b677..b27280176d00 100644 --- a/src/core_plugins/timelion/server/series_functions/__tests__/legend.js +++ b/src/core_plugins/timelion/server/series_functions/__tests__/legend.js @@ -14,7 +14,7 @@ describe(filename, () => { it('should create the _global object if it does not exist', () => { expect(seriesList.list[0]._global).to.equal(undefined); return invoke(fn, [seriesList, 'nw', 3]).then((r) => { - expect(r.output.list[0]._global).to.eql({ legend:{ noColumns: 3, position: 'nw' } }); + expect(r.output.list[0]._global).to.eql({ legend: { noColumns: 3, position: 'nw' } }); }); }); diff --git a/src/core_plugins/timelion/server/series_functions/__tests__/quandl.js b/src/core_plugins/timelion/server/series_functions/__tests__/quandl.js index 3e98f2fb93a9..972e363aafe1 100644 --- a/src/core_plugins/timelion/server/series_functions/__tests__/quandl.js +++ b/src/core_plugins/timelion/server/series_functions/__tests__/quandl.js @@ -66,7 +66,7 @@ describe(filename, function () { }); it('should throw an error is passed an unsupported interval', function () { - return invoke(fn, [], { time:{ interval:'2d' } }) + return invoke(fn, [], { time: { interval: '2d' } }) .then(expect.fail) .catch(function (r) { expect(r).to.be.an('error'); @@ -74,7 +74,7 @@ describe(filename, function () { }); it('should use the configured API key when talking to quandl', function () { - return invoke(fn, [], { settings:{ 'timelion:quandl.key': 'bEeR' } }).then(function () { + return invoke(fn, [], { settings: { 'timelion:quandl.key': 'bEeR' } }).then(function () { expect(calledWith.params.auth_token).to.eql('bEeR'); }); }); diff --git a/src/core_plugins/timelion/server/series_functions/es/lib/build_request.js b/src/core_plugins/timelion/server/series_functions/es/lib/build_request.js index 8356027f9613..f2dc174eedcd 100644 --- a/src/core_plugins/timelion/server/series_functions/es/lib/build_request.js +++ b/src/core_plugins/timelion/server/series_functions/es/lib/build_request.js @@ -5,7 +5,7 @@ export default function buildRequest(config, tlConfig) { const bool = { must: [] }; - const timeFilter = { range:{} }; + const timeFilter = { range: {} }; timeFilter.range[config.timefield] = { gte: tlConfig.time.from, lte: tlConfig.time.to, format: 'epoch_millis' }; bool.must.push(timeFilter); @@ -19,7 +19,7 @@ export default function buildRequest(config, tlConfig) { meta: { type: 'split' }, filters: { filters: _.chain(config.q).map(function (q) { - return [q, { query_string:{ query: q } }]; + return [q, { query_string: { query: q } }]; }).zipObject().value(), }, aggs: {} diff --git a/src/core_plugins/timelion/server/series_functions/graphite.js b/src/core_plugins/timelion/server/series_functions/graphite.js index 686aaeac13d8..e47097e3834a 100644 --- a/src/core_plugins/timelion/server/series_functions/graphite.js +++ b/src/core_plugins/timelion/server/series_functions/graphite.js @@ -19,7 +19,7 @@ export default new Datasource ('graphite', { const time = { min: moment(tlConfig.time.from).format('HH:mm[_]YYYYMMDD'), - max: moment(tlConfig.time.to).format('HH:mm[_]YYYYMMDD') + max: moment(tlConfig.time.to).format('HH:mm[_]YYYYMMDD') }; const URL = tlConfig.settings['timelion:graphite.url'] + '/render/' + diff --git a/src/core_plugins/timelion/server/series_functions/label.js b/src/core_plugins/timelion/server/series_functions/label.js index 862d2f84d749..95240f8bbaa2 100644 --- a/src/core_plugins/timelion/server/series_functions/label.js +++ b/src/core_plugins/timelion/server/series_functions/label.js @@ -19,7 +19,7 @@ export default new Chainable('label', { } ], help: 'Change the label of the series. Use %s reference the existing label', - fn: function labelFn(args) { + fn: function labelFn(args) { const config = args.byName; return alter(args, function (eachSeries) { if (config.regex) { diff --git a/src/core_plugins/timelion/server/series_functions/movingaverage.js b/src/core_plugins/timelion/server/series_functions/movingaverage.js index 541fdd560f2f..c36a75763ce1 100644 --- a/src/core_plugins/timelion/server/series_functions/movingaverage.js +++ b/src/core_plugins/timelion/server/series_functions/movingaverage.js @@ -67,13 +67,13 @@ export default new Chainable('movingaverage', { eachSeries.data = _.map(pairs, function (point, i) { const cursor = i + 1; if (cursor < _window) return [point[0], null]; - return toPoint(point, pairs.slice(cursor - _window , cursor)); + return toPoint(point, pairs.slice(cursor - _window, cursor)); }); } else if (_position === 'right') { eachSeries.data = _.map(pairs, function (point, i) { if (i > pairsLen - _window) return [point[0], null]; - return toPoint(point, pairs.slice(i , i + _window)); + return toPoint(point, pairs.slice(i, i + _window)); }); } diff --git a/src/core_plugins/timelion/server/series_functions/quandl.js b/src/core_plugins/timelion/server/series_functions/quandl.js index 1cd69380686e..6c6d1cf5aaab 100644 --- a/src/core_plugins/timelion/server/series_functions/quandl.js +++ b/src/core_plugins/timelion/server/series_functions/quandl.js @@ -49,7 +49,7 @@ export default new Datasource ('quandl', { const time = { min: moment.utc(tlConfig.time.from).format('YYYY-MM-DD'), - max: moment.utc(tlConfig.time.to).format('YYYY-MM-DD') + max: moment.utc(tlConfig.time.to).format('YYYY-MM-DD') }; // POSITIONS @@ -74,7 +74,7 @@ export default new Datasource ('quandl', { return { type: 'seriesList', list: [{ - data: data, + data: data, type: 'series', fit: 'nearest', label: resp.name diff --git a/src/core_plugins/timelion/server/series_functions/worldbank.js b/src/core_plugins/timelion/server/series_functions/worldbank.js index cf3c65a14045..5573d852e4bd 100644 --- a/src/core_plugins/timelion/server/series_functions/worldbank.js +++ b/src/core_plugins/timelion/server/series_functions/worldbank.js @@ -28,7 +28,7 @@ export default new Datasource ('worldbank', { const time = { min: moment(tlConfig.time.from).format('YYYY'), - max: moment(tlConfig.time.to).format('YYYY') + max: moment(tlConfig.time.to).format('YYYY') }; const URL = 'http://api.worldbank.org/' + config.code + @@ -60,7 +60,7 @@ export default new Datasource ('worldbank', { return { type: 'seriesList', list: [{ - data: data, + data: data, type: 'series', label: description, _meta: { diff --git a/src/core_plugins/timelion/server/series_functions/yaxis.js b/src/core_plugins/timelion/server/series_functions/yaxis.js index 5edd65be07d2..b816f65ef87f 100644 --- a/src/core_plugins/timelion/server/series_functions/yaxis.js +++ b/src/core_plugins/timelion/server/series_functions/yaxis.js @@ -2,13 +2,13 @@ import _ from 'lodash'; import alter from '../lib/alter.js'; import Chainable from '../lib/classes/chainable'; const tickFormatters = { - 'bits':'bits', - 'bits/s':'bits/s', - 'bytes':'bytes', - 'bytes/s':'bytes/s', - 'currency':'currency(:ISO 4217 currency code)', - 'percent':'percent', - 'custom':'custom(:prefix:suffix)' + 'bits': 'bits', + 'bits/s': 'bits/s', + 'bytes': 'bytes', + 'bytes/s': 'bytes/s', + 'currency': 'currency(:ISO 4217 currency code)', + 'percent': 'percent', + 'custom': 'custom(:prefix:suffix)' }; export default new Chainable('yaxis', { diff --git a/src/es_archiver/lib/archives/__tests__/format.js b/src/es_archiver/lib/archives/__tests__/format.js index e3a8a62e9d98..8ad186e402c6 100644 --- a/src/es_archiver/lib/archives/__tests__/format.js +++ b/src/es_archiver/lib/archives/__tests__/format.js @@ -11,7 +11,7 @@ import { import { createFormatArchiveStreams } from '../format'; -const INPUTS = [1, 2, { foo: 'bar' }, [1,2]]; +const INPUTS = [1, 2, { foo: 'bar' }, [1, 2]]; const INPUT_JSON = INPUTS.map(i => JSON.stringify(i, null, 2)).join('\n\n'); describe('esArchiver createFormatArchiveStreams', () => { @@ -55,7 +55,7 @@ describe('esArchiver createFormatArchiveStreams', () => { it('streams consume js values and produces buffers', async () => { const output = await createPromiseFromStreams([ - createListStream([1, 2, { foo: 'bar' }, [1,2]]), + createListStream([1, 2, { foo: 'bar' }, [1, 2]]), ...createFormatArchiveStreams({ gzip: true }), createConcatStream([]) ]); diff --git a/src/es_archiver/lib/archives/__tests__/parse.js b/src/es_archiver/lib/archives/__tests__/parse.js index 9db8545397d3..f585b1c6d985 100644 --- a/src/es_archiver/lib/archives/__tests__/parse.js +++ b/src/es_archiver/lib/archives/__tests__/parse.js @@ -76,7 +76,7 @@ describe('esArchiver createParseArchiveStreams', () => { expect(await receivedPromise).to.eql({ a: 1 }); input.write(Buffer.from('{"a": 2}')); input.end(); - expect(await finalPromise).to.eql([{ a: 1 }, { a:2 }]); + expect(await finalPromise).to.eql([{ a: 1 }, { a: 2 }]); }); }); diff --git a/src/fixtures/search_response.js b/src/fixtures/search_response.js index a035e7ccf2e3..55a13192eab7 100644 --- a/src/fixtures/search_response.js +++ b/src/fixtures/search_response.js @@ -9,8 +9,8 @@ export default { failed: 0 }, hits: { - total : 49487, - max_score : 1.0, + total: 49487, + max_score: 1.0, hits: hits } }; \ No newline at end of file diff --git a/src/server/config/transform_deprecations.js b/src/server/config/transform_deprecations.js index cab42419e914..f6f4c6906c5e 100644 --- a/src/server/config/transform_deprecations.js +++ b/src/server/config/transform_deprecations.js @@ -1,4 +1,4 @@ -import _ , { partial } from 'lodash'; +import _, { partial } from 'lodash'; import { createTransform, Deprecations } from '../../deprecation'; const { rename, unused } = Deprecations; diff --git a/src/server/saved_objects/client/__tests__/saved_objects_client.js b/src/server/saved_objects/client/__tests__/saved_objects_client.js index 866450e5aae3..88cd9e983d43 100644 --- a/src/server/saved_objects/client/__tests__/saved_objects_client.js +++ b/src/server/saved_objects/client/__tests__/saved_objects_client.js @@ -515,7 +515,7 @@ describe('SavedObjectsClient', () => { it('reports error on missed objects', async () => { callAdminCluster.returns(Promise.resolve({ - docs:[{ + docs: [{ _type: 'doc', _id: 'config:good', found: true, diff --git a/src/server/status/__tests__/cgroup.js b/src/server/status/__tests__/cgroup.js index 8b0d83d16a84..3f3261cc4de7 100644 --- a/src/server/status/__tests__/cgroup.js +++ b/src/server/status/__tests__/cgroup.js @@ -41,7 +41,7 @@ describe('Control Group', function () { expect(cpuStat).to.eql({ number_of_elapsed_periods: 0, number_of_times_throttled: 10, - time_throttled_nanos: 20 + time_throttled_nanos: 20 }); }); @@ -52,7 +52,7 @@ describe('Control Group', function () { expect(cpuStat).to.eql({ number_of_elapsed_periods: -1, number_of_times_throttled: -1, - time_throttled_nanos: -1 + time_throttled_nanos: -1 }); }); }); diff --git a/src/server/status/metrics.js b/src/server/status/metrics.js index d82adaa54cda..da9f2c731905 100644 --- a/src/server/status/metrics.js +++ b/src/server/status/metrics.js @@ -30,7 +30,7 @@ export class Metrics { process: { mem: { heap_max_in_bytes: get(hapiEvent, 'psmem.heapTotal'), - heap_used_in_bytes: get(hapiEvent, 'psmem.heapUsed') + heap_used_in_bytes: get(hapiEvent, 'psmem.heapUsed') } }, os: { @@ -43,10 +43,10 @@ export class Metrics { } }, response_times: { - avg_in_millis: get(hapiEvent, ['responseTimes', port, 'avg']), + avg_in_millis: get(hapiEvent, ['responseTimes', port, 'avg']), max_in_millis: get(hapiEvent, ['responseTimes', port, 'max']) }, - requests: keysToSnakeCaseShallow(get(hapiEvent, ['requests', port])), + requests: keysToSnakeCaseShallow(get(hapiEvent, ['requests', port])), concurrent_connections: get(hapiEvent, ['concurrents', port]) }; } diff --git a/src/ui/i18n/__tests__/i18n.js b/src/ui/i18n/__tests__/i18n.js index 480b454cb531..f903f0dbd9a4 100644 --- a/src/ui/i18n/__tests__/i18n.js +++ b/src/ui/i18n/__tests__/i18n.js @@ -27,7 +27,7 @@ describe('ui/i18n module', function () { describe('getTranslations', function () { - it('should return the translations for en locale as registered' , function () { + it('should return the translations for en locale as registered', function () { const languageTag = ['en']; const expectedTranslationJson = { 'test_plugin_1-NO_SSL': 'Dont run the dev server using HTTPS', @@ -38,7 +38,7 @@ describe('ui/i18n module', function () { return checkTranslations(expectedTranslationJson, languageTag, i18nObj); }); - it('should return the translations for de locale as registered' , function () { + it('should return the translations for de locale as registered', function () { const languageTag = ['de']; const expectedTranslationJson = { 'test_plugin_1-NO_SSL': 'Dont run the DE dev server using HTTPS', @@ -47,7 +47,7 @@ describe('ui/i18n module', function () { return checkTranslations(expectedTranslationJson, languageTag, i18nObj); }); - it('should pick the highest priority language for which translations exist' , function () { + it('should pick the highest priority language for which translations exist', function () { const languageTags = ['es-ES', 'de', 'en']; const expectedTranslations = { 'test_plugin_1-NO_SSL': 'Dont run the DE dev server using HTTPS', @@ -56,16 +56,16 @@ describe('ui/i18n module', function () { return checkTranslations(expectedTranslations, languageTags, i18nObj); }); - it('should return translations for highest priority locale where best case match is chosen from registered locales' , function () { + it('should return translations for highest priority locale where best case match is chosen from registered locales', function () { const languageTags = ['es', 'de']; const expectedTranslations = { 'test_plugin_1-NO_SSL': 'Dont run the es-ES dev server using HTTPS! I am regsitered afterwards!' }; - i18nObj.registerTranslations(join(FIXTURES, 'translations', 'test_plugin_1','es-ES.json')); + i18nObj.registerTranslations(join(FIXTURES, 'translations', 'test_plugin_1', 'es-ES.json')); return checkTranslations(expectedTranslations, languageTags, i18nObj); }); - it('should return an empty object for locales with no translations' , function () { + it('should return an empty object for locales with no translations', function () { const languageTags = ['ja-JA', 'fr']; return checkTranslations({}, languageTags, i18nObj); }); @@ -74,7 +74,7 @@ describe('ui/i18n module', function () { describe('getTranslationsForDefaultLocale', function () { - it('should return translations for default locale which is set to the en locale' , function () { + it('should return translations for default locale which is set to the en locale', function () { const i18nObj1 = new I18n('en'); const expectedTranslations = { 'test_plugin_1-NO_SSL': 'Dont run the dev server using HTTPS', @@ -82,17 +82,17 @@ describe('ui/i18n module', function () { 'test_plugin_1-NO_RUN_SERVER': 'Dont run the dev server', 'test_plugin_1-HOME': 'Run along home now!' }; - i18nObj1.registerTranslations(join(FIXTURES, 'translations', 'test_plugin_1','en.json')); + i18nObj1.registerTranslations(join(FIXTURES, 'translations', 'test_plugin_1', 'en.json')); return checkTranslationsForDefaultLocale(expectedTranslations, i18nObj1); }); - it('should return translations for default locale which is set to the de locale' , function () { + it('should return translations for default locale which is set to the de locale', function () { const i18nObj1 = new I18n('de'); const expectedTranslations = { 'test_plugin_1-NO_SSL': 'Dont run the DE dev server using HTTPS', 'test_plugin_1-DEV': 'Run the DE server with development mode defaults', }; - i18nObj1.registerTranslations(join(FIXTURES, 'translations', 'test_plugin_1','de.json')); + i18nObj1.registerTranslations(join(FIXTURES, 'translations', 'test_plugin_1', 'de.json')); return checkTranslationsForDefaultLocale(expectedTranslations, i18nObj1); }); @@ -100,7 +100,7 @@ describe('ui/i18n module', function () { describe('getAllTranslations', function () { - it('should return all translations' , function () { + it('should return all translations', function () { const expectedTranslations = { de: { 'test_plugin_1-NO_SSL': 'Dont run the DE dev server using HTTPS', @@ -142,7 +142,7 @@ describe('ui/i18n module', function () { describe('getTranslations', function () { - it('should return the translations for en locale as registered' , function () { + it('should return the translations for en locale as registered', function () { const languageTag = ['en']; const expectedTranslationJson = { 'test_plugin_1-NO_SSL': 'Dont run the dev server using HTTPS', @@ -157,7 +157,7 @@ describe('ui/i18n module', function () { return checkTranslations(expectedTranslationJson, languageTag, i18nObj); }); - it('should return the translations for de locale as registered' , function () { + it('should return the translations for de locale as registered', function () { const languageTag = ['de']; const expectedTranslationJson = { 'test_plugin_1-NO_SSL': 'Dont run the DE dev server using HTTPS', @@ -166,7 +166,7 @@ describe('ui/i18n module', function () { return checkTranslations(expectedTranslationJson, languageTag, i18nObj); }); - it('should return the most recently registered translation for a key that has multiple translations' , function () { + it('should return the most recently registered translation for a key that has multiple translations', function () { i18nObj.registerTranslations(join(FIXTURES, 'translations', 'test_plugin_2', 'de.json')); const languageTag = ['de']; const expectedTranslationJson = { diff --git a/src/ui/public/__tests__/errors.js b/src/ui/public/__tests__/errors.js index 2e01dec46174..3f6c47a5f956 100644 --- a/src/ui/public/__tests__/errors.js +++ b/src/ui/public/__tests__/errors.js @@ -30,7 +30,7 @@ describe('ui/errors', () => { new SearchTimeout(), new RequestFailure('an error', { }), new FetchFailure({ }), - new ShardFailure({ '_shards' : 5 }), + new ShardFailure({ '_shards': 5 }), new VersionConflict({ }), new MappingConflict({ }), new RestrictedMapping('field', 'indexPattern'), diff --git a/src/ui/public/agg_response/point_series/__tests__/_get_point.js b/src/ui/public/agg_response/point_series/__tests__/_get_point.js index cc41538e588a..9a61c7846ec9 100644 --- a/src/ui/public/agg_response/point_series/__tests__/_get_point.js +++ b/src/ui/public/agg_response/point_series/__tests__/_get_point.js @@ -86,7 +86,7 @@ describe('getPoint', function () { }); it ('adds the aggConfig to the points', function () { - const seriesAspect = { i: 1, agg: truthFormatted }; + const seriesAspect = { i: 1, agg: truthFormatted }; const point = getPoint(xAspect, seriesAspect, yScale, row, yAspect); expect(point).to.have.property('aggConfig', truthFormatted); diff --git a/src/ui/public/agg_table/__tests__/_table.js b/src/ui/public/agg_table/__tests__/_table.js index 18954f36e5f9..91e64252823a 100644 --- a/src/ui/public/agg_table/__tests__/_table.js +++ b/src/ui/public/agg_table/__tests__/_table.js @@ -119,7 +119,7 @@ describe('AggTable Directive', function () { { type: 'min', schema: 'metric', params: { field: '@timestamp' } }, { type: 'terms', schema: 'bucket', params: { field: 'extension' } }, { type: 'date_histogram', schema: 'bucket', params: { field: '@timestamp', interval: 'd' } }, - { type: 'derivative', schema: 'metric', params: { metricAgg: 'custom', customMetric: { id:'5-orderAgg', type: 'count' } } }, + { type: 'derivative', schema: 'metric', params: { metricAgg: 'custom', customMetric: { id: '5-orderAgg', type: 'count' } } }, { type: 'top_hits', schema: 'metric', params: { field: 'bytes', aggregate: { val: 'min' }, size: 1 } } ] }); diff --git a/src/ui/public/agg_types/__tests__/buckets/date_histogram/_editor.js b/src/ui/public/agg_types/__tests__/buckets/date_histogram/_editor.js index edbca8af1a05..12592c71e092 100644 --- a/src/ui/public/agg_types/__tests__/buckets/date_histogram/_editor.js +++ b/src/ui/public/agg_types/__tests__/buckets/date_histogram/_editor.js @@ -33,7 +33,7 @@ describe('editor', function () { render = function (params) { vis = new Vis(indexPattern, { type: 'histogram', - aggs:[ + aggs: [ { schema: 'metric', type: 'avg', params: { field: 'bytes' } }, { schema: 'segment', type: 'date_histogram', params: params || {} } ] diff --git a/src/ui/public/agg_types/__tests__/metrics/parent_pipeline.js b/src/ui/public/agg_types/__tests__/metrics/parent_pipeline.js index 2074813f6282..a1998318dcfc 100644 --- a/src/ui/public/agg_types/__tests__/metrics/parent_pipeline.js +++ b/src/ui/public/agg_types/__tests__/metrics/parent_pipeline.js @@ -79,7 +79,7 @@ describe('parent pipeline aggs', function () { init({ metricAgg: 'custom', customMetric: { - id:'1-orderAgg', + id: '1-orderAgg', type: 'max', params: { field: 'bytes' }, schema: 'orderAgg' @@ -92,12 +92,12 @@ describe('parent pipeline aggs', function () { init({ metricAgg: 'custom', customMetric: { - id:'2-orderAgg', + id: '2-orderAgg', type: metric.name, params: { buckets_path: 'custom', customMetric: { - id:'2-orderAgg-orderAgg', + id: '2-orderAgg-orderAgg', type: 'count', schema: 'orderAgg' } @@ -112,7 +112,7 @@ describe('parent pipeline aggs', function () { init({ metricAgg: 'custom', customMetric: { - id:'2-metric', + id: '2-metric', type: 'max', params: { field: 'bytes' }, schema: 'orderAgg' @@ -126,12 +126,12 @@ describe('parent pipeline aggs', function () { init({ metricAgg: 'custom', customMetric: { - id:'2-metric', + id: '2-metric', type: metric.name, params: { buckets_path: 'custom', customMetric: { - id:'2-metric-metric', + id: '2-metric-metric', type: 'max', params: { field: 'bytes' }, schema: 'orderAgg' @@ -155,12 +155,12 @@ describe('parent pipeline aggs', function () { init({ metricAgg: 'custom', customMetric: { - id:'2-metric', + id: '2-metric', type: metric.name, params: { buckets_path: 'custom', customMetric: { - id:'2-metric-metric', + id: '2-metric-metric', type: 'max', params: { field: 'bytes' }, schema: 'orderAgg' diff --git a/src/ui/public/agg_types/buckets/geo_hash.js b/src/ui/public/agg_types/buckets/geo_hash.js index cfdda6cd002e..5d2f6b8f092e 100644 --- a/src/ui/public/agg_types/buckets/geo_hash.js +++ b/src/ui/public/agg_types/buckets/geo_hash.js @@ -128,7 +128,7 @@ export function AggTypesBucketsGeoHashProvider(Private, config) { aggs.push(new AggConfig(agg.vis, { type: 'filter', id: 'filter_agg', - enabled:true, + enabled: true, params: { geo_bounding_box: boundingBox }, @@ -144,7 +144,7 @@ export function AggTypesBucketsGeoHashProvider(Private, config) { if (agg.params.useGeocentroid) { aggs.push(new AggConfig(agg.vis, { type: 'geo_centroid', - enabled:true, + enabled: true, params: { field: agg.getField() }, diff --git a/src/ui/public/courier/__tests__/saved_object.js b/src/ui/public/courier/__tests__/saved_object.js index 088d9a370652..369248cc2f48 100644 --- a/src/ui/public/courier/__tests__/saved_object.js +++ b/src/ui/public/courier/__tests__/saved_object.js @@ -85,7 +85,7 @@ describe('Saved Object', function () { describe('with confirmOverwrite', function () { function stubConfirmOverwrite() { window.confirm = sinon.stub().returns(true); - sinon.stub(esDataStub, 'create').returns(BluebirdPromise.reject({ status : 409 })); + sinon.stub(esDataStub, 'create').returns(BluebirdPromise.reject({ status: 409 })); } describe('when true', function () { @@ -100,7 +100,7 @@ describe('Saved Object', function () { savedObject.lastSavedTitle = 'original title'; savedObject.title = 'new title'; - return savedObject.save({ confirmOverwrite : true }) + return savedObject.save({ confirmOverwrite: true }) .then(() => { expect(window.confirm.called).to.be(true); expect(savedObject.id).to.be('myId'); @@ -120,7 +120,7 @@ describe('Saved Object', function () { savedObject.lastSavedTitle = 'original title'; savedObject.title = 'new title'; - return savedObject.save({ confirmOverwrite : true }) + return savedObject.save({ confirmOverwrite: true }) .then(() => { expect(savedObject.id).to.be('HI'); expect(savedObject.isSaving).to.be(false); @@ -157,7 +157,7 @@ describe('Saved Object', function () { sinon.stub(savedObjectsClientStub, 'create').returns(BluebirdPromise.resolve({ id: 'myId' })); - return savedObject.save({ confirmOverwrite : false }).then(() => { + return savedObject.save({ confirmOverwrite: false }).then(() => { expect(window.confirm.called).to.be(false); }); }); diff --git a/src/ui/public/courier/fetch/request/__tests__/segmented_create_queue.js b/src/ui/public/courier/fetch/request/__tests__/segmented_create_queue.js index 9d78e39c8ac8..edf7e725dc53 100644 --- a/src/ui/public/courier/fetch/request/__tests__/segmented_create_queue.js +++ b/src/ui/public/courier/fetch/request/__tests__/segmented_create_queue.js @@ -38,7 +38,7 @@ describe('ui/courier/fetch/request/segmented/_createQueue', () => { it('relies on indexPattern.toDetailedIndexList to generate queue', async function () { const source = new MockSource(); const ip = source.get('index'); - const indices = [1,2,3]; + const indices = [1, 2, 3]; sinon.stub(ip, 'toDetailedIndexList').returns(Promise.resolve(indices)); const req = new SegmentedReq(source); @@ -50,7 +50,7 @@ describe('ui/courier/fetch/request/segmented/_createQueue', () => { const source = new MockSource(); const ip = source.get('index'); const req = new SegmentedReq(source); - sinon.stub(ip, 'toDetailedIndexList').returns(Promise.resolve([1,2,3])); + sinon.stub(ip, 'toDetailedIndexList').returns(Promise.resolve([1, 2, 3])); req.setDirection('asc'); await req._createQueue(); diff --git a/src/ui/public/directives/__tests__/timepicker.js b/src/ui/public/directives/__tests__/timepicker.js index cdba25628813..675fb53b4f0c 100644 --- a/src/ui/public/directives/__tests__/timepicker.js +++ b/src/ui/public/directives/__tests__/timepicker.js @@ -30,14 +30,14 @@ const init = function () { // Add some parameters to it const timefilter = { - time : { + time: { from: moment().subtract(15, 'minutes'), to: moment(), mode: undefined }, - refreshInterval : { - value : 0, - display : 'Off' + refreshInterval: { + value: 0, + display: 'Off' } }; $parentScope.timefilter = timefilter; @@ -101,19 +101,19 @@ describe('timepicker directive', function () { }); it('should have a $scope.setRefreshInterval() that calls handler', function () { - $scope.setRefreshInterval({ value : 10000 }); + $scope.setRefreshInterval({ value: 10000 }); sinon.assert.calledOnce($parentScope.updateInterval); expect($parentScope.updateInterval.firstCall.args[0]).to.have.property('value', 10000); }); it('should unpause when setRefreshInterval is called without pause:true', function () { - $scope.setRefreshInterval({ value : 1000, pause: true }); + $scope.setRefreshInterval({ value: 1000, pause: true }); expect($parentScope.updateInterval.getCall(0).args[0]).to.have.property('pause', true); - $scope.setRefreshInterval({ value : 1000, pause: false }); + $scope.setRefreshInterval({ value: 1000, pause: false }); expect($parentScope.updateInterval.getCall(1).args[0]).to.have.property('pause', false); - $scope.setRefreshInterval({ value : 1000 }); + $scope.setRefreshInterval({ value: 1000 }); expect($parentScope.updateInterval.getCall(2).args[0]).to.have.property('pause', false); }); diff --git a/src/ui/public/doc_table/__tests__/actions/filter.js b/src/ui/public/doc_table/__tests__/actions/filter.js index 931d8a8ec760..7f001f969241 100644 --- a/src/ui/public/doc_table/__tests__/actions/filter.js +++ b/src/ui/public/doc_table/__tests__/actions/filter.js @@ -38,7 +38,7 @@ describe('doc table filter actions', function () { expect(filterManager.add.calledWith(...args)).to.be(true); }); - it('should add an operator style "is" function to kuery queries' , function () { + it('should add an operator style "is" function to kuery queries', function () { const state = { query: { query: '', language: 'kuery' } }; @@ -46,7 +46,7 @@ describe('doc table filter actions', function () { expect(state.query.query).to.be('"foo":"bar"'); }); - it('should combine the new clause with any existing query clauses using an implicit "and"' , function () { + it('should combine the new clause with any existing query clauses using an implicit "and"', function () { const state = { query: { query: 'foo', language: 'kuery' } }; @@ -54,7 +54,7 @@ describe('doc table filter actions', function () { expect(state.query.query).to.be('foo "foo":"bar"'); }); - it('should support creation of negated clauses' , function () { + it('should support creation of negated clauses', function () { const state = { query: { query: 'foo', language: 'kuery' } }; @@ -62,7 +62,7 @@ describe('doc table filter actions', function () { expect(state.query.query).to.be('foo !"foo":"bar"'); }); - it('should add an exists query when the provided field name is "_exists_"' , function () { + it('should add an exists query when the provided field name is "_exists_"', function () { const state = { query: { query: 'foo', language: 'kuery' } }; diff --git a/src/ui/public/filter_bar/__tests__/push_filter.js b/src/ui/public/filter_bar/__tests__/push_filter.js index bdd4e953ee4a..0cde92bb6841 100644 --- a/src/ui/public/filter_bar/__tests__/push_filter.js +++ b/src/ui/public/filter_bar/__tests__/push_filter.js @@ -25,7 +25,7 @@ describe('Filter Bar pushFilter()', function () { let filter; beforeEach(ngMock.inject(function () { - $state = { $newFilters:[] }; + $state = { $newFilters: [] }; pushFilter = pushFilterFn($state); filter = { query: { query_string: { query: '' } } }; })); diff --git a/src/ui/public/filter_bar/lib/__tests__/extract_time_filter.js b/src/ui/public/filter_bar/lib/__tests__/extract_time_filter.js index a5f91b0b9fca..847b162b6056 100644 --- a/src/ui/public/filter_bar/lib/__tests__/extract_time_filter.js +++ b/src/ui/public/filter_bar/lib/__tests__/extract_time_filter.js @@ -22,7 +22,7 @@ describe('Filter Bar Directive', function () { it('should return the matching filter for the defualt time field', function (done) { const filters = [ - { meta: { index: 'logstash-*' }, query: { match: { _type: { query: 'apache', type: 'phrase' } } } }, + { meta: { index: 'logstash-*' }, query: { match: { _type: { query: 'apache', type: 'phrase' } } } }, { meta: { index: 'logstash-*' }, range: { 'time': { gt: 1388559600000, lt: 1388646000000 } } } ]; extractTimeFilter(filters).then(function (filter) { @@ -34,7 +34,7 @@ describe('Filter Bar Directive', function () { it('should not return the non-matching filter for the defualt time field', function (done) { const filters = [ - { meta: { index: 'logstash-*' }, query: { match: { _type: { query: 'apache', type: 'phrase' } } } }, + { meta: { index: 'logstash-*' }, query: { match: { _type: { query: 'apache', type: 'phrase' } } } }, { meta: { index: 'logstash-*' }, range: { '@timestamp': { gt: 1388559600000, lt: 1388646000000 } } } ]; extractTimeFilter(filters).then(function (filter) { diff --git a/src/ui/public/filter_bar/lib/__tests__/filter_out_time_based_filter.js b/src/ui/public/filter_bar/lib/__tests__/filter_out_time_based_filter.js index 5832b5a537f4..2bee23f623e9 100644 --- a/src/ui/public/filter_bar/lib/__tests__/filter_out_time_based_filter.js +++ b/src/ui/public/filter_bar/lib/__tests__/filter_out_time_based_filter.js @@ -23,7 +23,7 @@ describe('Filter Bar Directive', function () { it('should return the matching filter for the defualt time field', function (done) { const filters = [ - { meta: { index: 'logstash-*' }, query: { match: { _type: { query: 'apache', type: 'phrase' } } } }, + { meta: { index: 'logstash-*' }, query: { match: { _type: { query: 'apache', type: 'phrase' } } } }, { meta: { index: 'logstash-*' }, range: { 'time': { gt: 1388559600000, lt: 1388646000000 } } } ]; filterOutTimeBasedFilter(filters).then(function (results) { diff --git a/src/ui/public/index_patterns/__tests__/_index_pattern.js b/src/ui/public/index_patterns/__tests__/_index_pattern.js index 19f15496bd52..c6c1c00ce155 100644 --- a/src/ui/public/index_patterns/__tests__/_index_pattern.js +++ b/src/ui/public/index_patterns/__tests__/_index_pattern.js @@ -457,7 +457,7 @@ describe('index pattern', function () { expect(notif).to.have.property('type', 'warning'); expect(notif.content).to.match(MARKDOWN_LINK_RE); - const [,text,url] = notif.content.match(MARKDOWN_LINK_RE); + const [, text, url] = notif.content.match(MARKDOWN_LINK_RE); expect(text).to.contain(indexPattern.title); expect(url).to.contain(indexPattern.id); expect(url).to.contain('management/kibana/indices'); diff --git a/src/ui/public/indexed_array/__tests__/indexed_array.js b/src/ui/public/indexed_array/__tests__/indexed_array.js index c1bb004b5875..ac9618a50168 100644 --- a/src/ui/public/indexed_array/__tests__/indexed_array.js +++ b/src/ui/public/indexed_array/__tests__/indexed_array.js @@ -6,7 +6,7 @@ import { IndexedArray } from 'ui/indexed_array'; // this is generally a data-structure that IndexedArray is good for managing const users = [ { name: 'John', id: 69, username: 'beast', group: 'admins' }, - { name: 'Anon', id: 0, username: 'shhhh', group: 'secret' }, + { name: 'Anon', id: 0, username: 'shhhh', group: 'secret' }, { name: 'Fern', id: 42, username: 'kitty', group: 'editor' }, { name: 'Mary', id: 55, username: 'sheep', group: 'editor' } ]; diff --git a/src/ui/public/kuery/functions/exists.js b/src/ui/public/kuery/functions/exists.js index 2b30026a22f0..5728969b98e8 100644 --- a/src/ui/public/kuery/functions/exists.js +++ b/src/ui/public/kuery/functions/exists.js @@ -7,7 +7,7 @@ export function buildNodeParams(fieldName) { } export function toElasticsearchQuery(node, indexPattern) { - const { arguments: [ fieldNameArg ] } = node; + const { arguments: [ fieldNameArg ] } = node; const fieldName = literal.toElasticsearchQuery(fieldNameArg); const field = indexPattern.fields.byName[fieldName]; diff --git a/src/ui/public/kuery/functions/is.js b/src/ui/public/kuery/functions/is.js index 0f58fa7302b5..32313ba2efca 100644 --- a/src/ui/public/kuery/functions/is.js +++ b/src/ui/public/kuery/functions/is.js @@ -17,7 +17,7 @@ export function buildNodeParams(fieldName, value, serializeStyle = 'operator') { } export function toElasticsearchQuery(node, indexPattern) { - const { arguments: [ fieldNameArg, valueArg ] } = node; + const { arguments: [ fieldNameArg, valueArg ] } = node; const fieldName = literal.toElasticsearchQuery(fieldNameArg); const field = indexPattern.fields.byName[fieldName]; const value = !_.isUndefined(valueArg) ? literal.toElasticsearchQuery(valueArg) : valueArg; @@ -61,7 +61,7 @@ export function toKueryExpression(node) { throw new Error(`Cannot serialize "is" function as "${node.serializeStyle}"`); } - const { arguments: [ fieldNameArg, valueArg ] } = node; + const { arguments: [ fieldNameArg, valueArg ] } = node; const fieldName = literal.toKueryExpression(fieldNameArg); const value = !_.isUndefined(valueArg) ? literal.toKueryExpression(valueArg) : valueArg; diff --git a/src/ui/public/notify/__tests__/lib/_format_es_msg.js b/src/ui/public/notify/__tests__/lib/_format_es_msg.js index fac1b10f08f1..84f1e457805c 100644 --- a/src/ui/public/notify/__tests__/lib/_format_es_msg.js +++ b/src/ui/public/notify/__tests__/lib/_format_es_msg.js @@ -21,10 +21,10 @@ describe('formatESMsg', function () { it('should return the root_cause if passed an extended elasticsearch', function () { const err = new Error('This is an elasticsearch error'); err.resp = { - error : { - root_cause : [ + error: { + root_cause: [ { - reason : 'I am the detailed message' + reason: 'I am the detailed message' } ] } @@ -38,13 +38,13 @@ describe('formatESMsg', function () { it('should combine the reason messages if more than one is returned.', function () { const err = new Error('This is an elasticsearch error'); err.resp = { - error : { - root_cause : [ + error: { + root_cause: [ { - reason : 'I am the detailed message 1' + reason: 'I am the detailed message 1' }, { - reason : 'I am the detailed message 2' + reason: 'I am the detailed message 2' } ] } diff --git a/src/ui/public/notify/__tests__/lib/_format_msg.js b/src/ui/public/notify/__tests__/lib/_format_msg.js index 33b7d966fed3..1e66c9b9a14f 100644 --- a/src/ui/public/notify/__tests__/lib/_format_msg.js +++ b/src/ui/public/notify/__tests__/lib/_format_msg.js @@ -39,11 +39,11 @@ describe('formatMsg', function () { it('should handle an extended elasticsearch error', function () { const err = { - resp : { - error : { - root_cause : [ + resp: { + error: { + root_cause: [ { - reason : 'I am the detailed message' + reason: 'I am the detailed message' } ] } diff --git a/src/ui/public/notify/__tests__/notifier.js b/src/ui/public/notify/__tests__/notifier.js index ac22f5b5ac5e..607c471593ad 100644 --- a/src/ui/public/notify/__tests__/notifier.js +++ b/src/ui/public/notify/__tests__/notifier.js @@ -14,7 +14,7 @@ describe('Notifier', function () { const customText = 'fooMarkup'; const customParams = { title: 'fooTitle', - actions:[{ + actions: [{ text: 'Cancel', callback: sinon.spy() }, { @@ -449,7 +449,7 @@ describe('Directive Notification', function () { }; const customParams = { title: 'fooTitle', - actions:[{ + actions: [{ text: 'Cancel', callback: sinon.spy() }, { diff --git a/src/ui/public/promises/__tests__/promises.js b/src/ui/public/promises/__tests__/promises.js index f9bfb6299f89..ca21f86a676c 100644 --- a/src/ui/public/promises/__tests__/promises.js +++ b/src/ui/public/promises/__tests__/promises.js @@ -114,7 +114,7 @@ describe('Promise service', function () { expect(time).to.not.be.greaterThan(2000); }); it('allows non-promises in the array', async () => { - expect(await Promise.race([1,2,3])).to.be(1); + expect(await Promise.race([1, 2, 3])).to.be(1); }); describe('argument is undefined', () => { it('rejects the promise', async () => { diff --git a/src/ui/public/timefilter/timefilter.js b/src/ui/public/timefilter/timefilter.js index 8a92a03f5aa5..51d09bb41796 100644 --- a/src/ui/public/timefilter/timefilter.js +++ b/src/ui/public/timefilter/timefilter.js @@ -89,7 +89,7 @@ uiModules if (timefield) { const bounds = this.getBounds(); - filter = { range : {} }; + filter = { range: {} }; filter.range[timefield.name] = { gte: range ? range.min.valueOf() : bounds.min.valueOf(), lte: range ? range.max.valueOf() : bounds.max.valueOf(), diff --git a/src/ui/public/timepicker/refresh_intervals.js b/src/ui/public/timepicker/refresh_intervals.js index 43941edcc8c6..2a1446d598ad 100644 --- a/src/ui/public/timepicker/refresh_intervals.js +++ b/src/ui/public/timepicker/refresh_intervals.js @@ -2,21 +2,21 @@ import { uiModules } from 'ui/modules'; const module = uiModules.get('kibana'); module.constant('refreshIntervals', [ - { value : 0, display: 'Off', section: 0 }, + { value: 0, display: 'Off', section: 0 }, - { value : 5000, display: '5 seconds', section: 1 }, - { value : 10000, display: '10 seconds', section: 1 }, - { value : 30000, display: '30 seconds', section: 1 }, - { value : 45000, display: '45 seconds', section: 1 }, + { value: 5000, display: '5 seconds', section: 1 }, + { value: 10000, display: '10 seconds', section: 1 }, + { value: 30000, display: '30 seconds', section: 1 }, + { value: 45000, display: '45 seconds', section: 1 }, - { value : 60000, display: '1 minute', section: 2 }, - { value : 300000, display: '5 minutes', section: 2 }, - { value : 900000, display: '15 minutes', section: 2 }, - { value : 1800000, display: '30 minutes', section: 2 }, + { value: 60000, display: '1 minute', section: 2 }, + { value: 300000, display: '5 minutes', section: 2 }, + { value: 900000, display: '15 minutes', section: 2 }, + { value: 1800000, display: '30 minutes', section: 2 }, - { value : 3600000, display: '1 hour', section: 3 }, - { value : 7200000, display: '2 hour', section: 3 }, - { value : 43200000, display: '12 hour', section: 3 }, - { value : 86400000, display: '1 day', section: 3 } + { value: 3600000, display: '1 hour', section: 3 }, + { value: 7200000, display: '2 hour', section: 3 }, + { value: 43200000, display: '12 hour', section: 3 }, + { value: 86400000, display: '1 day', section: 3 } ]); diff --git a/src/ui/public/timepicker/timepicker.js b/src/ui/public/timepicker/timepicker.js index f0bfead838f0..8e17316787ec 100644 --- a/src/ui/public/timepicker/timepicker.js +++ b/src/ui/public/timepicker/timepicker.js @@ -181,7 +181,7 @@ module.directive('kbnTimepicker', function (timeUnits, refreshIntervals) { $scope.applyRelative = function () { $scope.onFilterSelect({ from: getRelativeString('from'), - to: getRelativeString('to') + to: getRelativeString('to') }); }; diff --git a/src/ui/public/utils/__tests__/brush_event.js b/src/ui/public/utils/__tests__/brush_event.js index 5bc1fe156444..cb272cbb6d4c 100644 --- a/src/ui/public/utils/__tests__/brush_event.js +++ b/src/ui/public/utils/__tests__/brush_event.js @@ -27,7 +27,7 @@ describe('brushEvent', function () { let brushEvent; const baseState = { - filters:[], + filters: [], }; const baseEvent = { @@ -169,7 +169,7 @@ describe('brushEvent', function () { it('by creating a new filter', function () { const event = _.cloneDeep(numberEvent); - event.range = [1,2,3,4]; + event.range = [1, 2, 3, 4]; brushEvent(event); expect($state) .to.have.property('$newFilters'); @@ -186,7 +186,7 @@ describe('brushEvent', function () { it('by updating the existing range filter', function () { const event = _.cloneDeep(numberEvent); - event.range = [3,7]; + event.range = [3, 7]; $state.filters.push({ meta: { key: 'numberField' @@ -206,7 +206,7 @@ describe('brushEvent', function () { it('by updating the existing scripted filter', function () { const event = _.cloneDeep(numberEvent); - event.range = [3,7]; + event.range = [3, 7]; $state.filters.push({ meta: { key: 'numberField' diff --git a/src/ui/public/utils/__tests__/scanner.js b/src/ui/public/utils/__tests__/scanner.js index 3963cb06a880..45bcba36bf22 100644 --- a/src/ui/public/utils/__tests__/scanner.js +++ b/src/ui/public/utils/__tests__/scanner.js @@ -32,7 +32,7 @@ describe('Scanner', function () { let search; let scroll; let scanner; - const mockSearch = { '_scroll_id':'abc','took':1,'timed_out':false,'_shards':{ 'total':1,'successful':1,'failed':0 },'hits':{ 'total':2,'max_score':0.0,'hits':[] } }; // eslint-disable-line max-len + const mockSearch = { '_scroll_id': 'abc', 'took': 1, 'timed_out': false, '_shards': { 'total': 1, 'successful': 1, 'failed': 0 }, 'hits': { 'total': 2, 'max_score': 0.0, 'hits': [] } }; // eslint-disable-line max-len const hits = [{ _id: 'one', _type: 'config', @@ -42,7 +42,7 @@ describe('Scanner', function () { _type: 'config', _source: { title: 'Second title' } }]; - const mockScroll = { 'took':1,'timed_out':false,'_shards':{ 'total':1,'successful':1,'failed':0 },'hits':{ 'total':2,'max_score':0.0,'hits':hits } }; // eslint-disable-line max-len + const mockScroll = { 'took': 1, 'timed_out': false, '_shards': { 'total': 1, 'successful': 1, 'failed': 0 }, 'hits': { 'total': 2, 'max_score': 0.0, 'hits': hits } }; // eslint-disable-line max-len beforeEach(function () { scanner = new Scanner(http, { @@ -103,7 +103,7 @@ describe('Scanner', function () { }); it('should scroll across multiple pages', function () { - const oneResult = { 'took':1,'timed_out':false,'_shards':{ 'total':1,'successful':1,'failed':0 },'hits':{ 'total':2,'max_score':0.0,'hits':['one'] } }; // eslint-disable-line max-len + const oneResult = { 'took': 1, 'timed_out': false, '_shards': { 'total': 1, 'successful': 1, 'failed': 0 }, 'hits': { 'total': 2, 'max_score': 0.0, 'hits': ['one'] } }; // eslint-disable-line max-len scroll = sinon.stub().returns(Promise.resolve({ data: oneResult })); return scanner.scanAndMap(null, { pageSize: 1 }) .then(function (response) { diff --git a/src/ui/public/vis/__tests__/_agg_config.js b/src/ui/public/vis/__tests__/_agg_config.js index 123ed914368d..42599b6b9614 100644 --- a/src/ui/public/vis/__tests__/_agg_config.js +++ b/src/ui/public/vis/__tests__/_agg_config.js @@ -289,7 +289,7 @@ describe('AggConfig', function () { } ] } - },{ + }, { config1: { type: 'metric', aggs: [ diff --git a/src/ui/public/vis/__tests__/map/service_settings.js b/src/ui/public/vis/__tests__/map/service_settings.js index 87ff9272b6fa..7049b45e3cd4 100644 --- a/src/ui/public/vis/__tests__/map/service_settings.js +++ b/src/ui/public/vis/__tests__/map/service_settings.js @@ -178,7 +178,7 @@ describe('service_settings (FKA tilemaptest)', function () { it('should load manifest', async function () { - serviceSettings.addQueryParams({ foo:'bar' }); + serviceSettings.addQueryParams({ foo: 'bar' }); const fileLayers = await serviceSettings.getFileLayers(); fileLayers.forEach(function (fileLayer, index) { const expected = vectorManifest.layers[index]; @@ -189,7 +189,7 @@ describe('service_settings (FKA tilemaptest)', function () { expect(expected.created_at).to.eql(fileLayer.created_at); const urlObject = url.parse(fileLayer.url, true); - Object.keys({ foo:'bar', elastic_tile_service_tos: 'agree' }).forEach(key => { + Object.keys({ foo: 'bar', elastic_tile_service_tos: 'agree' }).forEach(key => { expect(urlObject.query).to.have.property(key, expected[key]); }); diff --git a/src/ui/public/vislib/__tests__/lib/layout/splits/column_chart/splits.js b/src/ui/public/vislib/__tests__/lib/layout/splits/column_chart/splits.js index 2da00208ce5f..2f4608384f4f 100644 --- a/src/ui/public/vislib/__tests__/lib/layout/splits/column_chart/splits.js +++ b/src/ui/public/vislib/__tests__/lib/layout/splits/column_chart/splits.js @@ -17,15 +17,15 @@ describe('Vislib Split Function Test Suite', function () { const data = { rows: [ { - hits : 621, - label : '', - ordered : { - date : true, + hits: 621, + label: '', + ordered: { + date: true, interval: 30000, - max : 1408734982458, - min : 1408734082458 + max: 1408734982458, + min: 1408734082458 }, - series : [ + series: [ { values: [ { @@ -75,15 +75,15 @@ describe('Vislib Split Function Test Suite', function () { yAxisLabel: 'Count' }, { - hits : 621, - label : '', - ordered : { - date : true, + hits: 621, + label: '', + ordered: { + date: true, interval: 30000, - max : 1408734982458, - min : 1408734082458 + max: 1408734982458, + min: 1408734082458 }, - series : [ + series: [ { values: [ { diff --git a/src/ui/public/vislib/__tests__/lib/layout/splits/gauge_chart/splits.js b/src/ui/public/vislib/__tests__/lib/layout/splits/gauge_chart/splits.js index 8e7c45605b31..7e14658cb5b7 100644 --- a/src/ui/public/vislib/__tests__/lib/layout/splits/gauge_chart/splits.js +++ b/src/ui/public/vislib/__tests__/lib/layout/splits/gauge_chart/splits.js @@ -13,15 +13,15 @@ describe('Vislib Gauge Split Function Test Suite', function () { const data = { rows: [ { - hits : 621, - label : '', - ordered : { - date : true, + hits: 621, + label: '', + ordered: { + date: true, interval: 30000, - max : 1408734982458, - min : 1408734082458 + max: 1408734982458, + min: 1408734082458 }, - series : [ + series: [ { values: [ { @@ -71,15 +71,15 @@ describe('Vislib Gauge Split Function Test Suite', function () { yAxisLabel: 'Count' }, { - hits : 621, - label : '', - ordered : { - date : true, + hits: 621, + label: '', + ordered: { + date: true, interval: 30000, - max : 1408734982458, - min : 1408734082458 + max: 1408734982458, + min: 1408734082458 }, - series : [ + series: [ { values: [ { diff --git a/src/ui/public/vislib/__tests__/visualizations/chart.js b/src/ui/public/vislib/__tests__/visualizations/chart.js index 862991505d50..712a4d69f9f2 100644 --- a/src/ui/public/vislib/__tests__/visualizations/chart.js +++ b/src/ui/public/vislib/__tests__/visualizations/chart.js @@ -14,15 +14,15 @@ describe('Vislib _chart Test Suite', function () { let myChart; let config; const data = { - hits : 621, - label : '', - ordered : { + hits: 621, + label: '', + ordered: { date: true, interval: 30000, - max : 1408734982458, - min : 1408734082458 + max: 1408734982458, + min: 1408734082458 }, - series : [ + series: [ { values: [ { diff --git a/src/ui/public/vislib/lib/types/point_series.js b/src/ui/public/vislib/lib/types/point_series.js index 09e73d878bec..1bf96dfa8969 100644 --- a/src/ui/public/vislib/lib/types/point_series.js +++ b/src/ui/public/vislib/lib/types/point_series.js @@ -84,9 +84,9 @@ export function VislibTypesPointSeries() { type: config.scale, setYExtents: config.setYExtents, defaultYExtents: config.defaultYExtents, - min : isUserDefinedYAxis ? config.yAxis.min : undefined, - max : isUserDefinedYAxis ? config.yAxis.max : undefined, - mode : mode + min: isUserDefinedYAxis ? config.yAxis.min : undefined, + max: isUserDefinedYAxis ? config.yAxis.max : undefined, + mode: mode }, labels: { axisFormatter: data.data.yAxisFormatter || data.get('yAxisFormatter') @@ -196,7 +196,7 @@ export function VislibTypesPointSeries() { }, labels: { filter: false, - axisFormatter: function (val) { return val; } + axisFormatter: function (val) { return val; } }, style: { rangePadding: 0, diff --git a/src/ui/public/vislib/lib/vis_config.js b/src/ui/public/vislib/lib/vis_config.js index 159052d458fa..5c51da198fd1 100644 --- a/src/ui/public/vislib/lib/vis_config.js +++ b/src/ui/public/vislib/lib/vis_config.js @@ -11,7 +11,7 @@ export function VislibVisConfigProvider(Private) { const visTypes = Private(VislibTypesProvider); const DEFAULT_VIS_CONFIG = { style: { - margin : { top: 10, right: 3, bottom: 5, left: 3 } + margin: { top: 10, right: 3, bottom: 5, left: 3 } }, alerts: [], categoryAxes: [], diff --git a/src/ui/public/visualize/visualization.js b/src/ui/public/visualize/visualization.js index d37f2b57b723..e05e3935db30 100644 --- a/src/ui/public/visualize/visualization.js +++ b/src/ui/public/visualize/visualization.js @@ -16,7 +16,7 @@ uiModules return { restrict: 'E', require: '?renderCounter', - scope : { + scope: { showSpyPanel: '=?', vis: '=', visData: '=', @@ -38,7 +38,7 @@ uiModules // Show no results message when isZeroHits is true and it requires search $scope.showNoResultsMessage = function () { const requiresSearch = _.get($scope, 'vis.type.requiresSearch'); - const isZeroHits = _.get($scope,'visData.hits.total') === 0; + const isZeroHits = _.get($scope, 'visData.hits.total') === 0; const shouldShowMessage = !_.get($scope, 'vis.params.handleNoResults'); return Boolean(requiresSearch && isZeroHits && shouldShowMessage); diff --git a/src/ui/public/visualize/visualization_editor.js b/src/ui/public/visualize/visualization_editor.js index 012ea2e66c83..79a9b0021452 100644 --- a/src/ui/public/visualize/visualization_editor.js +++ b/src/ui/public/visualize/visualization_editor.js @@ -14,7 +14,7 @@ uiModules return { restrict: 'E', require: '?renderCounter', - scope : { + scope: { vis: '=', visData: '=', uiState: '=?', diff --git a/src/ui/public/visualize/visualize.js b/src/ui/public/visualize/visualize.js index b1d9d1a7dc94..823dce6f9b78 100644 --- a/src/ui/public/visualize/visualize.js +++ b/src/ui/public/visualize/visualize.js @@ -33,7 +33,7 @@ uiModules return { restrict: 'E', - scope : { + scope: { showSpyPanel: '=?', editorMode: '=?', savedObj: '=?', diff --git a/src/utils/streams/__tests__/concat_stream.js b/src/utils/streams/__tests__/concat_stream.js index 44c7d9317b98..1741c2313fa3 100644 --- a/src/utils/streams/__tests__/concat_stream.js +++ b/src/utils/streams/__tests__/concat_stream.js @@ -9,11 +9,11 @@ import { describe('concatStream', () => { it('accepts an initial value', async () => { const output = await createPromiseFromStreams([ - createListStream([1,2,3]), + createListStream([1, 2, 3]), createConcatStream([0]) ]); - expect(output).to.eql([0,1,2,3]); + expect(output).to.eql([0, 1, 2, 3]); }); describe(`combines using the previous value's concat method`, () => { @@ -33,12 +33,12 @@ describe('concatStream', () => { const output = await createPromiseFromStreams([ createListStream([ [1], - [2,3,4], + [2, 3, 4], [10] ]), createConcatStream() ]); - expect(output).to.eql([1,2,3,4,10]); + expect(output).to.eql([1, 2, 3, 4, 10]); }); it('works with a mixture, starting with array', async () => { @@ -49,11 +49,11 @@ describe('concatStream', () => { 2, 3, 4, - [5,6,7] + [5, 6, 7] ]), createConcatStream() ]); - expect(output).to.eql([1,2,3,4,5,6,7]); + expect(output).to.eql([1, 2, 3, 4, 5, 6, 7]); }); it('fails when the value does not have a concat method', async () => { diff --git a/src/utils/streams/__tests__/list_stream.js b/src/utils/streams/__tests__/list_stream.js index 83042e117aaa..6fc8a85d8717 100644 --- a/src/utils/streams/__tests__/list_stream.js +++ b/src/utils/streams/__tests__/list_stream.js @@ -5,7 +5,7 @@ import { createListStream } from '../'; describe('listStream', () => { it('provides the values in the initial list', async () => { - const str = createListStream([1,2,3,4]); + const str = createListStream([1, 2, 3, 4]); const stub = sinon.stub(); str.on('data', stub); @@ -19,10 +19,10 @@ describe('listStream', () => { }); it('does not modify the list passed', async () => { - const list = [1,2,3,4]; + const list = [1, 2, 3, 4]; const str = createListStream(list); str.resume(); await new Promise(resolve => str.on('end', resolve)); - expect(list).to.eql([1,2,3,4]); + expect(list).to.eql([1, 2, 3, 4]); }); }); diff --git a/src/utils/streams/__tests__/promise_from_streams.js b/src/utils/streams/__tests__/promise_from_streams.js index 6528fe1d3909..a0adda1b9d37 100644 --- a/src/utils/streams/__tests__/promise_from_streams.js +++ b/src/utils/streams/__tests__/promise_from_streams.js @@ -10,7 +10,7 @@ import { describe('promiseFromStreams', () => { it('pipes together an array of streams', async () => { - const str1 = createListStream([1,2,3]); + const str1 = createListStream([1, 2, 3]); const str2 = createReduceStream((acc, n) => acc + n, 0); const sumPromise = new Promise(resolve => str2.once('data', resolve)); createPromiseFromStreams([str1, str2]); diff --git a/src/utils/streams/__tests__/reduce_stream.js b/src/utils/streams/__tests__/reduce_stream.js index 25556b716191..1b237e84f40a 100644 --- a/src/utils/streams/__tests__/reduce_stream.js +++ b/src/utils/streams/__tests__/reduce_stream.js @@ -14,7 +14,7 @@ describe('reduceStream', () => { it('calls the reducer for each item provided', async () => { const stub = sinon.stub(); await createPromiseFromStreams([ - createListStream([1,2,3]), + createListStream([1, 2, 3]), createReduceStream(stub.returnsArg(1), 0) ]); sinon.assert.calledThrice(stub); diff --git a/src/utils/strings/__tests__/prose.js b/src/utils/strings/__tests__/prose.js index d1a487b0d266..25db3e24d0d4 100644 --- a/src/utils/strings/__tests__/prose.js +++ b/src/utils/strings/__tests__/prose.js @@ -22,25 +22,25 @@ describe('utils formatListAsProse()', () => { describe('defaults', () => { it('joins items together with "and" and commas', () => { - expect(formatListAsProse([1,2])).to.eql('1 and 2'); - expect(formatListAsProse([1,2,3])).to.eql('1, 2, and 3'); - expect(formatListAsProse([4,3,2,1])).to.eql('4, 3, 2, and 1'); + expect(formatListAsProse([1, 2])).to.eql('1 and 2'); + expect(formatListAsProse([1, 2, 3])).to.eql('1, 2, and 3'); + expect(formatListAsProse([4, 3, 2, 1])).to.eql('4, 3, 2, and 1'); }); }); describe('inclusive=true', () => { it('joins items together with "and" and commas', () => { - expect(formatListAsProse([1,2], { inclusive: true })).to.eql('1 and 2'); - expect(formatListAsProse([1,2,3], { inclusive: true })).to.eql('1, 2, and 3'); - expect(formatListAsProse([4,3,2,1], { inclusive: true })).to.eql('4, 3, 2, and 1'); + expect(formatListAsProse([1, 2], { inclusive: true })).to.eql('1 and 2'); + expect(formatListAsProse([1, 2, 3], { inclusive: true })).to.eql('1, 2, and 3'); + expect(formatListAsProse([4, 3, 2, 1], { inclusive: true })).to.eql('4, 3, 2, and 1'); }); }); describe('inclusive=false', () => { it('joins items together with "or" and commas', () => { - expect(formatListAsProse([1,2], { inclusive: false })).to.eql('1 or 2'); - expect(formatListAsProse([1,2,3], { inclusive: false })).to.eql('1, 2, or 3'); - expect(formatListAsProse([4,3,2,1], { inclusive: false })).to.eql('4, 3, 2, or 1'); + expect(formatListAsProse([1, 2], { inclusive: false })).to.eql('1 or 2'); + expect(formatListAsProse([1, 2, 3], { inclusive: false })).to.eql('1, 2, or 3'); + expect(formatListAsProse([4, 3, 2, 1], { inclusive: false })).to.eql('4, 3, 2, or 1'); }); }); }); diff --git a/test/functional/apps/console/_console.js b/test/functional/apps/console/_console.js index 09b351ba6172..bd448b098194 100644 --- a/test/functional/apps/console/_console.js +++ b/test/functional/apps/console/_console.js @@ -35,7 +35,7 @@ export default function ({ getService, getPageObjects }) { }); }); - it('default request response should include `"timed_out": false`' , function () { + it('default request response should include `"timed_out": false`', function () { const expectedResponseContains = '"timed_out": false,'; return PageObjects.console.clickPlay() diff --git a/test/functional/apps/console/index.js b/test/functional/apps/console/index.js index ea79912691ed..b92e865cc05d 100644 --- a/test/functional/apps/console/index.js +++ b/test/functional/apps/console/index.js @@ -3,7 +3,7 @@ export default function ({ getService, loadTestFile }) { describe('console app', function () { before(async function () { - await remote.setWindowSize(1200,800); + await remote.setWindowSize(1200, 800); }); loadTestFile(require.resolve('./_console')); diff --git a/test/functional/apps/context/index.js b/test/functional/apps/context/index.js index 294a8a11fe6f..62064e9a827f 100644 --- a/test/functional/apps/context/index.js +++ b/test/functional/apps/context/index.js @@ -5,7 +5,7 @@ export default function ({ getService, getPageObjects, loadTestFile }) { describe('context app', function () { before(async function () { - await remote.setWindowSize(1200,800); + await remote.setWindowSize(1200, 800); await esArchiver.loadIfNeeded('logstash_functional'); await esArchiver.load('visualize'); await PageObjects.common.navigateToApp('discover'); diff --git a/test/functional/apps/discover/_collapse_expand.js b/test/functional/apps/discover/_collapse_expand.js index c754d56b2ecb..6774e3f5c5e7 100644 --- a/test/functional/apps/discover/_collapse_expand.js +++ b/test/functional/apps/discover/_collapse_expand.js @@ -13,8 +13,8 @@ export default function ({ getService, getPageObjects }) { // delete .kibana index and update configDoc return kibanaServer.uiSettings.replace({ - 'dateFormat:tz':'UTC', - 'defaultIndex':'logstash-*' + 'dateFormat:tz': 'UTC', + 'defaultIndex': 'logstash-*' }) .then(function loadkibanaIndexPattern() { log.debug('load kibana index with default index pattern'); diff --git a/test/functional/apps/discover/_shared_links.js b/test/functional/apps/discover/_shared_links.js index 8fee36c8d4fc..db6c6d443cb3 100644 --- a/test/functional/apps/discover/_shared_links.js +++ b/test/functional/apps/discover/_shared_links.js @@ -20,7 +20,7 @@ export default function ({ getService, getPageObjects }) { log.debug('baseUrl = ' + baseUrl); // browsers don't show the ':port' if it's 80 or 443 so we have to // remove that part so we can get a match in the tests. - baseUrl = baseUrl.replace(':80','').replace(':443',''); + baseUrl = baseUrl.replace(':80', '').replace(':443', ''); log.debug('New baseUrl = ' + baseUrl); const fromTime = '2015-09-19 06:31:44.000'; @@ -78,8 +78,8 @@ export default function ({ getService, getPageObjects }) { return PageObjects.discover.getSharedUrl() .then(function (actualUrl) { // strip the timestamp out of each URL - expect(actualUrl.replace(/_t=\d{13}/,'_t=TIMESTAMP')) - .to.be(expectedUrl.replace(/_t=\d{13}/,'_t=TIMESTAMP')); + expect(actualUrl.replace(/_t=\d{13}/, '_t=TIMESTAMP')) + .to.be(expectedUrl.replace(/_t=\d{13}/, '_t=TIMESTAMP')); }); }); diff --git a/test/functional/apps/discover/_source_filters.js b/test/functional/apps/discover/_source_filters.js index 99a0b413266e..10f8e38fb4ed 100644 --- a/test/functional/apps/discover/_source_filters.js +++ b/test/functional/apps/discover/_source_filters.js @@ -14,7 +14,7 @@ export default function ({ getService, getPageObjects }) { // delete .kibana index and update configDoc return kibanaServer.uiSettings.replace({ 'dateFormat:tz': 'UTC', - 'defaultIndex':'logstash-*' + 'defaultIndex': 'logstash-*' }) .then(function loadkibanaIndexPattern() { log.debug('load kibana index with default index pattern'); diff --git a/test/functional/apps/discover/index.js b/test/functional/apps/discover/index.js index 5ff2c2f095fd..f55752f8505c 100644 --- a/test/functional/apps/discover/index.js +++ b/test/functional/apps/discover/index.js @@ -4,7 +4,7 @@ export default function ({ getService, loadTestFile }) { describe('discover app', function () { before(function () { - return remote.setWindowSize(1200,800); + return remote.setWindowSize(1200, 800); }); after(function unloadMakelogs() { diff --git a/test/functional/apps/management/_scripted_fields.js b/test/functional/apps/management/_scripted_fields.js index 99fb3dbf1349..3e3909ccb0a2 100644 --- a/test/functional/apps/management/_scripted_fields.js +++ b/test/functional/apps/management/_scripted_fields.js @@ -23,13 +23,13 @@ export default function ({ getService, getPageObjects }) { describe('scripted fields', () => { before(async function () { - await remote.setWindowSize(1200,800); + await remote.setWindowSize(1200, 800); // delete .kibana index and then wait for Kibana to re-create it - await kibanaServer.uiSettings.replace({ 'dateFormat:tz':'UTC' }); + await kibanaServer.uiSettings.replace({ 'dateFormat:tz': 'UTC' }); await PageObjects.settings.navigateTo(); await PageObjects.settings.clickKibanaIndices(); await PageObjects.settings.createIndexPattern(); - await kibanaServer.uiSettings.update({ 'dateFormat:tz':'UTC' }); + await kibanaServer.uiSettings.update({ 'dateFormat:tz': 'UTC' }); }); after(async function afterAll() { diff --git a/test/functional/apps/management/_scripted_fields_filter.js b/test/functional/apps/management/_scripted_fields_filter.js index eb6343097e72..bed264cd6e87 100644 --- a/test/functional/apps/management/_scripted_fields_filter.js +++ b/test/functional/apps/management/_scripted_fields_filter.js @@ -10,13 +10,13 @@ export default function ({ getService, getPageObjects }) { describe('filter scripted fields', function describeIndexTests() { beforeEach(async function () { - await remote.setWindowSize(1200,800); + await remote.setWindowSize(1200, 800); // delete .kibana index and then wait for Kibana to re-create it - await kibanaServer.uiSettings.replace({ 'dateFormat:tz':'UTC' }); + await kibanaServer.uiSettings.replace({ 'dateFormat:tz': 'UTC' }); await PageObjects.settings.navigateTo(); await PageObjects.settings.clickKibanaIndices(); await PageObjects.settings.createIndexPattern(); - await kibanaServer.uiSettings.update({ 'dateFormat:tz':'UTC' }); + await kibanaServer.uiSettings.update({ 'dateFormat:tz': 'UTC' }); }); const scriptedExpressionFieldName = 'ram_expr1'; diff --git a/test/functional/apps/visualize/_area_chart.js b/test/functional/apps/visualize/_area_chart.js index 6eb9854ada12..e36f45034576 100644 --- a/test/functional/apps/visualize/_area_chart.js +++ b/test/functional/apps/visualize/_area_chart.js @@ -108,7 +108,7 @@ export default function ({ getService, getPageObjects }) { const xAxisLabels = [ '2015-09-20 00:00', '2015-09-21 00:00', '2015-09-22 00:00', '2015-09-23 00:00' ]; - const yAxisLabels = ['0','200','400','600','800','1,000','1,200','1,400','1,600']; + const yAxisLabels = ['0', '200', '400', '600', '800', '1,000', '1,200', '1,400', '1,600']; const expectedAreaChartData = [37, 202, 740, 1437, 1371, 751, 188, 31, 42, 202, 683, 1361, 1415, 707, 177, 27, 32, 175, 707, 1408, 1355, 726, 201, 29 ]; diff --git a/test/functional/page_objects/common_page.js b/test/functional/page_objects/common_page.js index 86313582bde6..edf2b6cb1606 100644 --- a/test/functional/page_objects/common_page.js +++ b/test/functional/page_objects/common_page.js @@ -57,8 +57,8 @@ export function CommonPageProvider({ getService, getPageObjects }) { log.debug(' >>>>>>>> WARNING Navigating to [' + appName + '] with defaultIndex=' + defaultIndex); log.debug(' >>>>>>>> Setting defaultIndex to "logstash-*""'); return kibanaServer.uiSettings.update({ - 'dateFormat:tz':'UTC', - 'defaultIndex':'logstash-*' + 'dateFormat:tz': 'UTC', + 'defaultIndex': 'logstash-*' }); } } @@ -107,7 +107,7 @@ export function CommonPageProvider({ getService, getPageObjects }) { // Browsers don't show the ':port' if it's 80 or 443 so we have to // remove that part so we can get a match in the tests. - const navSuccessful = new RegExp(appUrl.replace(':80','').replace(':443','') + const navSuccessful = new RegExp(appUrl.replace(':80', '').replace(':443', '') + '.{0,' + maxAdditionalLengthOnNavUrl + '}$') .test(currentUrl); diff --git a/test/functional/page_objects/dashboard_page.js b/test/functional/page_objects/dashboard_page.js index e1c9d7057efb..e613e24511c5 100644 --- a/test/functional/page_objects/dashboard_page.js +++ b/test/functional/page_objects/dashboard_page.js @@ -20,8 +20,8 @@ export function DashboardPageProvider({ getService, getPageObjects }) { async initTests() { const logstash = esArchiver.loadIfNeeded('logstash_functional'); await kibanaServer.uiSettings.replace({ - 'dateFormat:tz':'UTC', - 'defaultIndex':'logstash-*' + 'dateFormat:tz': 'UTC', + 'defaultIndex': 'logstash-*' }); log.debug('load kibana index with visualizations'); @@ -349,7 +349,7 @@ export function DashboardPageProvider({ getService, getPageObjects }) { await searchFilter.clearValue(); await searchFilter.click(); // Note: this replacement of - to space is to preserve original logic but I'm not sure why or if it's needed. - await searchFilter.type(dashName.replace('-',' ')); + await searchFilter.type(dashName.replace('-', ' ')); }); await PageObjects.header.waitUntilLoadingHasFinished(); diff --git a/test/functional/page_objects/visualize_page.js b/test/functional/page_objects/visualize_page.js index 2126b68106e8..ffd715e7c74b 100644 --- a/test/functional/page_objects/visualize_page.js +++ b/test/functional/page_objects/visualize_page.js @@ -402,7 +402,7 @@ export function VisualizePageProvider({ getService, getPageObjects }) { // can't uses dashes in saved visualizations when filtering // or extended character sets // https://github.com/elastic/kibana/issues/6300 - await input.type(vizName.replace('-',' ')); + await input.type(vizName.replace('-', ' ')); } async clickVisualizationByName(vizName) { @@ -469,7 +469,7 @@ export function VisualizePageProvider({ getService, getPageObjects }) { // by a bunch of 'L'ines from that point to the next. Those points are // the values we're going to use to calculate the data values we're testing. // So git rid of the one 'M' and split the rest on the 'L's. - const tempArray = data.replace('M','').split('L'); + const tempArray = data.replace('M', '').split('L'); const chartSections = tempArray.length / 2; log.debug('chartSections = ' + chartSections + ' height = ' + yAxisHeight + ' yAxisLabel = ' + yAxisLabel); const chartData = []; diff --git a/ui_framework/doc_site/src/views/tabs/tabs.js b/ui_framework/doc_site/src/views/tabs/tabs.js index 75c2bf5cf621..6c949525f295 100644 --- a/ui_framework/doc_site/src/views/tabs/tabs.js +++ b/ui_framework/doc_site/src/views/tabs/tabs.js @@ -35,7 +35,7 @@ class KuiTabsExample extends React.Component { }; renderTabs() { - return this.tabs.map((tab,index) => ( + return this.tabs.map((tab, index) => ( this.onSelectedTabChanged(tab.id)} isSelected={tab.id === this.state.selectedTabId} diff --git a/ui_framework/src/components/collapse_button/collapse_button.test.js b/ui_framework/src/components/collapse_button/collapse_button.test.js index e7e2b9e45e41..d7a20a6af8e7 100644 --- a/ui_framework/src/components/collapse_button/collapse_button.test.js +++ b/ui_framework/src/components/collapse_button/collapse_button.test.js @@ -1,5 +1,5 @@ import React from 'react'; -import { render,shallow } from 'enzyme'; +import { render, shallow } from 'enzyme'; import { requiredProps } from '../../test/required_props'; import sinon from 'sinon'; diff --git a/ui_framework/src/components/gallery/gallery_item/gallery_item_icon.js b/ui_framework/src/components/gallery/gallery_item/gallery_item_icon.js index 5b5c70a2fa7a..a420ceabe34b 100644 --- a/ui_framework/src/components/gallery/gallery_item/gallery_item_icon.js +++ b/ui_framework/src/components/gallery/gallery_item/gallery_item_icon.js @@ -3,7 +3,7 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; export const KuiGalleryItemIcon = ({ children, className, ...rest }) => { - const classes = classNames('kuiGalleryItem__icon','kuiIcon', className); + const classes = classNames('kuiGalleryItem__icon', 'kuiIcon', className); return (