Skip to content

Turn some of the linter messages into errors #498

Closed
@andreypopp

Description

@andreypopp

I think it would be useful to have some of the linter messages to be errors instead of warnings.

For example:

  • no-undef (used undefined variable)

Sometimes I don't pay attention to lint warnings and then only see errors when they happen at runtime.

We could also format lint errors in a similar fashion babel loader reports, including code frame with location.

Activity

gaearon

gaearon commented on Aug 26, 2016

@gaearon
Contributor

Sometimes I don't pay attention to lint warnings

Are there any lint warnings in CRA that you don’t pay attention to?
We tried to err on the side of only picking lint warnings that represent actual errors in 95% cases.

andreypopp

andreypopp commented on Aug 26, 2016

@andreypopp
ContributorAuthor

Are there any lint warnings in CRA that you don’t pay attention to?

Yes, no-unused-vars for example. It is pretty useful but doesn't prevent my code running so I don't bother fixing it while prototyping. Of course I still want it to be reported as I want to fix it before commit, for example.

gaearon

gaearon commented on Aug 26, 2016

@gaearon
Contributor

Can you compile a list of which warnings you’d rather see as errors?

andreypopp

andreypopp commented on Aug 26, 2016

@andreypopp
ContributorAuthor

Can you compile a list of which warnings you’d rather see as errors?

Probably just no-undef for now as I validated it through my workflow. Not sure about others for now.

gaearon

gaearon commented on Aug 26, 2016

@gaearon
Contributor

Send a PR please?

added this to the 0.4.2 milestone on Sep 17, 2016
added a commit that references this issue on Sep 17, 2016
8b35116
added a commit that references this issue on Sep 17, 2016
feae8f0
gaearon

gaearon commented on Sep 18, 2016

@gaearon
Contributor

This should be fixed in 0.4.2.
Please verify!

andreypopp

andreypopp commented on Sep 18, 2016

@andreypopp
ContributorAuthor

Works well, thanks!

Btw. love how it is easy to upgrade to the new version—just npm install you get new features!

gaearon

gaearon commented on Sep 18, 2016

@gaearon
Contributor

🍰

added a commit that references this issue on Oct 25, 2016
afa051c
locked and limited conversation to collaborators on Jan 22, 2019
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

        Participants

        @andreypopp@gaearon

        Issue actions

          Turn some of the linter messages into errors · Issue #498 · facebook/create-react-app