Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Community Feedback: Experimental Project Service APIs#8030
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Back inRelative TSConfig Projects with
The module.exports = { // ... parser: '@typescript-eslint/parser', parserOptions: {- project: true,+ EXPERIMENTAL_useProjectService: true, tsconfigRootDir: __dirname, }, // ...}
As with any big new API, there's only so much testing we can do on our own without the community.Please try out the project service API and post back here with how it goes for you! We'd love to know: does it indeed solve those configuration and/or performance problems for you? Are there any bugs? Was it a smash success? Any and all posts about how it goes are welcome! |
BetaWas this translation helpful?Give feedback.
All reactions
Replies: 7 comments 23 replies
-
FYI: I tested it in |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1🚀 1
-
Linking for reference:babel/babel#16192 - thanks for posting! |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1
-
I tried it out on a personal project (.eslintrc.json,tsconfig.json) and the lint time increased from 31 seconds to 34 seconds. (Using @typescript-eslint/eslint-plugin 6.17.0.) Is there any logging I can enable? For example, to see if the same service is used for all files? |
BetaWas this translation helpful?Give feedback.
All reactions
😕 1❤️ 1
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Giving this the ❤️ reaction as I'm enthused you're trying it out... and the 😕 reaction because I'm sad it's slower on your end. Darn. Though, I tried a direct clone -> Measurements from
Note that |
BetaWas this translation helpful?Give feedback.
All reactions
-
Oh, and I filed#8189 to track adding docs for logging info. That issue has some more info in it on the |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Thanks Josh! I've tried again with this hyperfine"./node_modules/.bin/eslint --ignore-path .gitignore --max-warnings 0 --ext ts,js,cjs ./dev-esbuild ./dev-node-loader ./dev-node-suppress ./dev-pnpm-test ./lib-collection ./lib-concurrency ./lib-error ./lib-hex-ts ./lib-payload ./lib-random ./lib-stream ./lib-style ./lib-test ./lib-time ./lib-widget ./svc-auth-guest-read ./svc-auth-guest-view ./svc-gateway-guest-run" Setup:
This is a more positive result. Switched my repo over to What I previously saw as "34 seconds" was definitely user CPU time (nice that hyperfine reports this too), not total time, sorry for the confusion! I got lots of logs with |
BetaWas this translation helpful?Give feedback.
All reactions
-
🙌 Love that you're asking this! At this point your best bet is probably to search for |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I tried this out onmy monorepo viathis commit, but I got this error:
For reference, the CI run is here:https://github.com/IsaacScript/isaacscript/actions/runs/7415844579/job/20179746969 |
BetaWas this translation helpful?Give feedback.
All reactions
-
Ah that's misconfigured: it's not |
BetaWas this translation helpful?Give feedback.
All reactions
-
Ok. Can you edit the OP to clarify the +- instructions? That's what I was going off of. |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
-
I tried this out viathis commit, but I got this new error:https://github.com/IsaacScript/isaacscript/actions/runs/7431948579/job/20223198672 |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Aha! Thanks for mentioning. This is#8206: the project service doesn't(yet?) provide a I'm surprised I hadn't yet filed an issue for this. It's been on the back of my mind for a while... adding the issue to the |
BetaWas this translation helpful?Give feedback.
All reactions
-
Latest release (v7.8.0) gave me: "Too many files (>8) have matched the default project." See:https://github.com/tstyche/tstyche/actions/runs/8893774897/job/24420694811 This is GHA failure. I think it is worth taking a look at it, because the error is somehow strangely constructed (it grows and grows and grows ...) Hard to read the message, but looks like all files in the repo are reported as belonging to the default project. Hm.. That sounds incorrect. There should be none. I was using |
BetaWas this translation helpful?Give feedback.
All reactions
-
I also think the default value of |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
@black7375 why? Could you provide more information? Saying you disagree without giving reasoning is not very useful for us in considering a new default. In our opinion of you're using the default program for more than 8 files you're doing it wrong and will be causing a performance impact for your lint run. The option is there to cover a few config files - not for anything more. Which is why we banned wide globs from the option. |
BetaWas this translation helpful?Give feedback.
All reactions
-
I use a split screen on a wide monitor (two by default) |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I'm not quite sure what you're talking about here. The option and the value It's the number of files we allow you to cover with the default program - I.e. Files not covered by a |
BetaWas this translation helpful?Give feedback.
All reactions
-
I was completely misunderstanding it - it didn't appear when I opened a small number of files, but when I opened a large number of files, the error appeared in the editor and I thought it meant the number of files opened. |
BetaWas this translation helpful?Give feedback.
All reactions
👍 1
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Hi@JoshuaKGoldberg (and thanks for your work on typescript-eslint I tried this, using v8-alpha.20, on an Angular project, and saw some differences between Basically, typesript-eslint doesn't pick the correct tsconfig for linting the files when using I suspect this is an issue with the underlying APIs, as we saw the same thing in our IDEs (VS Code or Webstorm), so maybe there is nothing to do for typescript-eslint. Or maybe I missed an obvious configuration to add somewhere, so I thought it was worth a shot. As a minimal repro, I pushed this repo (without Angular, just 2 typescript files):https://github.com/cexbrayat/tseslint-config-repro
You can run:
to see the failure. |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
I haven't run the code - but my basic understanding would have been that TS will pick the |
BetaWas this translation helpful?Give feedback.
All reactions
-
Yup,@bradzacher is right - tseslint is going with the proper behavior here. The root Does that all make sense and sound reasonable to you@cexbrayat? I wonder if we'll want to add this to the troubleshooting docs as part of#9085... |
BetaWas this translation helpful?Give feedback.
All reactions
-
Thank you for taking the time to look into it@bradzacher and@JoshuaKGoldberg |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1
-
Hey, what are the default values of |
BetaWas this translation helpful?Give feedback.
All reactions
-
Ah good note, these aren't explicitly called out inhttps://typescript-eslint.io/packages/parser#projectserviceoptions. But they're both Note also#9807 for suggesting setting |
BetaWas this translation helpful?Give feedback.
All reactions
❤️ 1
-
Hi! I'm forwarding this question from project service API: import-js/eslint-import-resolver-typescript#282 (comment)
Which was asked in answer this question of mine concerning
|
BetaWas this translation helpful?Give feedback.
All reactions
-
Hmm, I don't know what information we could provide here that would be useful to you. We don't maintain |
BetaWas this translation helpful?Give feedback.
All reactions
-
Yeah there's nothing special about the project service - that's our side of the fence. On the 3rd party side the thinking is just in terms of non-type-aware / pure syntactic rules vs type-aware rules. Right now These are probably the mode relevajt docs: |
BetaWas this translation helpful?Give feedback.
All reactions
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
-
Thank you for the answer. I have to say this area goes a bit over my head, I was mostly wondering ifhttps://github.com/import-js/eslint-plugin-import &https://github.com/un-ts/eslint-plugin-import-x could use a similar approach as typescript-eslint to find the tsconfigs instead of having to do: {"settings": {"import-x/resolver": {// Updated to import-x"typescript": {"alwaysTryTypes":true,"project": [// Could this be `"project": true` or use the project service ?"tsconfig?(.*).json",// From our Angular preset"projects/*/tsconfig?(.*).json","*/tsconfig?(.*).json"// For example: e2e/tsconfig.json ] } } }} But I don't myself know or understand exactly what for and how they use that config. I've transferred this answer to the developper. I also just found back the following discussion which is relevant:un-ts/eslint-plugin-import-x#40 (comment) |
BetaWas this translation helpful?Give feedback.