Skip to content

eslint ignores variables named status #1834

Closed
@sidoshi

Description

@sidoshi

Can you reproduce the problem with latest npm?

yes. npm version: 4.1.1

Description

Linter ignores status variable name when checking for unused vars.
Not sure if this is a bug or expected behaviour.

Expected behavior

It should probably warn when I have not declared a variable named status and have this line of code:
console.log(status)

Actual behavior

Even though I have not declared any variable named status,
using it does not show any warning or errors.
it shows no-undef error on all other variables names like statuss as expected

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts (if you haven’t ejected): 0.9.0
  2. node -v: v7.7.1
  3. npm -v: 4.4.1

Then, specify:

  1. Operating system: Linux, Deepin
  2. Browser and version: any

Reproducible Demo

create a new app with:
create-react-app test-app
In index.js type: console.log(status)
It won't show any error that status is not defined but changing the variable name to statuss would show error as expected

Activity

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

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions