Code:
import data from './data'
Relevant config:
"import/default": 2,
Error:
error No default export found in module
I'm not 100% certain, but I believe that node will allow importing of json files when the new module syntax is implemented. So this appears to be an error.
For more info: https://github.com/nodejs/node-eps/issues/34
You can use the import/extensions setting to restrict parsing (and thus, reported errors) to just .js files.
That said, I should dig into that issue and see what the json import behavior will be.
BTW, #267 for more context on why it is what it is, today.
Just read the linked node-eps issue. Should be easy enough to allow a single default export for JSON and go from there, though if you set import/extensions to ['.js'] it's roughly the same user experience.
though if you set import/extensions to ['.js'] it's roughly the same user experience.
Not exactly. Because if someone tries to pull out properties as named exports then this could warn for that.
Most helpful comment
Not exactly. Because if someone tries to pull out properties as named exports then this could warn for that.