Closed MajStc closed 1 year ago
Hey! 👋
The issue doesn't seem to contain a minimal reproduction.
Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?
Something must be wrong with your eslint config, maybe its because of 'import/resolver'
... Unfortunately it's not directly a problem with our library but with eslint so we have to close it.
The problem is with the import/resolver
. Here is the workaround to make eslint
happy:
In your .eslintrc
add react-native-reanimated
to the import/ignore
section.
settings: {
react: {
version: 'detect',
},
'import/resolver': {
typescript: {},
},
'import/ignore': ['react-native', 'react-native-reanimated'],
},
Description
First of all - reanimated works as expected with no runtime issues at all.
After installing react-native-reanimted my eslint/typescript checks became buggy (I had to restart the server after - as it turned out - each time I visited a file that included reanimated import). I quickly discovered uninstalling reanimated fixes the issue, also in the component where I use reanimated I see below errors
Unable to resolve path to module 'react-native-reanimated'.eslint[import/no-unresolved](https://github.com/import-js/eslint-plugin-import/blob/v2.27.5/docs/rules/no-unresolved.md)
and
This is my package.json
My eslintrc.js
and my babel.config.js
What I mean by 'buggy' eslint/ts server:
Normal behavior:
Behavior after visiting file with reanimated import
After closing the file with reanimated import and restarting eslint server it's all good again :)
Also my pre-commit hook always fails with the same exact error as in the screenshot above.
Steps to reproduce
Snack or a link to a repository
Private repo, snack makes no sense as it's local setup
Reanimated version
3.0.1 (same on 3.0.2, I dwongraded it for test)
React Native version
0.71.4
Platforms
Android, iOS
JavaScript runtime
Hermes
Workflow
React Native (without Expo)
Architecture
Paper (Old Architecture)
Build type
None
Device
None
Device model
No response
Acknowledgements
Yes