From 05a17ea4709d8c636da15f926fccab30158259fd Mon Sep 17 00:00:00 2001 From: Mark Banner Date: Mon, 26 Feb 2024 11:35:41 +0000 Subject: [PATCH] Bug 1881262 - Disable ESLint rule no-useless-escape across the code as it isn't very useful. r=mossop Differential Revision: https://phabricator.services.mozilla.com/D202321 --- security/.eslintrc.js | 3 --- taskcluster/docker/periodic-updates/.eslintrc.js | 3 --- .../eslint-plugin-mozilla/lib/configs/recommended.js | 7 ++++--- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/security/.eslintrc.js b/security/.eslintrc.js index 2fd5d86c28e3..eba5293ac646 100644 --- a/security/.eslintrc.js +++ b/security/.eslintrc.js @@ -40,9 +40,6 @@ module.exports = { // No expressions where a statement is expected "no-unused-expressions": "error", - // Disallow unnecessary escape usage in strings and regular expressions. - "no-useless-escape": "error", - // Require "use strict" to be defined globally in the script. strict: ["error", "global"], diff --git a/taskcluster/docker/periodic-updates/.eslintrc.js b/taskcluster/docker/periodic-updates/.eslintrc.js index d82826124605..f0a1bfad1b2b 100644 --- a/taskcluster/docker/periodic-updates/.eslintrc.js +++ b/taskcluster/docker/periodic-updates/.eslintrc.js @@ -45,9 +45,6 @@ module.exports = { // No expressions where a statement is expected "no-unused-expressions": "error", - // Disallow unnecessary escape usage in strings and regular expressions. - "no-useless-escape": "error", - // Require "use strict" to be defined globally in the script. strict: ["error", "global"], diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js index 2c55e472d9f3..bfe4689e77ea 100644 --- a/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js +++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/configs/recommended.js @@ -18,12 +18,14 @@ * require-atomic-updates - bug 1551829. * - This generates too many false positives that are not easy to work * around, and false positives seem to be inherent in the rule. - * no-inner-declarations - bug 1487642 + * no-inner-declarations - bug 1487642. * - Would be interested if this could apply to just vars, but at the moment * it doesn't. * max-depth * - Don't enforce the maximum depth that blocks can be nested. The * complexity rule is a better rule to check this. + * no-useless-escape - bug 1881262. + * - This doesn't reveal any actual errors, and is a lot of work to address. */ module.exports = { env: { @@ -331,8 +333,7 @@ module.exports = { // lines) "no-useless-concat": "error", - // XXX Bug 1487642 - decide if we want to enable this or not. - // Disallow unnecessary escape characters + // See explicit decisions at top of file. "no-useless-escape": "off", // Disallow redundant return statements