The prefer-default-export rule fires when I do this:
// typography.js
export const { rhythm, TypographyStyle } = typography;
But I get import-named complaining that 'rhythm' cannot be found when I change it back to:
// typography.js
export default typography;
And continue to reference it like this:
// component.js
import { rhythm } from 'utils/typography';
I guess I prefer the first option, but that would require that prefer-default-export understand destructuring.
On the other hand, do we really want to be that restrictive on the import destructuring check? Isn't it reasonable to destructure a default export?
The
prefer-default-exportrule fires when I do this:But I get
import-namedcomplaining that 'rhythm' cannot be found when I change it back to:And continue to reference it like this:
I guess I prefer the first option, but that would require that
prefer-default-exportunderstand destructuring.On the other hand, do we really want to be that restrictive on the
importdestructuring check? Isn't it reasonable to destructure a default export?