question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

react-native-community/eslint and TypeScript 3.7

See original GitHub issue

react-native-community/eslint uses

    "@typescript-eslint/eslint-plugin": "^1.5.0",
    "@typescript-eslint/parser": "^1.5.0",
    "prettier": "1.17.0"

which are limited to TypeScript 3.5.*, blocking features like null coalescing and optional chaining. With the overrides below I managed to skip such errors and get only the errors I really had to deal with.

  "resolutions": {
    "**/@typescript-eslint/eslint-plugin": "2.15.0",
    "**/@typescript-eslint/parser": "2.15.0",
    "**/prettier": "1.19.1"
  },

I can create a PR fixing it if you guys want


React Native version:

info Fetching system and libraries information...
System:
    OS: macOS 10.15.2
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.13.1 - ~/.nvm/versions/node/v12.13.1/bin/node
    Yarn: 1.19.1 - /usr/local/bin/yarn
    npm: 6.12.1 - ~/.nvm/versions/node/v12.13.1/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.2, DriverKit 19.0, macOS 10.15, tvOS 13.2, watchOS 6.1
    Android SDK:
      API Levels: 23, 27, 28, 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-28 | Google APIs Intel x86 Atom, android-28 | Google Play Intel x86 Atom
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5900203
    Xcode: 11.3/11C29 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: 0.61.4 => 0.61.4

Steps To Reproduce

  1. https://facebook.github.io/react-native/docs/typescript#adding-typescript-to-an-existing-project
  2. Use TypeScript 3.7 and react-native-community/eslint:0.0.6

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:22
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
hannojgcommented, Apr 21, 2020

Have just tested it with 1.1.0 doesn’t seem to work (at least for me) // EDIT: sorry just had to restart the IDE, works now 😊

1reaction
Naturalclarcommented, Mar 30, 2020

the community eslint config has updated prettier to v2 in this commit https://github.com/facebook/react-native/commit/89d04b5e4a3fd0b0f77b5a390c0aa62a3804e2bc#diff-07d8dac5e415f4617208ba79d55bc35f which should resolve the issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

Documentation - TypeScript 3.7
For that reason, TypeScript 3.7 introduces a new concept called “assertion signatures” which model these assertion functions. The first type of assertion ...
Read more >
node.js - react-native - warnings setting up basic project
warning "@react-native-community/eslint-config > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.
Read more >
Announcing TypeScript 3.7 - Microsoft Developer Blogs
We're thrilled to announce the release of TypeScript 3.7, a release packed with awesome new language, compiler, and tooling features.
Read more >
Ios upload error - Get Help - Adalo - Forum
warning “@react-native-community/eslint-config > @typescript-eslint/eslint-plugin > tsutils@3.17.1” has unmet peer dependency ...
Read more >
React Native project creation stalling at CocoaPods - Questions
... eslint-scope@3.7.1 ├─ eslint-visitor-keys@1.0.0 ├─ esrecurse@4.2.1 ... "@react-native-community/eslint-config > @typescript-eslint/eslint-plugin ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found