-
-
Notifications
You must be signed in to change notification settings - Fork 2.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
docs(website): display count on error tab in playground #8643
docs(website): display count on error tab in playground #8643
Conversation
Thanks for the PR, @developer-bandi! typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community. The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately. Thanks again! 🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. |
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #8643 +/- ##
==========================================
+ Coverage 87.21% 87.38% +0.17%
==========================================
Files 251 254 +3
Lines 12305 12489 +184
Branches 3880 3919 +39
==========================================
+ Hits 10732 10914 +182
- Misses 1303 1304 +1
- Partials 270 271 +1
Flags with carried forward coverage won't be shown. Click here to find out more. |
Hi @developer-bandi, Looks like a good start! I haven't dug deep into the website code, so I'm commenting based on the behavior shown in the preview.
As written in the issue, the intent of this enhancement was to recognize that an error occurred on a particular tab even when it was not selected. 2024-03-12.2.05.15.mov |
thank you for review!. I understand the intend of the issue. and i suggest the addtional ui to resolve that request. The UI that shows error count is maintained, and when an error occurs, a warning icon is displayed next to the code, eslintrc, and tsconfig tabs. If you look at the image, it looks like this: this method seems clearer than exposing the number of errors when you click on another tab even if no error occurs. What do you think? |
I temporarily added code to reflect the previous comment. (There is an issue with the setMarkers type that could not be resolved, but it is not important for now.) The current issue is that when entering the playground using a URL with a query containing code information, the warning display is only visible in the first code tab, and subsequent tabs must be activated to activate the warning display. In order to accomplish this, the Monaco library needs a way to create markers in advance for the code, tsconfig, and eslintrc codes included in the query, but it is difficult to find a way because I am not familiar with the Monaco editor library. Could you please help me with this? |
add fix commit. when go to playground with code, tsconfig, eslintrc code with query, error mark is evoke first time. |
currently sadly there is no way to retrieve errors from other "files", they are not flushed when you change tab
sadly thats not really possible as is, as files are not mounted and validated, and they are created only when you actually set "model" as active.
you can treat model as kind of file that can be loaded and unloaded from editor word of caution, we are not using monaco that is installed in project, and we are using it only for types, and we are not always using same version as each version of typescript defines its own editor, remmember to check on different supported ts version :) we should definitly define some state manager for errors, files and all other stuff as amount of properties that we are passing back and forward is slowly getting oo hand |
@yeonjuan According to the answers above, it doesn't seem possible to expose an error when the tab is not selected. Therefore, it seems better to close this mr or to expose the number of errors in the tab to the errros tab as was initially implemented. What do you think?
@armano2 I'm not sure if my understanding of the last sentence is correct. From what I understand, the state in the playground below is not managed, so state management is being introduced using state management libraries such as zustand and redux or context API. Is this correct? typescript-eslint/packages/website/src/components/Playground.tsx Lines 27 to 46 in 4d6d0d5
I understand that this work will not be carried out in this pr, but I am asking this question because I think it would be good to know properly! |
IMO, It's good to just show the number of errors. But I'd love to hear from typescript-eslint members. |
Yeah 👍 I'd rather get some improvement for now, even if it's not the ideal state. Either way we'll end up with followup issues filed for future refactors. |
Based on the summarized opinions, I have modified it so that only the number of errors occurring in the current tab can be checked. |
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.
Looks great to me, thanks! ✨
Just a small thing to touch up, nothing major on my end. Will re-request review from other Josh too.
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.
Thanks! ✨
6f30ac3
into
typescript-eslint:main
PR Checklist
Overview
As if raising an issue, make error count view in playground
In my opinion, there is no great meaning in indicating all the number of errors, and it is not neatly displayed in the UI, so errors with more than 9 are indicated as 9+.