From bcdff915dce98d044a4e2f831f8e8322d0e898fe Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Wed, 2 Aug 2017 17:19:38 +0900 Subject: [PATCH] Make eslint happy. --- .../javascripts/discourse/components/explorer-schema.js.es6 | 4 ++-- assets/javascripts/discourse/components/param-field.js.es6 | 3 ++- assets/javascripts/discourse/components/param-input.js.es6 | 4 ---- assets/javascripts/discourse/components/query-result.js.es6 | 2 +- .../discourse/initializers/initialize-data-explorer.js.es6 | 2 +- assets/javascripts/discourse/models/query.js.es6 | 1 - 6 files changed, 6 insertions(+), 10 deletions(-) diff --git a/assets/javascripts/discourse/components/explorer-schema.js.es6 b/assets/javascripts/discourse/components/explorer-schema.js.es6 index c4e7f58..53c1ce9 100644 --- a/assets/javascripts/discourse/components/explorer-schema.js.es6 +++ b/assets/javascripts/discourse/components/explorer-schema.js.es6 @@ -78,7 +78,7 @@ export default Ember.Component.extend({ } // Check the table name vs the filter - if (filter.source == key || filter.source + "s" == key) { + if (filter.source === key || filter.source + "s" === key) { tables.unshift({ name: key, columns: schema[key], @@ -95,7 +95,7 @@ export default Ember.Component.extend({ // filter the columns let filterCols = []; schema[key].forEach(function(col) { - if (filter.source == col.column_name) { + if (filter.source === col.column_name) { filterCols.unshift(col); } else if (filter.test(col.column_name)) { filterCols.push(col); diff --git a/assets/javascripts/discourse/components/param-field.js.es6 b/assets/javascripts/discourse/components/param-field.js.es6 index 17dfb37..f75b49d 100644 --- a/assets/javascripts/discourse/components/param-field.js.es6 +++ b/assets/javascripts/discourse/components/param-field.js.es6 @@ -1,8 +1,9 @@ export default Ember.TextField.extend({ - value: function(key, value, previousValue) { + value: function(key, value) { if (arguments.length > 1) { this.get('params')[this.get('pname')] = value; } + return this.get('params')[this.get('pname')]; }.property('params', 'pname') }); diff --git a/assets/javascripts/discourse/components/param-input.js.es6 b/assets/javascripts/discourse/components/param-input.js.es6 index 0601419..2e693b2 100644 --- a/assets/javascripts/discourse/components/param-input.js.es6 +++ b/assets/javascripts/discourse/components/param-input.js.es6 @@ -67,10 +67,6 @@ export default Ember.Component.extend({ return this.get('info.nullable'); } - function matches(regex) { - return regex.test(value); - } - const intVal = parseInt(value, 10); const intValid = !isNaN(intVal) && intVal < 2147483648 && intVal > -2147483649; const isPositiveInt = /^\d+$/.test(value); diff --git a/assets/javascripts/discourse/components/query-result.js.es6 b/assets/javascripts/discourse/components/query-result.js.es6 index 5df2d8a..772adbb 100644 --- a/assets/javascripts/discourse/components/query-result.js.es6 +++ b/assets/javascripts/discourse/components/query-result.js.es6 @@ -162,7 +162,7 @@ const QueryResultComponent = Ember.Component.extend({ form.submit(); Em.run.next('afterRender', function() { document.body.removeChild(form); - }) + }); }); }, diff --git a/assets/javascripts/discourse/initializers/initialize-data-explorer.js.es6 b/assets/javascripts/discourse/initializers/initialize-data-explorer.js.es6 index 5f37e8e..19e0b1b 100644 --- a/assets/javascripts/discourse/initializers/initialize-data-explorer.js.es6 +++ b/assets/javascripts/discourse/initializers/initialize-data-explorer.js.es6 @@ -5,7 +5,7 @@ export default { container.lookup('store:main').addPluralization('query', 'queries'); if (!String.prototype.endsWith) { - String.prototype.endsWith = function(searchString, position) { + String.prototype.endsWith = function(searchString, position) { // eslint-disable-line no-extend-native var subjectString = this.toString(); if (position === undefined || position > subjectString.length) { position = subjectString.length; diff --git a/assets/javascripts/discourse/models/query.js.es6 b/assets/javascripts/discourse/models/query.js.es6 index 51ee4ad..400b6c4 100644 --- a/assets/javascripts/discourse/models/query.js.es6 +++ b/assets/javascripts/discourse/models/query.js.es6 @@ -35,7 +35,6 @@ const Query = RestModel.extend({ if (oldParams[pinfo.identifier]) { newParams[name] = oldParams[name]; } else if (pinfo['default'] !== null) { - if (pinfo['default'] === false) { debugger; } newParams[name] = pinfo['default']; } else if (pinfo['type'] === 'boolean') { newParams[name] = 'false';