Skip to content

Commit 81f9bb4

Browse files
committed
[camel-case-local-functions] add symbol and bigint to list of builtins
1 parent 0fff805 commit 81f9bb4

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

rules/camelCaseLocalFunctionsRule.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,17 @@ function walk(ctx: Lint.WalkContext<void>) {
2020
})
2121
}
2222

23-
const whitelist = ['Array', 'Boolean', 'Error', 'Function', 'Number', 'Object', 'String']
23+
const whitelist = [
24+
'Array',
25+
'Boolean',
26+
'Error',
27+
'Function',
28+
'Number',
29+
'Object',
30+
'String',
31+
'Symbol',
32+
'BigInt',
33+
]
2434

2535
function checkFunctionName(ctx: Lint.WalkContext<void>, name: ts.Identifier) {
2636
const firstLetter = name.text.charAt(0)

test/camelCaseLocalFunctionsRule/camelCaseLocalFunctionsRule.tsx.lint

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,12 @@ Array(1, 2, 3);
2727
Object({ x: 42 });
2828
Function('return 42');
2929
Error('boom');
30+
Symbol();
31+
BigInt();
3032

3133
const fails1 = Upper();
3234
~~~~~ [camelcase]
3335
const fails2 = UpperImport();
3436
~~~~~~~~~~~ [camelcase]
3537

36-
[camelcase]: local function names should be camelCase
38+
[camelcase]: local function names should be camelCase

0 commit comments

Comments
 (0)