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

Issue when using 3.3.0-next.62 #8065

Closed
Albert-Gao opened this issue Dec 3, 2019 · 4 comments
Closed

Issue when using 3.3.0-next.62 #8065

Albert-Gao opened this issue Dec 3, 2019 · 4 comments

Comments

@Albert-Gao
Copy link

Albert-Gao commented Dec 3, 2019

Found this amazing release 3.3.0-next.62 from: #7981

Here I come optional chaining, all works but 2 issues when using Typescript 3.7.2

  1. It will stop compiling when using optional chaining, for this ESLint rule:no-unused-expressions, I have to extend ESLint and disable it in order to avoid adding eslint-disable-next-line every time I use it.
  "eslintConfig": {
    "extends": "react-app",
    "rules": {
      "no-unused-expressions": 0
    }
  },
  1. Visual Studio Code ESLint plugin (https://github.com/Microsoft/vscode-eslint) won't work because of the error:
Failed to load plugin '@typescript-eslint' declared in 'client/package.json » eslint-config-react-app#overrides[0]': Cannot find module '@typescript-eslint/eslint-plugin'
Require stack:
- /Users/AlbertGao/codes/test/__placeholder__.js
Happened while validating /Users/AlbertGao/codes/test/client/src/App.tsx
This can happen for a couple of reasons:
1. The plugin name is spelled incorrectly in an ESLint configuration file (e.g. .eslintrc).
2. If ESLint is installed globally, then make sure '@typescript-eslint/eslint-plugin' is installed globally as well.
3. If ESLint is installed locally, then '@typescript-eslint/eslint-plugin' isn't installed correctly.
@Albert-Gao Albert-Gao changed the title Issues when using 3.3.0-next.62 Issue when using 3.3.0-next.62 Dec 3, 2019
@Albert-Gao
Copy link
Author

Albert-Gao commented Dec 3, 2019

Ah, the 2nd one is the plugin's issue:
You have to specify the path to the eslintrc

{
  "eslint.workingDirectories": ["./client"]
}

@ianschmitz
Copy link
Contributor

I think 1 should have been solved by typescript-eslint/typescript-eslint#1175, which i don't believe that beta release includes. We've since updated the packages and will do so again before the final release.

For 2 it sounds like you've solved it. Likely you hadn't opened VS code to the CRA root is my guess?

@ianschmitz ianschmitz added this to the 3.3 milestone Dec 4, 2019
@Albert-Gao
Copy link
Author

the folder structure is:

---project root
-----------client (bootstraped by CRA)

I started VSC with the project root, because there will be a server folder later, all in one IDE :D
I think for the plugin I use, I need to specify the path when the .eslintrc is not at the root but another level. :D

@ianschmitz
Copy link
Contributor

Right makes sense. It probably wants to know where to search for TS configuration and node_modules. Sounds like we can close this then?

@lock lock bot locked and limited conversation to collaborators Dec 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants