-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[TypeScript] Phase 1 #3267
[TypeScript] Phase 1 #3267
Conversation
// @ts-expect-error something is wrong here, ultimately these types come from https://nodejs.org/api/util.html#util_util_inspect_object_options and `date` doesn't appear to be one of the options. | ||
date: false, |
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.
Continuing from: dimitropoulos#7 (comment)
@reynolek @dimitropoulos these options come from https://github.com/unjs/consola/blob/4477e87a5153d31d22a2692565959d90599a6b61/src/reporters/fancy.js#L9-L16. The exported TS types appear to be incorrect here
@@ -9,13 +9,13 @@ | |||
}, | |||
"homepage": "https://github.com/kong/insomnia#readme", | |||
"scripts": { | |||
"lint": "eslint . --ext .js,.json", | |||
"lint": "lerna run lint --parallel --stream", |
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.
I understand that linting in parallel might be faster but duplicating the lint
script across all packages seems unnecessary/impractical when it comes to making a change and having to remember to update all lint scripts to keep them aligned.
I'm curious to understand your thought process behind making this change (if it's documented somewhere please point me to it). Is it so that each package can operate as a single/standalone entity?
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.
I did this because it seemed like an error to be honest. it's a quite significant amount of time, and, afterall, the thing that ultimately runs this is the CI. It was changed while splitting the typechecking step out on the CI. More than happy to consider it out of scope and change it back if you'd like - lemme know.
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.
Just thinking out loud after our verbal convo - how do other lerna projects handle this? A single eslint call at the root, or individual ones in each package?
If we have eslintignore in each package now, I think we should be able to remove it from the root altogether because IDEs should correctly load from the appropriate package (right?)
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.
predominantly (from my looking-around during Phase 0): they just use yarn. EDIT: I misunderstood your question. They predominantly do something similar to what we had before, but it doesn't work for us right now from the root because different packages use different parsers and you can only have one parser per running eslint instance. One way or the other, this is fairly optimal for us because it can do it multi-threaded this way so there's no reason I can see to remove it.
re: .eslintignore at the root: we can drastically reduce it, yes, but it will likely need to stay since, after all, there are still files at the root (including the root eslint config itself) that eslint checks.
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.
different packages use different parsers
I'm not sure I follow here 🤔 Wouldn't they all use @typescript-eslint/parser
(at phase 2/3)?
One way or the other, this is fairly optimal for us because it can do it multi-threaded this way
For performance, yes I agree but that's at the cost of misdirection where .eslintrc.js
is defined at the root, but .eslintignore
is defined per package 😅
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.
They will use the same parser by phase 2, but this is only a PR for phase 1.
Re: .eslintignore
I'm not sure I see the downside of having individual .eslintignore
s wherever we need them. This keeps the packages more isolated from each other, which is ideal in a monorepo because it means that there's that much less you have to know about the other packages in order to examine a specific one.
ff92713
to
c52ae3b
Compare
c52ae3b
to
cad0293
Compare
cad0293
to
dd62dfd
Compare
dd62dfd
to
34bc746
Compare
34bc746
to
4d983bb
Compare
"package.json" | ||
|
||
], | ||
"exclude": [] |
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.
Does this need to explicitly exclude bin
? When I run build insomnia-importers
, the bin/cli
file gets updated
closing this PR, as #3370 contains this PR's code as well as (almost all of) Phase 2's work. |
This ticket implements Phase 1 of the TypeScript conversion: #3266
The following PRs were "pre-reviews" of all of the work contained in this PR.