Skip to content

Commit 1489635

Browse files
committed
Update naming conventions
1 parent cf7e72e commit 1489635

File tree

1 file changed

+33
-14
lines changed

1 file changed

+33
-14
lines changed

eslint.config.mjs

Lines changed: 33 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -222,19 +222,38 @@ export default tseslint.config(
222222
rules: {
223223
'@typescript-eslint/await-thenable': 'error',
224224

225-
'@typescript-eslint/naming-convention': [
226-
'error',
227-
{
228-
custom: {
229-
match: true,
230-
regex: '^I[A-Z]',
231-
},
232-
233-
format: [
234-
'PascalCase',
235-
],
236-
selector: 'interface',
237-
},
238-
],
225+
'@typescript-eslint/naming-convention': ['error',
226+
{
227+
selector: 'default', format: ['camelCase'],
228+
},
229+
{
230+
selector: 'classProperty', format: ['camelCase'], leadingUnderscore: 'allow',
231+
},
232+
{
233+
selector: 'enumMember', format: ['PascalCase', 'camelCase'],
234+
},
235+
{
236+
selector: 'import', format: ['camelCase', 'PascalCase'],
237+
},
238+
{
239+
selector: 'objectLiteralProperty', format: null,
240+
},
241+
{
242+
selector: 'parameter', format: ['camelCase', 'snake_case'], leadingUnderscore: 'allow',
243+
},
244+
{
245+
selector: 'typeLike', format: ['PascalCase'],
246+
},
247+
{
248+
selector: 'typeProperty', format: ['camelCase', 'snake_case'], leadingUnderscore: 'allow',
249+
},
250+
// Allow dashes in variable names. This is useful for things like country codes
251+
{
252+
selector: 'typeProperty', format: null, filter: { regex: '^[a-zA-Z-]+', match: true },
253+
},
254+
{
255+
selector: 'variable', format: ['camelCase', 'PascalCase', 'snake_case', 'UPPER_CASE'], leadingUnderscore: 'allow',
256+
},
257+
],
239258
},
240259
});

0 commit comments

Comments
 (0)