Skip to content

Commit

Permalink
Tweak naming contention lint rule so that object literal properties e…
Browse files Browse the repository at this point in the history
…nclosed with quotes do not have to adhere to any specific naming convention.
  • Loading branch information
filmaj committed Aug 9, 2021
1 parent 903d3b8 commit 99ca57f
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,16 @@ module.exports = {
selector: 'default',
format: ['camelCase'],
},
{
// When defining properties on an object...
selector: 'objectLiteralProperty',
// ... do not enforce any particular format...
format: null,
// ... when the property name is enclosed in quotes
modifiers: ['requiresQuotes'],
// The above is useful for things like quoting HTTP header names
// i.e. { 'Content-Type': 'application/json' }
},
{
selector: 'variable',
// PascalCase for variables is added to allow exporting a singleton, function library, or bare object as in
Expand Down

0 comments on commit 99ca57f

Please sign in to comment.