From 14896351353d7f4eba268c82da92b2e5ff453ad6 Mon Sep 17 00:00:00 2001 From: kevcenteno Date: Fri, 6 Dec 2024 15:40:08 -0500 Subject: [PATCH] Update naming conventions --- eslint.config.mjs | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 8f33a06a1..3ec14c5c0 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -222,19 +222,38 @@ export default tseslint.config( rules: { '@typescript-eslint/await-thenable': 'error', - '@typescript-eslint/naming-convention': [ - 'error', - { - custom: { - match: true, - regex: '^I[A-Z]', - }, - - format: [ - 'PascalCase', - ], - selector: 'interface', - }, - ], + '@typescript-eslint/naming-convention': ['error', + { + 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', + }, + ], }, });