-
-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(useFilenamingConvention): take export renaming into account (#4260)
- Loading branch information
Showing
12 changed files
with
120 additions
and
10 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
2 changes: 2 additions & 0 deletions
2
crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/Invalid_Renamed_Export.js
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 @@ | ||
class Invalid_Renamed_Export {} | ||
export { Invalid_Renamed_Export as A } |
23 changes: 23 additions & 0 deletions
23
...biome_js_analyze/tests/specs/style/useFilenamingConvention/Invalid_Renamed_Export.js.snap
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,23 @@ | ||
--- | ||
source: crates/biome_js_analyze/tests/spec_tests.rs | ||
expression: Invalid_Renamed_Export.js | ||
--- | ||
# Input | ||
```jsx | ||
class Invalid_Renamed_Export {} | ||
export { Invalid_Renamed_Export as A } | ||
``` | ||
|
||
# Diagnostics | ||
``` | ||
Invalid_Renamed_Export.js lint/style/useFilenamingConvention ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
! The filename should be in camelCase or kebab-case or snake_case or equal to the name of an export. | ||
i The filename could be renamed to one of the following names: | ||
invalid-renamed-export.js | ||
invalidRenamedExport.js | ||
invalid_renamed_export.js | ||
``` |
2 changes: 2 additions & 0 deletions
2
crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/Valid_Renamed_Export.js
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 @@ | ||
class A {} | ||
export { A as Valid_Renamed_Export } |
9 changes: 9 additions & 0 deletions
9
...s/biome_js_analyze/tests/specs/style/useFilenamingConvention/Valid_Renamed_Export.js.snap
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,9 @@ | ||
--- | ||
source: crates/biome_js_analyze/tests/spec_tests.rs | ||
expression: Valid_Renamed_Export.js | ||
--- | ||
# Input | ||
```jsx | ||
class A {} | ||
export { A as Valid_Renamed_Export } | ||
``` |
9 changes: 9 additions & 0 deletions
9
crates/biome_js_analyze/tests/specs/style/useFilenamingConvention/Valid_Renamed_Export.snap
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,9 @@ | ||
--- | ||
source: crates/biome_js_analyze/tests/spec_tests.rs | ||
expression: Valid_Renamed_Export.js | ||
--- | ||
# Input | ||
```jsx | ||
class A {} | ||
export { A as Valid_Renamed_Export } | ||
``` |
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
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
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
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