From 3260a060b8135eca42015bc3a522294310ca3934 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 | 41 ++++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 11 deletions(-) diff --git a/eslint.config.mjs b/eslint.config.mjs index 8f33a06a1..48f5db93e 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -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', }, ], },