Skip to content

Commit

Permalink
feat: useExportsLast
Browse files Browse the repository at this point in the history
  • Loading branch information
tommymorgan committed Oct 10, 2024
1 parent e5672d4 commit e832245
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const a = 1;

const b = 2;
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.
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
const a = 1;
const b = 2;

export { a };

0 comments on commit e832245

Please sign in to comment.