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.

32 lines
866 B

  1. # import/export
  2. Reports funny business with exports, like repeated exports of names or defaults.
  3. ## Rule Details
  4. ```js
  5. export default class MyClass { /*...*/ } // Multiple default exports.
  6. function makeClass() { return new MyClass(...arguments) }
  7. export default makeClass // Multiple default exports.
  8. ```
  9. or
  10. ```js
  11. export const foo = function () { /*...*/ } // Multiple exports of name 'foo'.
  12. function bar() { /*...*/ }
  13. export { bar as foo } // Multiple exports of name 'foo'.
  14. ```
  15. In the case of named/default re-export, all `n` re-exports will be reported,
  16. as at least `n-1` of them are clearly mistakes, but it is not clear which one
  17. (if any) is intended. Could be the result of copy/paste, code duplication with
  18. intent to rename, etc.
  19. ## Further Reading
  20. - Lee Byron's [ES7] export proposal
  21. [ES7]: https://github.com/leebyron/ecmascript-more-export-from