-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Showing
3 changed files
with
46 additions
and
0 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
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,41 @@ | ||
# exports-last | ||
|
||
This rule reports all export declaration which come before any non-export statements. | ||
|
||
## This will be reported | ||
|
||
```JS | ||
|
||
const bool = true | ||
|
||
export default bool | ||
|
||
const str = 'foo' | ||
|
||
``` | ||
|
||
```JS | ||
|
||
export const bool = true | ||
|
||
const str = 'foo' | ||
|
||
``` | ||
|
||
## This will not be reported | ||
|
||
```JS | ||
export const bool = true | ||
|
||
export default bool | ||
|
||
export function func() { | ||
console.log('Hello World 🌍') | ||
} | ||
|
||
export const str = 'foo' | ||
``` | ||
|
||
## When Not To Use It | ||
|
||
If you don't mind exports being sprinkled throughout a file, you may not want to enable this rule. |