Skip to content
This repository was archived by the owner on Nov 18, 2021. It is now read-only.

Commit 2c42781

Browse files
Use PascalCase for TypeScript's enum member
1 parent 1908268 commit 2c42781

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

config/eslintrc_typescript.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,14 @@ module.exports = {
136136
{
137137
'selector': 'memberLike',
138138
'modifiers': ['private', 'protected'],
139-
'format': null,
139+
'format': ['camelCase'],
140140
// FIXME: Does this option really work?
141141
'leadingUnderscore': 'require',
142142
},
143+
{
144+
'selector': 'enumMember',
145+
'format': ['PascalCase'],
146+
},
143147

144148
{
145149
'selector': 'typeLike',

test/typescript/test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,15 @@
1+
/* eslint-disable @typescript-eslint/no-unused-vars */
12
// Only for testing to avoid the compile error by typescript compiler
23
// if there it no input
34

45
/* eslint-env node */
56

67
console.log('test');
8+
9+
enum BarEnum {
10+
A = 1,
11+
}
12+
13+
const enum ConstBarEnum {
14+
A = '1',
15+
}

0 commit comments

Comments
 (0)