Skip to content

Only show lint warnings from most recently edited file in browser console #2378

Open

Description

@gaearon

This came up in discussion in #2070 (comment).
Seems like a sensible thing to do, although I'm not sure how hard it would be.

Tagging as good first bug but I don't have any ideas on how to do it.

Activity

  1. siggirh commented on May 29, 2017

    @siggirh

    I'm wondering if this helps with the complaint from tnrich in that linked thread. If the developer is commenting out stuff or w/e, saving and looking back to the browser - the changes (and thus, the output that annoys him) is going to come from that last edited file. Aren't those errors the ones he doesn't want to see in the console?

  2. gaearon commented on May 29, 2017

    @gaearon
    ContributorAuthor

    We can cap it to maximum 5 warnings per file, for example. They would still be there but they would be more relevant, and limited.

  3. siggirh commented on May 29, 2017

    @siggirh

    Wouldn't that be confusing if you have more than five and are only displaying five of them? As in, wouldn't capping the number defeat the purpose of having them there in the first place? I guess my pondering is whether displaying the linting errors in the console is to let the user know that he HAS errors or that he has these EXACT errors. I'm wondering if we should leave this alone and let it stay as is :)

  4. gaearon commented on May 29, 2017

    @gaearon
    ContributorAuthor

    We can debate whether to cap them or not, but I think displaying them just for most recently edited file is a good start by itself.

  5. svicalifornia commented on Aug 14, 2017

    @svicalifornia

    @gaearon @kombucha Has the commit referenced above been merged into the official CRA trunk?

  6. kombucha commented on Aug 16, 2017

    @kombucha
  7. gaearon commented on Aug 17, 2017

    @gaearon
    ContributorAuthor

    Not yet. We'll do a cleanup pass some time after releasing React 16. For now most of my effort is focused on React.

  8. stale commented on Nov 2, 2018

    @stale

    This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 7 days if no further activity occurs.

  9. added this to the 2.x milestone on Nov 2, 2018
  10. svicalifornia commented on Nov 5, 2018

    @svicalifornia

    @gaearon Now that React 16 and CRA 2 are out, can we revisit this issue?

  11. modified the milestones: 2.x, 3.x on Mar 10, 2019
  12. roramigator commented on Sep 13, 2020

    @roramigator

    Is this being worked on?

  13. liesislukas commented on Aug 27, 2021

    @liesislukas

    can we just have an option to disable eslint console logs and that's it? I use eslint in IDE setup, it's logging stuff on terminal, errors are shown full screen, during build it logs errors on build machine and stops the production build if there are issues but polluting console with all those warnings is just a mess in my case. I need those warnings in IDE to highlight potential issues, but mostly i don't care about that warning. I use eslint to warn about sketchy code and throw errors about code which is potentially broken or may be broken in some case.

    Could be an option to enable eslint
    logs in console - all | warning | error | none
    in cli - all | warning | error | none

    and default is whatever is now, but there would be a way to disable.

    and whatever extras like "recent file only" "limit to 5 warnings per file" and so on are just extension on main options - to log or not to log those warning at all

  14. mrkev commented on Sep 3, 2021

    @mrkev

    Huge +1 to @liesislukas. I tried to configure my webpack config through react-app-rewired to disable warnings on hot reload without much success. I wonder if this is because react-dev-utils uses its own webpackHotDevClient.

    From what I've seen, people in my team interact with lints in the editor first, the "Problems" tab on VSCode second and the terminal third— not the browser. I don't doubt this might be useful for some people, but for us it in fact detrimental, since we do a lot of our debugging via console logging.

    Rather than blocking a solution on the harder problem of filtering by recently-edited files, some immediate impact for many teams like mine would be an environment flag or some other mechanism to disable warnings in the browser outright.

    I'm so slowed down by this I'd be happy to add a flag for disabling the relay of warnings. Where can I learn about the HMR system and how to disable warnings @gaearon?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions