-
-
Notifications
You must be signed in to change notification settings - Fork 467
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5672d4
commit e832245
Showing
3 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
crates/biome_js_analyze/tests/specs/nursery/useExportsLast/invalid.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,3 @@ | ||
export const a = 1; | ||
|
||
const b = 2; |
29 changes: 29 additions & 0 deletions
29
crates/biome_js_analyze/tests/specs/nursery/useExportsLast/invalid.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,29 @@ | ||
--- | ||
source: crates/biome_js_analyze/tests/spec_tests.rs | ||
expression: invalid.js | ||
--- | ||
# Input | ||
```jsx | ||
export const a = 1; | ||
|
||
const b = 2; | ||
|
||
``` | ||
|
||
# Diagnostics | ||
``` | ||
invalid.js:1:20 lint/nursery/useExportsLast ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ | ||
! All exports should be declared after all non-export statements. | ||
> 1 │ export const a = 1; | ||
│ | ||
> 2 │ | ||
> 3 │ const b = 2; | ||
│ ^^^^^^^^^^^^ | ||
4 │ | ||
i Move this statement before the export statements to keep all exports at the end of the module. | ||
``` |
4 changes: 4 additions & 0 deletions
4
crates/biome_js_analyze/tests/specs/nursery/useExportsLast/valid.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,4 @@ | ||
const a = 1; | ||
const b = 2; | ||
|
||
export { a }; |