From a4bc19a2a148c97d68aa52d385a5915594ac7e8e Mon Sep 17 00:00:00 2001 From: Faris Ansari Date: Sat, 2 Feb 2019 21:21:21 +0530 Subject: [PATCH] style: ESLint --- .eslintrc | 4 ---- frappe/website/js/bootstrap-4.js | 27 +++++++++++++-------------- generate_bootstrap_theme.js | 10 +++++----- 3 files changed, 18 insertions(+), 23 deletions(-) diff --git a/.eslintrc b/.eslintrc index 46a4f4be8d..86abea34ce 100644 --- a/.eslintrc +++ b/.eslintrc @@ -19,10 +19,6 @@ "error", "1tbs" ], - "space-before-function-paren": [ - "error", - "never" - ], "space-unary-ops": [ "error", { "words": true } diff --git a/frappe/website/js/bootstrap-4.js b/frappe/website/js/bootstrap-4.js index d2addb89f3..b5e2d5bc39 100644 --- a/frappe/website/js/bootstrap-4.js +++ b/frappe/website/js/bootstrap-4.js @@ -2,21 +2,20 @@ import 'bootstrap/dist/js/bootstrap.bundle'; // multilevel dropdown $('.dropdown-menu a.dropdown-toggle').on('click', function (e) { - e.preventDefault(); - e.stopImmediatePropagation(); - if (!$(this).next().hasClass('show')) { - $(this).parents('.dropdown-menu').first().find('.show').removeClass("show"); - } - var $subMenu = $(this).next(".dropdown-menu"); - $subMenu.toggleClass('show'); + e.preventDefault(); + e.stopImmediatePropagation(); + if (!$(this).next().hasClass('show')) { + $(this).parents('.dropdown-menu').first().find('.show').removeClass("show"); + } + var $subMenu = $(this).next(".dropdown-menu"); + $subMenu.toggleClass('show'); - $(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function (e) { - $('.dropdown-submenu .show').removeClass("show"); - }); + $(this).parents('li.nav-item.dropdown.show').on('hidden.bs.dropdown', function () { + $('.dropdown-submenu .show').removeClass("show"); + }); - - return false; + return false; }); frappe.get_modal = function(title, content) { @@ -44,7 +43,7 @@ frappe.get_modal = function(title, content) { frappe.ui.Dialog = class Dialog extends frappe.ui.Dialog { get_primary_btn() { - return this.$wrapper.find(".modal-footer .btn-primary") + return this.$wrapper.find(".modal-footer .btn-primary"); } set_primary_action(label, click) { @@ -59,4 +58,4 @@ frappe.ui.Dialog = class Dialog extends frappe.ui.Dialog { this.$wrapper.find('.section-body').addClass('w-100'); } } -} +}; diff --git a/generate_bootstrap_theme.js b/generate_bootstrap_theme.js index af192b2990..e08d55346d 100644 --- a/generate_bootstrap_theme.js +++ b/generate_bootstrap_theme.js @@ -17,27 +17,27 @@ sass.render({ node_modules_path, scss_path ], - importer: function(url, prev, done) { + importer: function(url) { if (url.startsWith('~')) { // strip ~ so that it can resolve from node_modules return { file: url.slice(1) - } + }; } // normal file, let it go return { file: url - } + }; } }, function(err, result) { if (err) { - console.error(err.formatted) + console.error(err.formatted); // eslint-disable-line return; } fs.writeFile(path.resolve(website_theme_path, custom_theme_name), result.css, function(err) { if (!err) { - console.log(custom_theme_name) + console.log(custom_theme_name); // eslint-disable-line } }); }); \ No newline at end of file