If I have single export in a file like this
export const url = "google.com";
It shows me linting error for prefer-default-export, but making it default would throw me this error
Parsing error: Unexpected token const
Because that’s not a default export; if you want it default you’ll have to do it in two lines:
const url = ‘google.com’;
export default url;
This solves my problem. Cool, thanks 🎉
Most helpful comment
Because that’s not a default export; if you want it default you’ll have to do it in two lines: