ESLint: Enable @typescript-eslint/naming-convention rule

This check enforces consistent variable naming.

Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
David Mehren 2021-02-20 21:15:45 +01:00
parent 1114127b80
commit e83f1e206b
No known key found for this signature in database
GPG key ID: 185982BA4C42B7C3
4 changed files with 32 additions and 6 deletions

View file

@ -28,5 +28,29 @@ module.exports = {
'@typescript-eslint/explicit-module-boundary-types': 'off',
'no-return-await': 'off',
'@typescript-eslint/return-await': ['error', 'always'],
'@typescript-eslint/naming-convention': [
'error',
{
selector: 'default',
format: ['camelCase'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: 'enumMember',
format: ['UPPER_CASE'],
},
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: 'typeLike',
format: ['PascalCase'],
},
],
},
};