mirror of https://github.com/zulip/zulip.git
eslint: Remove and prohibit unused eslint-disable directives.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
b3aa44c914
commit
c7a6902fe3
|
@ -15,6 +15,7 @@
|
|||
"warnOnUnsupportedTypeScriptVersion": false,
|
||||
"sourceType": "unambiguous"
|
||||
},
|
||||
"reportUnusedDisableDirectives": true,
|
||||
"rules": {
|
||||
"array-callback-return": "error",
|
||||
"arrow-body-style": "error",
|
||||
|
|
|
@ -5,7 +5,6 @@ exports.initialize = function () {
|
|||
|
||||
const stripe_key = $("#payment-method").data("key");
|
||||
const card_change_handler = StripeCheckout.configure({
|
||||
// eslint-disable-line no-undef
|
||||
key: stripe_key,
|
||||
image: "/static/images/logo/zulip-icon-128x128.png",
|
||||
locale: "auto",
|
||||
|
|
|
@ -4,7 +4,6 @@ exports.initialize = () => {
|
|||
helpers.set_tab("upgrade");
|
||||
|
||||
const add_card_handler = StripeCheckout.configure({
|
||||
// eslint-disable-line no-undef
|
||||
key: $("#autopay-form").data("key"),
|
||||
image: "/static/images/logo/zulip-icon-128x128.png",
|
||||
locale: "auto",
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
const autosize = require("autosize");
|
||||
const confirmDatePlugin = require("flatpickr/dist/plugins/confirmDate/confirmDate");
|
||||
const ConfirmDatePlugin = require("flatpickr/dist/plugins/confirmDate/confirmDate");
|
||||
const moment = require("moment");
|
||||
|
||||
const pygments_data = require("../generated/pygments_data.json");
|
||||
|
@ -750,7 +750,7 @@ const show_flatpickr = (element, callback, default_timestamp) => {
|
|||
enableTime: true,
|
||||
clickOpens: false,
|
||||
defaultDate: default_timestamp,
|
||||
plugins: [new confirmDatePlugin({})], // eslint-disable-line new-cap, no-undef
|
||||
plugins: [new ConfirmDatePlugin({})],
|
||||
positionElement: element,
|
||||
dateFormat: "Z",
|
||||
formatDate: (date) => {
|
||||
|
|
|
@ -253,7 +253,6 @@ exports.create = function ($container, list, opts) {
|
|||
meta.sorting_function = sorting_function;
|
||||
} else if (typeof sorting_function === "string") {
|
||||
if (typeof prop === "string") {
|
||||
/* eslint-disable max-len */
|
||||
meta.sorting_function = meta.generic_sorting_functions[sorting_function](prop);
|
||||
} else {
|
||||
meta.sorting_function = meta.sorting_functions.get(sorting_function);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
const ClipboardJS = require("clipboard");
|
||||
const confirmDatePlugin = require("flatpickr/dist/plugins/confirmDate/confirmDate");
|
||||
const ConfirmDatePlugin = require("flatpickr/dist/plugins/confirmDate/confirmDate");
|
||||
const moment = require("moment");
|
||||
|
||||
const render_actions_popover_content = require("../templates/actions_popover_content.hbs");
|
||||
|
@ -587,7 +587,7 @@ exports.render_actions_remind_popover = function (element, id) {
|
|||
clickOpens: false,
|
||||
defaultDate: moment().format(),
|
||||
minDate: "today",
|
||||
plugins: [new confirmDatePlugin({})], // eslint-disable-line new-cap, no-undef
|
||||
plugins: [new ConfirmDatePlugin({})],
|
||||
});
|
||||
current_actions_popover_elem = elt;
|
||||
}
|
||||
|
|
|
@ -11,7 +11,6 @@ declare namespace StackTraceGPS {
|
|||
};
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
declare class StackTraceGPS {
|
||||
constructor(options?: StackTraceGPS.StackTraceGPSOptions);
|
||||
pinpoint(stackframe: StackFrame): Promise<StackFrame>;
|
||||
|
|
|
@ -9,7 +9,6 @@ declare namespace BundleTracker {
|
|||
}
|
||||
}
|
||||
|
||||
// eslint-disable-next-line no-redeclare
|
||||
declare class BundleTracker extends Plugin {
|
||||
constructor(options?: BundleTracker.Options);
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ def run() -> None:
|
|||
description="Standard CSS style and formatting linter "
|
||||
"(config: stylelint.config.js)")
|
||||
linter_config.external_linter('eslint', ['node', 'node_modules/.bin/eslint',
|
||||
'--quiet', '--cache', '--ext', '.js,.ts'], ['js', 'ts'],
|
||||
'--max-warnings=0', '--cache', '--ext', '.js,.ts'], ['js', 'ts'],
|
||||
fix_arg='--fix',
|
||||
description="Standard JavaScript style and formatting linter "
|
||||
"(config: .eslintrc).")
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
"use strict";
|
||||
|
||||
/* global $, navigate */
|
||||
|
||||
const path = require("path");
|
||||
|
||||
const commander = require("commander");
|
||||
|
@ -56,8 +58,8 @@ async function run() {
|
|||
await page.waitForSelector(messageSelector);
|
||||
// remove unread marker and don't select message
|
||||
const marker = `#zfilt${options.messageId} .unread_marker`;
|
||||
await page.evaluate((sel) => $(sel).remove(), marker); // eslint-disable-line no-undef
|
||||
await page.evaluate(() => navigate.up()); // eslint-disable-line no-undef
|
||||
await page.evaluate((sel) => $(sel).remove(), marker);
|
||||
await page.evaluate(() => navigate.up());
|
||||
const messageBox = await page.$(messageSelector);
|
||||
const messageGroup = (await messageBox.$x(".."))[0];
|
||||
// Compute screenshot area, with some padding around the message group
|
||||
|
|
Loading…
Reference in New Issue