Skip to content

Commit 1fa09bb

Browse files
authored
Eslint naming convention (#81)
- PR #550 suggested a lint check for type naming conventions
1 parent 11fcb76 commit 1fa09bb

File tree

2 files changed

+29
-9
lines changed

2 files changed

+29
-9
lines changed

.eslintrc.cjs

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ module.exports = {
2727

2828
// Use `noImplicitReturns` instead. See https://typescript-eslint.io/rules/consistent-return/.
2929
'consistent-return': 'off',
30-
'no-param-reassign': ['error', { props: false }],
3130
'import/default': 'off',
3231
'import/extensions': 'off',
3332
// A temporary hack related to IDE not resolving correct package.json
3433
'import/no-extraneous-dependencies': 'off',
3534
'import/no-import-module-exports': 'off',
3635
'import/no-unresolved': 'error',
3736
'import/prefer-default-export': 'off',
37+
'no-param-reassign': ['error', { props: false }],
3838
'react/jsx-filename-extension': 'off',
3939
'react/react-in-jsx-scope': 'off',
4040

@@ -58,6 +58,26 @@ module.exports = {
5858
{ exceptAfterSingleLine: true, exceptAfterOverload: true },
5959
],
6060
'@typescript-eslint/member-ordering': 'error',
61+
'@typescript-eslint/naming-convention': [
62+
'error',
63+
{
64+
selector: 'variableLike',
65+
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
66+
leadingUnderscore: 'allow',
67+
},
68+
{
69+
selector: 'enumMember',
70+
format: ['PascalCase'],
71+
},
72+
{
73+
selector: 'function',
74+
format: ['camelCase', 'PascalCase'],
75+
},
76+
{
77+
selector: 'typeLike',
78+
format: ['PascalCase'],
79+
},
80+
],
6181
'no-empty-function': 'off',
6282
'@typescript-eslint/no-empty-function': [
6383
'error',

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)