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 #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, 'amd': true,
'jasmine': true, 'jasmine': true,
}, },
'extends': [
'eslint:recommended',
],
'parserOptions': { 'parserOptions': {
'ecmaVersion': 2018, 'ecmaVersion': 2018,
'sourceType': 'module', 'sourceType': 'module',
@@ -43,5 +46,7 @@ module.exports = {
'always-multiline' 'always-multiline'
], ],
'no-console': ["error", { allow: ["warn", "error"] }], '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; return false;
}, },
editable: function(m) { editable: function(m) {
var name = m.get('name');
// If HeaderCell then allow True // If HeaderCell then allow True
if(m instanceof Backbone.Collection) { if(m instanceof Backbone.Collection) {
return true; return true;

View File

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

View File

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

View File

@@ -38,7 +38,12 @@ define([], function() {
var o, n, i, l, d, c = /^top|bottom/, var o, n, i, l, d, c = /^top|bottom/,
f = ['paddingTop', 'paddingBottom', 'borderTop', 'borderBottom'], f = ['paddingTop', 'paddingBottom', 'borderTop', 'borderBottom'],
u = 4; 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)) { if (c.test(e)) {
for (l = (d = t.parentNode || t).offsetHeight; u--;) l -= parseFloat(a(d, f[u])); for (l = (d = t.parentNode || t).offsetHeight; u--;) l -= parseFloat(a(d, f[u]));
o = parseFloat(o) / 100 * l + 'px'; o = parseFloat(o) / 100 * l + 'px';