From 44625220d4f4a9a6c234c9808701538c9f4f0451 Mon Sep 17 00:00:00 2001 From: Ari Rubinstein Date: Thu, 30 Mar 2023 18:19:19 -0700 Subject: [PATCH] lint: specify name for identifier --- .eslintrc.cjs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.eslintrc.cjs b/.eslintrc.cjs index a5ac94c058a..2477068449f 100644 --- a/.eslintrc.cjs +++ b/.eslintrc.cjs @@ -11,8 +11,12 @@ const deprecatedTerminology = [ ['whitelist', 'allowlist'], ['RUN', 'IST', '/RUN/'], ].flatMap(([bad, good, badRgx = `/${bad}/i`]) => - ['Literal', 'TemplateLiteral', 'Identifier'].map(selectorType => ({ - selector: `${selectorType}[value=${badRgx}]`, + [ + ['Literal', 'value'], + ['TemplateElement', 'value.raw'], + ['Identifier', 'name'], + ].map(([selectorType, field]) => ({ + selector: `${selectorType}[${field}=${badRgx}]`, message: `Use '${good}' instead of deprecated '${bad}'`, })), );