Skip to content

Commit

Permalink
style(eslint): review naming convention
Browse files Browse the repository at this point in the history
  • Loading branch information
blephy committed Jul 3, 2022
1 parent e18a547 commit 6a144f1
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 3 deletions.
42 changes: 41 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,26 @@ module.exports = {
'error',
{
selector: 'default',
format: ['PascalCase', 'camelCase'],
format: ['PascalCase'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'variableLike',
format: ['camelCase'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'variable',
modifiers: ['const', 'global'],
format: ['UPPER_CASE'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'class',
format: ['PascalCase'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
Expand All @@ -310,6 +329,27 @@ module.exports = {
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'interface',
suffix: ['Interface'],
format: ['PascalCase'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'enum',
suffix: ['Enum'],
format: ['PascalCase'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'typeAlias',
suffix: ['Type'],
format: ['PascalCase'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
],
'@typescript-eslint/no-base-to-string': 'error',
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"alwaysStrict": true,
"newLine": "lf",
"resolveJsonModule": true,
"esModuleInterop": false,
"allowSyntheticDefaultImports": false,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"allowUnusedLabels": false,
Expand Down

0 comments on commit 6a144f1

Please sign in to comment.