web 3d图形渲染器
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
896 B

  1. # import/exports-last
  2. This 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.
  3. ## This will be reported
  4. ```JS
  5. const bool = true
  6. export default bool
  7. const str = 'foo'
  8. ```
  9. ```JS
  10. export const bool = true
  11. const str = 'foo'
  12. ```
  13. ## This will not be reported
  14. ```JS
  15. const arr = ['bar']
  16. export const bool = true
  17. export default bool
  18. export function func() {
  19. console.log('Hello World 🌍')
  20. }
  21. export const str = 'foo'
  22. ```
  23. ## When Not To Use It
  24. If you don't mind exports being sprinkled throughout a file, you may not want to enable this rule.
  25. #### ES6 exports only
  26. The exports-last rule is currently only working on ES6 exports. You may not want to enable this rule if you're using CommonJS exports.
  27. If you need CommonJS support feel free to open an issue or create a PR.