Skip to content
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

Cannot get react/state-in-constructor working #2162

Closed
karolisgrinkevicius-home24 opened this issue Feb 13, 2019 · 4 comments
Closed

Cannot get react/state-in-constructor working #2162

karolisgrinkevicius-home24 opened this issue Feb 13, 2019 · 4 comments

Comments

@karolisgrinkevicius-home24

Using ... I'm always getting the following error

1:1 error Definition for rule 'react/state-in-constructor' was not found react/state-in-constructor;

My .eslintrc file currently is as follows:

{
  "parser": "babel-eslint",
  "extends": [
    "eslint:recommended",
    "plugin:react/recommended"
  ],
  "plugins": ["react"],
  "parserOptions": {
    "sourceType": "module",
    "ecmaFeatures": {
      "jsx": true
    }
  },
  "rules": {
    "react/state-in-constructor": 2
  },
  "env": {
    "browser": true,
    "es6": true,
    "node": true,
    "mocha": true,
    "jest": true
  }
}

Version of dependencies are:

├── eslint@5.13.0
├── eslint-plugin-react@7.12.4
└── react@16.8.1
@sashapwc
Copy link

Same here. It's not in the list of rules when you go to the documentation on npm. Looking at the commits, the merge seemed to fail a test on Jan 20 so maybe that is part of it

@ljharb
Copy link
Member

ljharb commented Feb 14, 2019

That particular rule was merged in #1945, only 24 days ago, and has not yet been released to npm.

Thus, you can't enable a rule that doesn't yet exist in a released version.

@ljharb ljharb closed this as completed Feb 14, 2019
@karolisgrinkevicius-home24
Copy link
Author

@ljharb when are you going to release it on npm?

@ljharb
Copy link
Member

ljharb commented Feb 14, 2019

There's no timeline; when a maintainer has time to do so. In this case, it'll be a minor, so I'll also look through the open PRs and make sure there's no new features or bugfixes that need merging first.

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

No branches or pull requests

3 participants