-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no-unresolved for react native #279
Comments
I think you may be able to do this by setting the following in an settings:
import/resolver:
node:
extensions:
# if unset, default is just '.js', but it must be re-added explicitly if set
- .js
- .android.js
- .ios.js See the Node resolver README for more details. Also see #283; if this works, would be good to capture in a shared config. (PR welcome! 😎)
It won't do this, it will only ensure at least one of them exists. I can imagine a rule that could enforce that all of some list exist, though. That would be cool. |
Thanks @benmosher the |
Sweet, I'ma close this and we can track via #283 or some new issue. |
For using react-native-web, this works good 🔥🔥🔥
|
Source: import-js/eslint-plugin-import#279 (comment) kiwicom-source-id: a4546579be39cecce2f8335963d2f0e4b96884b3
In react native, you can have an import statement
import Foo from "./foo"
which could refer to the file(and I imagine they'll be adding another with Windows Universal platform support coming).
no-unresolved
gives an error whenfoo.js
doesn't exist, butfoo.android.js
andfoo.ios.js
does. I think that it should accept the platform specific files if they exist, but perhaps could warm if one or more are missing (i.e. you havefoo.android.js
but notfoo.ios.js
)The text was updated successfully, but these errors were encountered: