Tools: Add linter rules for a few TypeScript naming conventions

This commit is contained in:
Laurent Cozic
2021-08-18 16:21:48 +01:00
parent 06ed58b809
commit 11d35711c1
2 changed files with 30 additions and 2 deletions
+28
View File
@@ -171,6 +171,34 @@ module.exports = {
},
}],
'@typescript-eslint/no-floating-promises': ['error'],
'@typescript-eslint/naming-convention': ['error',
// Naming conventions over the codebase is very inconsistent
// unfortunately and fixing it would be way too much work.
// In general, we use "strictCamelCase" for variable names.
// {
// selector: 'default',
// format: ['StrictPascalCase', 'strictCamelCase', 'snake_case', 'UPPER_CASE'],
// leadingUnderscore: 'allow',
// trailingUnderscore: 'allow',
// },
{
selector: 'enumMember',
format: ['StrictPascalCase'],
},
{
selector: 'enumMember',
format: null,
'filter': {
'regex': '^(GET|POST|PUT|DELETE|PATCH|HEAD|SQLite|PostgreSQL|ASC|DESC|E2EE|OR|AND|UNION|INTERSECT|EXCLUSION|INCLUSION|EUR|GBP|USD)$',
'match': true,
},
},
{
selector: 'interface',
format: ['StrictPascalCase'],
},
],
},
},
],