-
-
Notifications
You must be signed in to change notification settings - Fork 442
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(lint/useNamingConvention): allow import namespace in PascalC…
…ase (#174)
- Loading branch information
Showing
9 changed files
with
172 additions
and
66 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
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
9 changes: 9 additions & 0 deletions
9
crates/rome_js_analyze/tests/specs/nursery/useNamingConvention/invalidExportNamespace.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,9 @@ | ||
export * as X from "" | ||
|
||
export * as PascalCase from "" | ||
|
||
export * as CONSTANT_CASE from "" | ||
|
||
export * as snake_case from "" | ||
|
||
export * as Unknown_Style from "" |
70 changes: 70 additions & 0 deletions
70
...es/rome_js_analyze/tests/specs/nursery/useNamingConvention/invalidExportNamespace.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,70 @@ | ||
--- | ||
source: crates/rome_js_analyze/tests/spec_tests.rs | ||
expression: invalidExportNamespace.js | ||
--- | ||
# Input | ||
```js | ||
export * as X from "" | ||
|
||
export * as PascalCase from "" | ||
|
||
export * as CONSTANT_CASE from "" | ||
|
||
export * as snake_case from "" | ||
|
||
export * as Unknown_Style from "" | ||
|
||
``` | ||
|
||
# Diagnostics | ||
``` | ||
invalidExportNamespace.js:5:13 lint/nursery/useNamingConvention ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
! This export namespace name should be in camelCase or PascalCase. | ||
3 │ export * as PascalCase from "" | ||
4 │ | ||
> 5 │ export * as CONSTANT_CASE from "" | ||
│ ^^^^^^^^^^^^^ | ||
6 │ | ||
7 │ export * as snake_case from "" | ||
i The name could be renamed to `constantCase`. | ||
``` | ||
|
||
``` | ||
invalidExportNamespace.js:7:13 lint/nursery/useNamingConvention ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
! This export namespace name should be in camelCase or PascalCase. | ||
5 │ export * as CONSTANT_CASE from "" | ||
6 │ | ||
> 7 │ export * as snake_case from "" | ||
│ ^^^^^^^^^^ | ||
8 │ | ||
9 │ export * as Unknown_Style from "" | ||
i The name could be renamed to `snakeCase`. | ||
``` | ||
|
||
``` | ||
invalidExportNamespace.js:9:13 lint/nursery/useNamingConvention ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
! This export namespace name should be in camelCase or PascalCase. | ||
7 │ export * as snake_case from "" | ||
8 │ | ||
> 9 │ export * as Unknown_Style from "" | ||
│ ^^^^^^^^^^^^^ | ||
10 │ | ||
i The name could be renamed to `unknownStyle`. | ||
``` | ||
|
||
|
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
7 changes: 7 additions & 0 deletions
7
crates/rome_js_analyze/tests/specs/nursery/useNamingConvention/validExportNamespace.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,7 @@ | ||
export * as x from "" | ||
|
||
export * as camelCase from "" | ||
|
||
export * as $ from "" | ||
|
||
export * as _ from "" |
16 changes: 16 additions & 0 deletions
16
crates/rome_js_analyze/tests/specs/nursery/useNamingConvention/validExportNamespace.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,16 @@ | ||
--- | ||
source: crates/rome_js_analyze/tests/spec_tests.rs | ||
expression: validExportNamespace.js | ||
--- | ||
# Input | ||
```js | ||
export * as x from "" | ||
|
||
export * as camelCase from "" | ||
|
||
export * as $ from "" | ||
|
||
export * as _ from "" | ||
``` | ||
|
||
|
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