Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Commit

Permalink
Make import-name camelCase begin with lowercase
Browse files Browse the repository at this point in the history
`camelCase` currently allows the first letter to be uppercase by
enforcing that it matches the casing of the file name first letter.
Enforce the first letter to be lowercase.
  • Loading branch information
dosentmatter committed Jul 21, 2019
1 parent b26592e commit 5e29832
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/importNameRule.ts
Expand Up @@ -233,12 +233,14 @@ function walk(ctx: Lint.WalkContext<Option>) {
}

function makeCamelCase(input: string): string {
return input.replace(
let result = `${input.charAt(0)}${input.slice(1)}`;
result = result.replace(
/[-|\.|_](.)/g, // tslint:disable-next-line:variable-name
(_match: string, group1: string): string => {
return group1.toUpperCase();
}
);
return result;
}

function makePascalCase(input: string): string {
Expand Down

0 comments on commit 5e29832

Please sign in to comment.