From 4fa4e996d19b4f0773453a7ecfbe00aaabf8fb4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gautier=20Ben=20A=C3=AFm?= <48261497+GauBen@users.noreply.github.com> Date: Thu, 24 Mar 2022 01:00:00 +0100 Subject: [PATCH] Make @typescript-eslint/naming-convention ignore quoted keys --- index.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 4f21568..56814a5 100644 --- a/index.js +++ b/index.js @@ -3,6 +3,12 @@ const getNamingConventionRule = ({isTsx}) => ({ '@typescript-eslint/naming-convention': [ 'error', + { + // Ignore `{'Retry-After': retryAfter}` type properties. + selector: ['classProperty', 'objectLiteralProperty', 'classMethod', 'objectLiteralMethod', 'typeMethod'], + format: null, + modifiers: ["requiresQuotes"] + }, { /// selector: ['variableLike', 'memberLike', 'property', 'method'], // Note: Leaving out `parameter` and `typeProperty` because of the mentioned known issues. @@ -14,12 +20,7 @@ const getNamingConventionRule = ({isTsx}) => ({ ].filter(Boolean), // We allow double underscore because of GraphQL type names and some React names. leadingUnderscore: 'allowSingleOrDouble', - trailingUnderscore: 'allow', - // Ignore `{'Retry-After': retryAfter}` type properties. - filter: { - regex: '[- ]', - match: false - } + trailingUnderscore: 'allow' }, { selector: 'typeLike',