Since stlyled-jsx/css do not actually exist, this confuses eslint-import, which checks if imports exist.
eslint-config-import would give errors like this:
Unable to resolve path to module 'styled-jsx/css' import/no-unresolved
and this failed to pass our CI: https://travis-ci.org/cofacts/rumors-site/builds/300921835
Besides CI, I believe this would also confuse IDEs that checks for imports as well.
How about adding a stub file css.js (with a stub css function inside) so that it can be resolved correctly?
I keep ESLint quiet with import/core-modules:
// .eslintrc
{
"parser": "babel-eslint",
"extends": "airbnb",
"env": {
"node": true,
},
"settings": {
"import/core-modules": ["styled-jsx", "styled-jsx/css"],
},
"rules": {
// ...
}
}
Cool I didn't know about import/core-modules. Thanks a million!
Most helpful comment
I keep ESLint quiet with
import/core-modules: