This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added possibility to enforce different file name casings (#4206)
* Enhance file name casing rule and improved its tests * Added option description and examples * Utilize undefined instead of explicitly using null * Change file-name-casing option to key-value pair Use key-value pair instead of tuple; several performance improvements; fix options JSON schema; show warnings in case of unexpected options * Adjust description and example for object option * Undo fix in launch.json Will be done in separate PR
- Loading branch information
Showing
21 changed files
with
116 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"rules": { | ||
"file-name-casing": [true, "camel-case"] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions
2
test/rules/file-name-casing/file-matcher/notPascalCase.ts.lint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
~nil [File name must be PascalCase] |
2 changes: 2 additions & 0 deletions
2
test/rules/file-name-casing/file-matcher/not_camel_case.ts.lint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
~nil [File name must be camelCase] |
2 changes: 2 additions & 0 deletions
2
test/rules/file-name-casing/file-matcher/not_kebab_case.tsx.lint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
~nil [File name must be kebab-case] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"rules": { | ||
"file-name-casing": [ | ||
true, | ||
{ | ||
".*)": "snake-case", // making sure invalid RegExp will be ignored | ||
"pascal.?case": "pascal-case", | ||
"tsx$": "kebab-case", | ||
".*": "camel-case" | ||
} | ||
] | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"rules": { | ||
"file-name-casing": [true, "invalid-option"] | ||
} | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
~nil [File name must be kebab-case] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"rules": { | ||
"file-name-casing": [true, "kebab-case"] | ||
} | ||
} |
Empty file.
2 changes: 2 additions & 0 deletions
2
test/rules/file-name-casing/pascal-case/no-pascal-case.ts.lint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
~nil [File name must be PascalCase] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"rules": { | ||
"file-name-casing": [true, "pascal-case"] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
File renamed without changes.