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

Definition for rule 'react/static-property-placement' was not found #2249

Closed
epodivilov opened this issue Apr 24, 2019 · 7 comments
Closed

Comments

@epodivilov
Copy link

When I try to use static-property-placement rule, I get the following error

Definition for rule 'react/static-property-placement' was not found

Use like this

...
"react/static-property-placement": 2
...

Version in package.json

"eslint": "^5.16.0",
"eslint-plugin-react": "^7.12.4",

In node_modules no file with the description of this rule, but in github this file exist - static-property-placement.js

Is this some kind of mistake or has this rule not been released yet?

@ljharb
Copy link
Member

ljharb commented Apr 24, 2019

It's not been released yet. Check the docs on the latest tag, not on master.

@ljharb ljharb closed this as completed Apr 24, 2019
@nzvtrk
Copy link

nzvtrk commented Apr 29, 2019

Can you notice about that in readme.md and rules/static-property-placement.md ?

@ljharb
Copy link
Member

ljharb commented Apr 29, 2019

@nzvtrk since that’s how every GitHub project works (master can always be potentially unreleased), and since doing so would be a burden since we’d have to remove that notice for every tagged release, no.

@lostm1nd
Copy link

lostm1nd commented Jun 5, 2019

This rule seems not to work for me in version 7.13.0.
I have the following config for it:

"react/static-property-placement": [
      "error",
      "static public field"
    ]

but no error is shown
image

@ljharb
Copy link
Member

ljharb commented Jun 5, 2019

@lostm1nd that code has defaultProps as a static public field - what error would you expect?

@lostm1nd
Copy link

lostm1nd commented Jun 6, 2019

@ljharb my bad. I was misled by the name to think it will enforce placement inside class bodies but now I saw it states otherwise.
Any suggestion how to get the static field at the top of the class?

@ljharb
Copy link
Member

ljharb commented Jun 6, 2019

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

4 participants