Niedzielski has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/384106 )

Change subject: Chore: fix ESLint max length ignore directives
......................................................................

Chore: fix ESLint max length ignore directives

`// eslint-disable-line max-len` disables the max-len rule for the given
line. However, this rule also included an `ignorePattern` for any line
with an ESLint directive. This caused the rule to be disabled AND the
line to be ignored which triggered --report-unused-disable-directives.
Remove the ignore pattern for max-len specifically so only the rule will
be disabled and the line can be checked accurately for disable directive
usage.

Change-Id: I154335c7504dc0e73339acb285e9842291a858d5
---
M .eslintrc.json
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/marvin refs/changes/06/384106/1

diff --git a/.eslintrc.json b/.eslintrc.json
index 3cf0d28..0b7e2f4 100644
--- a/.eslintrc.json
+++ b/.eslintrc.json
@@ -14,7 +14,12 @@
       {
         "tabWidth": 2,
         "ignoreUrls": true,
-        "ignorePattern": "^/// .+|// eslint-.+"
+        // Note: exclude all eslint- directives except for max-len itself since
+        //       `// eslint-disable-line max-len` would cause this line to be
+        //       ignored AND this rule to be disabled which would trigger
+        //       --report-unused-disable-directives. By excluding max-len, the
+        //       effect is to consider the line but disable this rule.
+        "ignorePattern": "^/// .+|// (?!eslint-.+max-len)eslint-.+"
       }
     ],
     "sort-imports": "off",

-- 
To view, visit https://gerrit.wikimedia.org/r/384106
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I154335c7504dc0e73339acb285e9842291a858d5
Gerrit-PatchSet: 1
Gerrit-Project: marvin
Gerrit-Branch: master
Gerrit-Owner: Niedzielski <sniedziel...@wikimedia.org>
Gerrit-Reviewer: Sniedzielski <sniedziel...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to