-
-
Notifications
You must be signed in to change notification settings - Fork 26.9k
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
How to hide unwanted warning #2070
Comments
If you click on it you will see the callsite stack. Clicking on each item will show the source for each stack frame, so you can see where it is coming from.
Why do you want to hide those warnings? For example, you could fix If you insist on ignoring them, the terminal prints a hint on how to do it. I hope this helps! |
Interesting, chrome should be picking up on your sourcemap and give you the real locations. |
I’m not sure what exactly you are asking. If you click on those links, one of them will be a component (probably a third party one). File an issue with the repository of this component, and somebody will fix it and release an update that doesn’t rely on This warning is also not urgent, and you can ignore it. It’s only here to prepare you for React 16 release. |
Hey @gaearon , while I like having the eslint warnings while linting, I don't really like them littering the chrome console. The reason being is that I often want to console log stuff to the chrome console and it always seems like I have about 10 of those warnings in the way (even if I do clean them up after). Is there a way to make it so they just don't get output to the chrome console? Seems like this should be an easy option to tweak. Thanks! |
We cap warnings in the console by five files maximum. Can you explain more about your use case of developing with many warnings? What kind of warnings are you seeing? Why are you ignoring them in development? |
Hey @gaearon, Okay, an example that happens all the time is that I'm editing a file and making changes, maybe commenting out a part of the code I think might be at the root of some issue. This might cause several "unused variable" warnings. I don't immediately want to fix those warnings because I'll likely comment back in the code in a second once I've determined what the issue is. Everything is fine so far, but once I want to simultaneously console log some variable, the chrome warnings become very annoying. I am sure other people are experiencing this because it is a common complaint of my coworkers as well. The errors still show up in the terminal (which I like better because it doesn't get in the way of my console logs and I can actually click on the line in question and hop over to my editor and fix it) and I can still enforce that linting passes before allowing commits/PRs to be merged. It doesn't seem too tough to allow for people to optionally turn these off. Can we do it? Thanks! |
Can you show me a screenshot of this in practice?
No. We don't do this because instead of fixing the problem it just introduces an obscure configuration flag that most people don't know about. We can either fix it for everybody, or not fix it at all. I want to better understand what the problematic case looks like (a screenshot) so that I have a better idea of how to fix it for everybody. |
Clearly there are other unused var issues that arise from us not always fixing these eslint warnings right away (usually because we are commenting out something that is in development). While it definitely could be argued that we should just fix those issues before pushing any shared code, often it doesn't make sense to do so if it is a feature that will be added back in eventually. Does that help you understand more where these linting warnings are coming from? |
I'm not sure I agree with that statement. This doesn't seem like something that can be "fixed" for everybody. It seems like it is a feature that some people might want and others might not want. In my case, I like the terminal lint warnings, but I don't like the chrome lint warnings. For another person they might like both, or vice-versa. Having an option to suppress the chrome lint warnings would make me happy :) Thanks! |
Hey @gaearon I just upgraded to the most recent version and see that these warnings are now limited to 5 like you said: So that should solve my issue. Thanks! |
That’s why I said it‘s better to fix for everyone 😉 There were two different issues: noisy bad output (which we fixed) and lack of limits (which we also fixed). |
Also, the "definition for rule was not found" warnings are related to something being wrong in your |
Once you fix that you might see more noisy warnings (since each file has more than one warning). I'm happy to discuss this in a separate issue. For example we could only show warnings in the Chrome console for most recently edited file. I'm not sure if it's possible but happy to have someone look into it, if you're interested! |
I filed #2378 as next step to improve this. |
Second this. There's times where I'm dropping gear and working across a number of files, and all I want to see in the chrome output is my console output. Having a limiter here would uber convenient (and a few engineers from various teams I've worked with agree) |
@dwelch2344 Could you clarify, what sort of warnings are you seeing there? |
@gaearon Is there still no way to disable all the Example:
Disabling this would be very useful |
Same problem here. By default when I'm working on components, I have a bunch of core imports at the top that I may or may not use while developing, and then clean up later. I don't want to remove these essential imports just because I haven't used them yet at this stage of developing a component/screen. However, my console is then getting spammed with:
|
If you dont want to see those warnings add the "mode" flag on the command here is how I do it : hope this helps 👍 @brunomiyamotto |
You can disable warnings coming as error in following way: For webpack 4 and later : For older webpack : |
@pranavq212 @brunomiyamottol any ideas if I'm using create-react-app?
|
@dancherb make sure webpack is installed by npm. |
@pranavq212 had a go and it seems like there's extra steps required besides what CRA gives you out of the box:
|
Just add this to ur index.js |
@brunomiyamottol What do I add in create react app? Just adding |
How to hide the yellow block warning from webpack?
I'm not using PropTypes in my app so I guess the first red warning is from npm package,but how to know which package using this?I thought it's not a clear warning.
The text was updated successfully, but these errors were encountered: