Skip to content

Commit

Permalink
Update naming conventions
Browse files Browse the repository at this point in the history
  • Loading branch information
kevcenteno committed Dec 6, 2024
1 parent cf7e72e commit 3260a06
Showing 1 changed file with 30 additions and 11 deletions.
41 changes: 30 additions & 11 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -222,18 +222,37 @@ export default tseslint.config(
rules: {
'@typescript-eslint/await-thenable': 'error',

'@typescript-eslint/naming-convention': [
'error',
'@typescript-eslint/naming-convention': ['error',
{
custom: {
match: true,
regex: '^I[A-Z]',
},

format: [
'PascalCase',
],
selector: 'interface',
selector: 'default', format: ['camelCase'],
},
{
selector: 'classProperty', format: ['camelCase'], leadingUnderscore: 'allow',
},
{
selector: 'enumMember', format: ['PascalCase', 'camelCase'],
},
{
selector: 'import', format: ['camelCase', 'PascalCase'],
},
{
selector: 'objectLiteralProperty', format: null,
},
{
selector: 'parameter', format: ['camelCase', 'snake_case'], leadingUnderscore: 'allow',
},
{
selector: 'typeLike', format: ['PascalCase'],
},
{
selector: 'typeProperty', format: ['camelCase', 'snake_case'], leadingUnderscore: 'allow',
},
// Allow dashes in variable names. This is useful for things like country codes
{
selector: 'typeProperty', format: null, filter: { regex: '^[a-zA-Z-]+', match: true },
},
{
selector: 'variable', format: ['camelCase', 'PascalCase', 'snake_case', 'UPPER_CASE'], leadingUnderscore: 'allow',
},
],
},
Expand Down

0 comments on commit 3260a06

Please sign in to comment.