-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Convert LSP packages to TS (WIP) #957
Conversation
d137731
to
6878d7c
Compare
package.json
Outdated
"lint-check": "eslint --print-config .eslintrc.js | eslint-config-prettier-check", | ||
"check": "flow check --show-all-errors", | ||
"prepublish": "node resources/prepublish.js", | ||
"pretty": "node resources/pretty.js", | ||
"pretty-check": "node resources/pretty.js --check", | ||
"version:release": "lerna version", | ||
"version:prerelease": "lerna version --conventional-prerelease", | ||
"version:prerelease": "lerna versiton --conventional-prerelease", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple comments; since it's WIP I'll stop here.
packages/graphql-language-service-interface/src/GraphQLLanguageService.ts
Outdated
Show resolved
Hide resolved
packages/graphql-language-service-interface/src/__tests__/getDefinition-test.ts
Outdated
Show resolved
Hide resolved
another big commit on the way, down to about 52 compilation errors across all the packages! |
- added fix and comment for new failing tests - added assertions for new tests for Jest - switched back to global jest run, 12.8s for all but codemirror! woo! - make sure mocks arent being built by babel as well (fixes warning)
ac5c875
to
427f27c
Compare
oh so this weekend it was fully compiling, tests are mostly working too, just having an issue with the typescript and babel eslint parsers butting heads. We will probably have to execute the eslint bin twice. Theres actually an entire repo devoted to this issue. So this won't be complete until all the tooling supports both flow and typescript! @Neitsch if you wanted to finish/polish up be my guest! |
@acao I was handling this same problem in the Graphile codebase on Monday; I've managed to make ESLint, Flow and TypeScript play fairly well together. Here's my ESLint config in case it helps: One thing of note is that you cannot do |
Thanks @benjie - with that in hand it was super easy to resolve the lint errors. Let's see what travis has to say :) |
Awesome @Neitsch I'm glad it was helpful. It certainly took me a little while to get it working smoothly! CI: looks like there's issues resolving the packages (yarn workspaces should have handled this for us?) |
damn @benjie thanks for that babel eslint + ts eslint parser solution! i spent a few hours flummoxed on that. maybe we should let this poor soul know because they have a whole repo devoted to trying to resolve this issue. |
also, thanks y'all in general for the save! please don't wait for me if you want to carry this to completion. also @rebornix on dischord from vscode might be able to give a review for this or later iterations to point out which official vscode types we might be able to leverage, reducing redunancies and making us more standard adherent i think? |
also @orta what do you think? i used |
@@ -0,0 +1,321 @@ | |||
/** |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
noting the path for these files wasn't rewritten, and there really weren't that many changes. not a huge deal also not ideal, ope
packages/graphql-language-service-interface/src/__tests__/GraphQLLanguageService-test.ts
Outdated
Show resolved
Hide resolved
@acao - I was able to resolve the flow type issues, but tests are failing now. Do you have any idea what could be going wrong here? |
@Neitsch I’m hoping to have time to look tomorrow, looks like some typescript errors from the tests themselves? Were these working before? |
@acao - it looks like these errors are stemming from |
@Neitsch try this in the jest config: projects: ["packages/*"] so that the downstream subpackages become the baseDir and their tsconfigs are picked up. Last time I had issues like this, this resolved quite a few of them. Esp in situations where the ts compile works fine, but then suddenly ts jest is throwing a bunch of typescript compilation errors. There might be a little bit more fine tuning too. I really hope I have time to look at this and the accessibility PR tonight but it all depends on whether a soon to be ex roomate decides to get around to cleaning out their stuff tonight, unfortuantely it seems very unlikely at this point. |
Codecov Report
@@ Coverage Diff @@
## master #957 +/- ##
=========================================
- Coverage 33.78% 27.3% -6.49%
=========================================
Files 79 64 -15
Lines 3481 2641 -840
Branches 752 566 -186
=========================================
- Hits 1176 721 -455
+ Misses 1814 1503 -311
+ Partials 491 417 -74
Continue to review full report at Codecov.
|
sadly, had to do a merge commit, because there were other merge commits in the master branch upstream. If we stop doing merge commits then we can rebase much more easily! |
we are using eslint 6.4 now in master: in this branch we still have 5.16.0 after i merged remote in?: Line 56 in ea78946
something funky here |
CI is failing. Would you mind updating the yarn lockfile? |
@Neitsch unfortunately its more than updating the lockfile, if you see the erroneous eslint warnings above, shows that |
I don't know where exactly in this PR it happened, but I would strongly prefer to keep trailing commas around! Either way, awesome that it's finally merged! |
graphql-language-service-utils
graphql-language-service-types
graphql-language-service-parser
graphql-language-service-interface