Skip to content

Commit

Permalink
[camel-case-local-functions] add symbol and bigint to list of builtins
Browse files Browse the repository at this point in the history
  • Loading branch information
jwbay committed Jul 31, 2020
1 parent 0fff805 commit 81f9bb4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 11 additions & 1 deletion rules/camelCaseLocalFunctionsRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,17 @@ function walk(ctx: Lint.WalkContext<void>) {
})
}

const whitelist = ['Array', 'Boolean', 'Error', 'Function', 'Number', 'Object', 'String']
const whitelist = [
'Array',
'Boolean',
'Error',
'Function',
'Number',
'Object',
'String',
'Symbol',
'BigInt',
]

function checkFunctionName(ctx: Lint.WalkContext<void>, name: ts.Identifier) {
const firstLetter = name.text.charAt(0)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,12 @@ Array(1, 2, 3);
Object({ x: 42 });
Function('return 42');
Error('boom');
Symbol();
BigInt();

const fails1 = Upper();
~~~~~ [camelcase]
const fails2 = UpperImport();
~~~~~~~~~~~ [camelcase]

[camelcase]: local function names should be camelCase
[camelcase]: local function names should be camelCase

0 comments on commit 81f9bb4

Please sign in to comment.