Skip to content

Commit

Permalink
lint: specify name for identifier
Browse files Browse the repository at this point in the history
  • Loading branch information
arirubinstein committed Mar 31, 2023
1 parent 501fa39 commit 4462522
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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}'`,
})),
);
Expand Down

0 comments on commit 4462522

Please sign in to comment.