Skip to content

Commit

Permalink
Make @typescript-eslint/naming-convention ignore quoted keys
Browse files Browse the repository at this point in the history
  • Loading branch information
GauBen committed May 8, 2022
1 parent 022fe25 commit 4fa4e99
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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',
Expand Down

0 comments on commit 4fa4e99

Please sign in to comment.