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

Commit 38ef9d9

Browse files
authored
fix(file-name-casing): ignore option works correctly (#4848)
1 parent a15541d commit 38ef9d9

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

src/rules/fileNameCasingRule.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { isCamelCased, isKebabCased, isPascalCased, isSnakeCased } from "../util
2525
enum Casing {
2626
CamelCase = "camel-case",
2727
PascalCase = "pascal-case",
28-
Ignored = "ignored",
28+
Ignored = "ignore",
2929
KebabCase = "kebab-case",
3030
SnakeCase = "snake-case",
3131
}
@@ -40,7 +40,13 @@ type ValidationResult = Casing | undefined;
4040

4141
type Validator<T extends Config> = (sourceFile: ts.SourceFile, casing: T) => ValidationResult;
4242

43-
const rules = [Casing.CamelCase, Casing.PascalCase, Casing.KebabCase, Casing.SnakeCase];
43+
const rules = [
44+
Casing.CamelCase,
45+
Casing.Ignored,
46+
Casing.PascalCase,
47+
Casing.KebabCase,
48+
Casing.SnakeCase,
49+
];
4450

4551
const validCasingOptions = new Set(rules);
4652

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"rules": {
33
"file-name-casing": [true, {
4-
".component.ts": "pascal-case",
5-
".tsx": "pascal-case",
6-
".ts": "camel-case"
4+
".component.ts$": "pascal-case",
5+
".tsx$": "pascal-case",
6+
".ts$": "camel-case"
77
}]
88
}
99
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"rules": {
33
"file-name-casing": [true, {
4-
".ts": "ignore",
5-
".tsx": "pascal-case"
4+
".ts$": "ignore",
5+
".tsx$": "pascal-case"
66
}]
77
}
88
}

0 commit comments

Comments
 (0)