Skip to content

Commit

Permalink
chore: remove eslint-disable*
Browse files Browse the repository at this point in the history
  • Loading branch information
ankush committed Jul 14, 2023
1 parent 58cf770 commit b5409f6
Show file tree
Hide file tree
Showing 41 changed files with 34 additions and 84 deletions.
1 change: 0 additions & 1 deletion esbuild/build-cleanup.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-console */
const path = require("path");
const fs = require("fs");
const glob = require("fast-glob");
Expand Down
1 change: 0 additions & 1 deletion esbuild/esbuild.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable no-console */
const path = require("path");
const fs = require("fs");
const glob = require("fast-glob");
Expand Down
6 changes: 3 additions & 3 deletions esbuild/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ function get_cli_arg(name) {

function log_error(message, badge = "ERROR") {
badge = chalk.white.bgRed(` ${badge} `);
console.error(`${badge} ${message}`); // eslint-disable-line no-console
console.error(`${badge} ${message}`);
}

function log_warn(message, badge = "WARN") {
badge = chalk.black.bgYellowBright(` ${badge} `);
console.warn(`${badge} ${message}`); // eslint-disable-line no-console
console.warn(`${badge} ${message}`);
}

function log(...args) {
console.log(...args); // eslint-disable-line no-console
console.log(...args);
}

function get_redis_subscriber(kind) {
Expand Down
1 change: 0 additions & 1 deletion frappe/core/doctype/report/boilerplate/controller.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) {year}, {app_publisher} and contributors
// For license information, please see license.txt
/* eslint-disable */

frappe.query_reports["{name}"] = {{
"filters": [
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) 2022, Frappe Technologies and contributors
// For license information, please see license.txt
/* eslint-disable */

frappe.query_reports["Database Storage Usage By Tables"] = {
filters: [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) 2019, Frappe Technologies and contributors
// For license information, please see license.txt
/* eslint-disable */

frappe.query_reports["Transaction Log Report"] = {
onload: function (query_report) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) 2023, Frappe Technologies and contributors
// For license information, please see license.txt
/* eslint-disable */

frappe.query_reports["Audit System Hooks"] = {
filters: [],
Expand Down
1 change: 0 additions & 1 deletion frappe/desk/page/user_profile/user_profile_controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ class UserProfile {
});
}

// eslint-disable-next-line no-unused-vars
render_percentage_chart(field, title) {
frappe
.xcall(
Expand Down
1 change: 0 additions & 1 deletion frappe/desk/report/todo/todo.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) 2016, Frappe Technologies and contributors
// For license information, please see license.txt
/* eslint-disable */

frappe.query_reports["ToDo"] = {
filters: [],
Expand Down
3 changes: 0 additions & 3 deletions frappe/public/js/frappe/color_picker/color_picker.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ class Picker {
}

setup_hue_event() {
// eslint-disable-next-line no-unused-vars
let on_drag = (x, y) => {
this.hue_selector_position.x = x;
this.hue = Math.round((x * 360) / this.hue_map.offsetWidth);
Expand Down Expand Up @@ -152,9 +151,7 @@ class Picker {
}

get_pointer_coords() {
// eslint-disable-next-line no-unused-vars
let h, s, v;
// eslint-disable-next-line no-unused-vars
[h, s, v] = utils.get_hsv(this.get_color());
let width = this.color_map.offsetWidth;
let height = this.color_map.offsetHeight;
Expand Down
16 changes: 6 additions & 10 deletions frappe/public/js/frappe/form/controls/base_control.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,25 +62,22 @@ frappe.ui.form.Control = class BaseControl {

// like in case of a dialog box
if (cint(this.df.hidden)) {
// eslint-disable-next-line
if (explain) console.log("By Hidden: None"); // eslint-disable-line no-console
if (explain) console.log("By Hidden: None");
return "None";
} else if (cint(this.df.hidden_due_to_dependency)) {
// eslint-disable-next-line
if (explain) console.log("By Hidden Dependency: None"); // eslint-disable-line no-console
if (explain) console.log("By Hidden Dependency: None");
return "None";
} else if (
cint(this.df.read_only || this.df.is_virtual || this.df.fieldtype === "Read Only")
) {
// eslint-disable-next-line
if (explain) console.log("By Read Only: Read"); // eslint-disable-line no-console
if (explain) console.log("By Read Only: Read");
status = "Read";
} else if (
(this.grid && this.grid.display_status == "Read") ||
(this.layout && this.layout.grid && this.layout.grid.display_status == "Read")
) {
// parent grid is read
if (explain) console.log("By Parent Grid Read-only: Read"); // eslint-disable-line no-console
if (explain) console.log("By Parent Grid Read-only: Read");
status = "Read";
}

Expand Down Expand Up @@ -112,7 +109,7 @@ frappe.ui.form.Control = class BaseControl {
var grid = this.grid || this.layout.grid;
if (grid.display_status == "Read") {
status = "Read";
if (explain) console.log("By Parent Grid Read-only: Read"); // eslint-disable-line no-console
if (explain) console.log("By Parent Grid Read-only: Read");
}
}

Expand All @@ -132,8 +129,7 @@ frappe.ui.form.Control = class BaseControl {
is_null(value) &&
!in_list(["HTML", "Image", "Button", "Geolocation"], this.df.fieldtype)
) {
// eslint-disable-next-line
if (explain) console.log("By Hide Read-only, null fields: None"); // eslint-disable-line no-console
if (explain) console.log("By Hide Read-only, null fields: None");
status = "None";
}

Expand Down
1 change: 0 additions & 1 deletion frappe/public/js/frappe/form/controls/code.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ frappe.ui.form.ControlCode = class ControlCode extends frappe.ui.form.ControlTex

const valid_languages = Object.keys(language_map);
if (language && !valid_languages.includes(language)) {
// eslint-disable-next-line
console.warn(
`Invalid language option provided for field "${
this.df.label
Expand Down
1 change: 0 additions & 1 deletion frappe/public/js/frappe/form/controls/control.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ frappe.ui.form.make_control = function (opts) {
if (frappe.ui.form[control_class_name]) {
return new frappe.ui.form[control_class_name](opts);
} else {
// eslint-disable-next-line
console.log("Invalid Control Name: " + opts.df.fieldtype);
}
};
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable */
import Quill from "quill";

const Embed = Quill.import("blots/embed");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable */
const Keys = {
TAB: "Tab",
ENTER: "Enter",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/* eslint-disable */
import Quill from "quill";
import Keys from "./constants/keys";
import "./blots/mention";
Expand Down
2 changes: 1 addition & 1 deletion frappe/public/js/frappe/form/form.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ frappe.ui.form.Form = class FrappeForm {
me.show_success_action();
})
.catch((e) => {
console.error(e); // eslint-disable-line
console.error(e);
});
}

Expand Down
2 changes: 1 addition & 1 deletion frappe/public/js/frappe/form/grid_row.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default class GridRow {
])
.catch((e) => {
// aborted
console.trace(e); // eslint-disable-line
console.trace(e);
});
} else {
let data = null;
Expand Down
1 change: 0 additions & 1 deletion frappe/public/js/frappe/form/layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ frappe.ui.form.Layout = class Layout {
}

make_page(df) {
// eslint-disable-line no-unused-vars
let me = this;
let head = $(`
<div class="form-clickable-section text-center">
Expand Down
1 change: 0 additions & 1 deletion frappe/public/js/frappe/form/multi_select_dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,6 @@ frappe.ui.form.MultiSelectDialog = class MultiSelectDialog {
async get_filtered_parents_for_child_search() {
const parent_search_args = this.get_args_for_search();
parent_search_args.filter_fields = ["name"];
// eslint-disable-next-line no-unused-vars
const [response, _] = await this.perform_search(parent_search_args);

let parent_names = [];
Expand Down
1 change: 0 additions & 1 deletion frappe/public/js/frappe/form/script_helpers.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
// MIT License. See license.txt
/* eslint-disable no-console */

window.refresh_many = function (flist, dn, table_field) {
for (var i in flist) {
Expand Down
1 change: 0 additions & 1 deletion frappe/public/js/frappe/list/base_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -668,7 +668,6 @@ class FilterArea {
const fields_dict = this.list_view.page.fields_dict;

let out = filters.reduce((out, filter) => {
// eslint-disable-next-line
const [dt, fieldname, condition, value] = filter;
out.promise = out.promise || Promise.resolve();
out.non_standard_filters = out.non_standard_filters || [];
Expand Down
1 change: 0 additions & 1 deletion frappe/public/js/frappe/model/meta.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,6 @@ $.extend(frappe.meta, {
});

if (!out) {
// eslint-disable-next-line
console.log(
__("Warning: Unable to find {0} in any table related to {1}", [
key,
Expand Down
9 changes: 4 additions & 5 deletions frappe/public/js/frappe/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,8 @@ frappe.request.call = function (opts) {
status_code_handler(data, xhr);
}
} catch (e) {
console.log("Unable to handle success response", data); // eslint-disable-line
console.error(e); // eslint-disable-line
console.log("Unable to handle success response", data);
console.error(e);
}
})
.always(function (data, textStatus, xhr) {
Expand Down Expand Up @@ -348,8 +348,8 @@ frappe.request.call = function (opts) {
// if not handled by error handler!
opts.error_callback && opts.error_callback(xhr);
} catch (e) {
console.log("Unable to handle failed response"); // eslint-disable-line
console.error(e); // eslint-disable-line
console.log("Unable to handle failed response");
console.error(e);
}
});
};
Expand All @@ -366,7 +366,6 @@ frappe.request.is_fresh = function (args, threshold) {
new Date() - past_request.timestamp < threshold &&
frappe.utils.deep_equal(args, past_request.args)
) {
// eslint-disable-next-line no-console
console.log("throttled");
return true;
}
Expand Down
5 changes: 2 additions & 3 deletions frappe/public/js/frappe/scanner/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ frappe.ui.Scanner = class Scanner {
try {
this.options.on_scan(decodedResult);
} catch (error) {
console.error(error); // eslint-disable-line
console.error(error);
}
}
if (!this.options.multiple) {
Expand All @@ -46,14 +46,13 @@ frappe.ui.Scanner = class Scanner {
}
},
(errorMessage) => {
// eslint-disable-line
// parse error, ignore it.
}
)
.catch((err) => {
this.is_alive = false;
this.hide_dialog();
console.error(err); // eslint-disable-line
console.error(err);
});
this.is_alive = true;
}
Expand Down
2 changes: 0 additions & 2 deletions frappe/public/js/frappe/ui/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ frappe.ui.color = {
if (color_names.includes(color_name)) {
return frappe.ui.color_map[color_name];
} else {
// eslint-disable-next-line
console.warn(`'color_name' can be one of ${color_names} and not ${color_name}`);
}
},
Expand Down Expand Up @@ -52,7 +51,6 @@ frappe.ui.color = {
const color = this.get_color(color_name);
return color ? color[shades[shade]] : color_name;
} else {
// eslint-disable-next-line
console.warn(`'shade' can be one of ${Object.keys(shades)} and not ${shade}`);
}
},
Expand Down
2 changes: 0 additions & 2 deletions frappe/public/js/frappe/ui/filters/filter_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,6 @@ frappe.ui.FilterGroup = class {
}

get_filter_area_template() {
/* eslint-disable indent */
return $(`
<div class="filter-area">
<div class="filter-edit-area">
Expand All @@ -330,7 +329,6 @@ frappe.ui.FilterGroup = class {
</div>
</div>
</div>`);
/* eslint-disable indent */
}

get_filters_as_object() {
Expand Down
1 change: 0 additions & 1 deletion frappe/public/js/frappe/ui/slides.js
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,6 @@ frappe.ui.Slides = class Slides {
this.slide_dict[id] = null;
}

// eslint-disable-next-line no-unused-vars
on_update(completed, total) {}

show_hide_prev_next(id) {
Expand Down
3 changes: 0 additions & 3 deletions frappe/public/js/frappe/ui/toolbar/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ frappe.search.SearchDialog = class {
callback(results, keywords);
},
(err) => {
// eslint-disable-next-line no-console
console.error(err);
}
);
Expand All @@ -78,7 +77,6 @@ frappe.search.SearchDialog = class {
callback(results, keywords);
},
(err) => {
// eslint-disable-next-line no-console
console.error(err);
}
);
Expand Down Expand Up @@ -177,7 +175,6 @@ frappe.search.SearchDialog = class {
doctype_results.length && this.add_more_results(doctype_results);
},
(err) => {
// eslint-disable-next-line no-console
console.error(err);
}
);
Expand Down
1 change: 0 additions & 1 deletion frappe/public/js/frappe/ui/toolbar/search_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ frappe.search.utils = {
out.label = match[0].bold();
out.value = match[0];
} else {
// eslint-disable-next-line
console.log("Illegal match", match);
}
out.index = 80;
Expand Down
13 changes: 3 additions & 10 deletions frappe/public/js/frappe/ui/tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ frappe.ui.Tree = class {
icon_set,
toolbar,
expandable,
with_skeleton = 1, // eslint-disable-line
with_skeleton = 1,

args,
method,
get_label,
on_render,
on_click, // eslint-disable-line
on_click,
}) {
$.extend(this, arguments[0]);
if (root_value == null) {
Expand Down Expand Up @@ -79,14 +79,7 @@ frappe.ui.Tree = class {
setup_treenode_class() {
let tree = this;
this.TreeNode = class {
constructor({
parent,
label,
parent_label,
expandable,
is_root,
data, // eslint-disable-line
}) {
constructor({ parent, label, parent_label, expandable, is_root, data }) {
$.extend(this, arguments[0]);
this.loaded = 0;
this.expanded = 0;
Expand Down
Loading

0 comments on commit b5409f6

Please sign in to comment.