Added recommended ESLinter checks. Fixes #4142

This commit is contained in:
Murtuza Zabuawala 2019-04-05 13:07:43 +05:30 committed by Akshay Joshi
parent 9bff6c7157
commit 84ecffa4d9
6 changed files with 13 additions and 4 deletions

View File

@ -16,3 +16,4 @@ Bug fixes
*********
| `Bug #4131 <https://redmine.postgresql.org/issues/4131>`_ - Relabel the Save button on the datagrid text editor to avoid confusion with the actual Save button that updates the database.
| `Bug #4142 <https://redmine.postgresql.org/issues/4142>`_ - Added recommended ESLinter checks.

View File

@ -14,6 +14,9 @@ module.exports = {
'amd': true,
'jasmine': true,
},
'extends': [
'eslint:recommended',
],
'parserOptions': {
'ecmaVersion': 2018,
'sourceType': 'module',
@ -43,5 +46,7 @@ module.exports = {
'always-multiline'
],
'no-console': ["error", { allow: ["warn", "error"] }],
// We need to exclude below for RegEx case
"no-useless-escape": 0,
},
};

View File

@ -240,7 +240,6 @@ define('pgadmin.node.column', [
return false;
},
editable: function(m) {
var name = m.get('name');
// If HeaderCell then allow True
if(m instanceof Backbone.Collection) {
return true;

View File

@ -1070,7 +1070,6 @@ define('pgadmin.browser', [
var loaded = this.t.wasLoad(parent),
onLoad = function() {
self.i = parent;
self.d = self.d;
self.pathOfTreeItems.push({coll: false, item: parent, d: self.d});
self.success();
return;

View File

@ -24,4 +24,4 @@ export function getHelpUrl(base_path, file, version) {
}
return url + file;
};
}

View File

@ -38,7 +38,12 @@ define([], function() {
var o, n, i, l, d, c = /^top|bottom/,
f = ['paddingTop', 'paddingBottom', 'borderTop', 'borderBottom'],
u = 4;
if (o = m ? m(t)[e] : (n = t.style['pixel' + e.charAt(0).toUpperCase() + e.slice(1)]) ? n + 'px' : 'fontSize' === e ? r(t, '1em', 'left', 1) + 'px' : t.currentStyle[e], i = (o.match(s) || [])[2], '%' === i && p)
n = t.style['pixel' + e.charAt(0).toUpperCase() + e.slice(1)];
o = m ? m(t)[e] : (n) ? n + 'px' : 'fontSize' === e ? r(t, '1em', 'left', 1) + 'px' : t.currentStyle[e];
i = (o.match(s) || [])[2];
if ('%' === i && p)
if (c.test(e)) {
for (l = (d = t.parentNode || t).offsetHeight; u--;) l -= parseFloat(a(d, f[u]));
o = parseFloat(o) / 100 * l + 'px';