Make eslint happy.

This commit is contained in:
Guo Xiang Tan 2017-08-02 17:19:38 +09:00
parent 1ec43ffce7
commit bcdff915dc
6 changed files with 6 additions and 10 deletions

View File

@ -78,7 +78,7 @@ export default Ember.Component.extend({
} }
// Check the table name vs the filter // 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({ tables.unshift({
name: key, name: key,
columns: schema[key], columns: schema[key],
@ -95,7 +95,7 @@ export default Ember.Component.extend({
// filter the columns // filter the columns
let filterCols = []; let filterCols = [];
schema[key].forEach(function(col) { schema[key].forEach(function(col) {
if (filter.source == col.column_name) { if (filter.source === col.column_name) {
filterCols.unshift(col); filterCols.unshift(col);
} else if (filter.test(col.column_name)) { } else if (filter.test(col.column_name)) {
filterCols.push(col); filterCols.push(col);

View File

@ -1,8 +1,9 @@
export default Ember.TextField.extend({ export default Ember.TextField.extend({
value: function(key, value, previousValue) { value: function(key, value) {
if (arguments.length > 1) { if (arguments.length > 1) {
this.get('params')[this.get('pname')] = value; this.get('params')[this.get('pname')] = value;
} }
return this.get('params')[this.get('pname')]; return this.get('params')[this.get('pname')];
}.property('params', 'pname') }.property('params', 'pname')
}); });

View File

@ -67,10 +67,6 @@ export default Ember.Component.extend({
return this.get('info.nullable'); return this.get('info.nullable');
} }
function matches(regex) {
return regex.test(value);
}
const intVal = parseInt(value, 10); const intVal = parseInt(value, 10);
const intValid = !isNaN(intVal) && intVal < 2147483648 && intVal > -2147483649; const intValid = !isNaN(intVal) && intVal < 2147483648 && intVal > -2147483649;
const isPositiveInt = /^\d+$/.test(value); const isPositiveInt = /^\d+$/.test(value);

View File

@ -162,7 +162,7 @@ const QueryResultComponent = Ember.Component.extend({
form.submit(); form.submit();
Em.run.next('afterRender', function() { Em.run.next('afterRender', function() {
document.body.removeChild(form); document.body.removeChild(form);
}) });
}); });
}, },

View File

@ -5,7 +5,7 @@ export default {
container.lookup('store:main').addPluralization('query', 'queries'); container.lookup('store:main').addPluralization('query', 'queries');
if (!String.prototype.endsWith) { 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(); var subjectString = this.toString();
if (position === undefined || position > subjectString.length) { if (position === undefined || position > subjectString.length) {
position = subjectString.length; position = subjectString.length;

View File

@ -35,7 +35,6 @@ const Query = RestModel.extend({
if (oldParams[pinfo.identifier]) { if (oldParams[pinfo.identifier]) {
newParams[name] = oldParams[name]; newParams[name] = oldParams[name];
} else if (pinfo['default'] !== null) { } else if (pinfo['default'] !== null) {
if (pinfo['default'] === false) { debugger; }
newParams[name] = pinfo['default']; newParams[name] = pinfo['default'];
} else if (pinfo['type'] === 'boolean') { } else if (pinfo['type'] === 'boolean') {
newParams[name] = 'false'; newParams[name] = 'false';