source: frontend/node_modules/eslint-plugin-import/docs/rules/exports-last.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 935 bytes
Line 
1# import/exports-last
2
3<!-- end auto-generated rule header -->
4
5This rule enforces that all exports are declared at the bottom of the file. This rule will report any export declarations that comes before any non-export statements.
6
7## This will be reported
8
9```JS
10
11const bool = true
12
13export default bool
14
15const str = 'foo'
16
17```
18
19```JS
20
21export const bool = true
22
23const str = 'foo'
24
25```
26
27## This will not be reported
28
29```JS
30const arr = ['bar']
31
32export const bool = true
33
34export default bool
35
36export function func() {
37 console.log('Hello World 🌍')
38}
39
40export const str = 'foo'
41```
42
43## When Not To Use It
44
45If you don't mind exports being sprinkled throughout a file, you may not want to enable this rule.
46
47### ES6 exports only
48
49The exports-last rule is currently only working on ES6 exports. You may not want to enable this rule if you're using CommonJS exports.
50
51If you need CommonJS support feel free to open an issue or create a PR.
Note: See TracBrowser for help on using the repository browser.