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

chore(v2): fix eslint TS setup #2949

Merged
merged 9 commits into from
Jun 18, 2020
Merged

chore(v2): fix eslint TS setup #2949

merged 9 commits into from
Jun 18, 2020

Conversation

slorber
Copy link
Collaborator

@slorber slorber commented Jun 16, 2020

Because we need a specific parser for TS integration, otherwise TS constructs like !, as, as const etc are not understood correctly.

in my IDE I get a lot of errors such as:

image

And due to these parsing errors, eslint is unable to check the rest of the files.

BTW, the yarn lint command actually does not lint TS files ^^ eslint --cache "**/*.js"

Now I can see all the lint errors 🤪

image

@slorber
Copy link
Collaborator Author

slorber commented Jun 16, 2020

@yangshun not to merge now, because there are a few rules we could disable and configs to rework, otherwise people will likely be blocked

@slorber slorber marked this pull request as draft June 16, 2020 18:07
@docusaurus-bot
Copy link
Contributor

Deploy preview for docusaurus-2 ready!

Built with commit 3b481f3

https://deploy-preview-2949--docusaurus-2.netlify.app

@docusaurus-bot
Copy link
Contributor

docusaurus-bot commented Jun 16, 2020

Deploy preview for docusaurus-2 ready!

Built with commit a07f6a6

https://deploy-preview-2949--docusaurus-2.netlify.app

@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label Jun 16, 2020
@slorber slorber added the pr: maintenance This PR does not produce any behavior differences to end users when upgrading. label Jun 17, 2020
@slorber slorber changed the title refactor(v2): eslint: use TS parser chore(v2): fix eslint TS setup Jun 17, 2020
@slorber slorber requested a review from yangshun June 17, 2020 17:59
@slorber slorber marked this pull request as ready for review June 17, 2020 17:59
@slorber slorber requested a review from lex111 as a code owner June 17, 2020 17:59
@slorber
Copy link
Collaborator Author

slorber commented Jun 17, 2020

Hey,

To fix the current eslint setup for TS, I had to disable (warn instead of errors) multiple rules.

I fixed some non-intrusive issues (like FB headers) but not all of them to avoid git conflicts for now.

There are 35 possible fixes with the --fix option. I didn't apply those fixes yet but if people commit those files, the --fix will be applied at commit time so it may produce less git conflicts

I think it can be a good MLH issue to re-enable some rules that I had to disable, by manually fixing remaining errors one by one.

@yangshun
Copy link
Contributor

All the CI checks are failing though :/

@slorber
Copy link
Collaborator Author

slorber commented Jun 18, 2020

Yes, was trying to fix that :D

Actually found the reason.

TIL about https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html ^^

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: maintenance This PR does not produce any behavior differences to end users when upgrading.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants