Skip to content
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

Warning from typescript-estree when using typescript template #28162

Closed
Jonathan0wh opened this issue Feb 23, 2020 · 4 comments
Closed

Warning from typescript-estree when using typescript template #28162

Jonathan0wh opened this issue Feb 23, 2020 · 4 comments
Labels
Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@Jonathan0wh
Copy link

Description:

We are getting the following error when using eslint for our project bootstrapped by React Native Template TypeScript:

WARNING: You are currently running a version of TypeScript which is not officially supported by typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.2.1 <3.6.0

YOUR TYPESCRIPT VERSION: 3.7.5

Please only submit bug reports when using the officially supported version.

After investigation, I found that this was caused by the eslint plugin @react-native-community/eslint-config in the React Native Template TypeScript package.json dependency.

In the package.json of the plugin eslint-config-react-native-community, it used quite old version ^1.5.0 for both @typescript-eslint/eslint-plugin and @typescript-eslint/parser, which supports up to typescript <3.6.0.

But both @typescript-eslint/eslint-plugin and @typescript-eslint/parser have latest versions of ^2.20.0 which supports typescript >=3.2.1 <3.8.0.

It might be better to make sure that the typescript version is in the range specified by @react-native-community/eslint-config in the React Native Template TypeScript (maybe pin the typescript version in the template is a way?).

Besides, it would also be needed to update the @typescript-eslint/eslint-plugin and @typescript-eslint/parser version in @react-native-community/eslint-config package.json more frequently to ensure that they include more latest typescript version.

React Native version:

System:
    OS: macOS 10.15.3
    CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
    Memory: 254.70 MB / 16.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 12.16.0 - /var/folders/5s/n_jyp2w15398z_jssgm979bh0000gn/T/yarn--1582470219059-0.421675122443812/node
    Yarn: 1.22.0 - /var/folders/5s/n_jyp2w15398z_jssgm979bh0000gn/T/yarn--1582470219059-0.421675122443812/yarn
    npm: 6.13.4 - ~/.nvm/versions/node/v12.16.0/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: 28, 29
      Build Tools: 28.0.3, 29.0.3
      System Images: android-28 | Google APIs Intel x86 Atom, android-29 | Google APIs Intel x86 Atom
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.6010548
    Xcode: 11.3.1/11C504 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0 
    react-native: 0.61.5 => 0.61.5

Steps To Reproduce

  1. npx react-native init MyApp --template react-native-template-typescript
  2. yarn lint

Expected Results

No error or warning in the console.

Snack, code example, screenshot, or link to a repository:

Similar issue in Create React App: facebook/create-react-app#7255

@jb-ertw
Copy link

jb-ertw commented Feb 25, 2020

At install time, you also see the earlier warning of:
@typescript-eslint/eslint-plugin@1.13.0 requires a peer of eslint@^5.0.0 but none is installed.

And investigating the package-lock.json clearly shows the requirement for the older versions of the @typescript-eslint/eslint-plugin and @typescript-eslint/parser packages:

"@react-native-community/eslint-config": {
      "version": "0.0.7",
      . . . .
      "dev": true,
      "requires": {
        "@react-native-community/eslint-plugin": "^1.0.0",
        "@typescript-eslint/eslint-plugin": "^1.5.0",
        "@typescript-eslint/parser": "^1.5.0",
        "babel-eslint": "10.0.3",
        "eslint-config-prettier": "^6.0.0",
        . . . .
        "eslint-plugin-react-native": "3.8.1",
        "prettier": "1.17.0"
      },

@Naturalclar
Copy link
Contributor

This PR may solve the issue. #27319
It sounds like this change may take a while as facebook seems to be using this config for other internal repos as well.

@stale
Copy link

stale bot commented May 25, 2020

Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. You may also label this issue as a "Discussion" or add it to the "Backlog" and I will leave it open. Thank you for your contributions.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label May 25, 2020
@stale
Copy link

stale bot commented Jun 2, 2020

Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.

@stale stale bot closed this as completed Jun 2, 2020
@facebook facebook locked as resolved and limited conversation to collaborators Jun 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Needs: Triage 🔍 Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

3 participants