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

no-unused-state skips wrapped Components #2251

Closed
kevlened opened this issue Apr 25, 2019 · 2 comments · Fixed by #2712
Closed

no-unused-state skips wrapped Components #2251

kevlened opened this issue Apr 25, 2019 · 2 comments · Fixed by #2712

Comments

@kevlened
Copy link

kevlened commented Apr 25, 2019

eslint v5.15.1
eslint-plugin-react v7.12.4

import {Component} from 'react';

class Working extends Component {
    state = {
        // Unused state field: 'dummy'
        dummy: null
    };
}

const wrap = x => x;

wrap(class NotWorking extends Component {
    state = {
        // No error
        dummy: null
    };
});
@ljharb
Copy link
Member

ljharb commented Apr 25, 2019

looks like component detection is missing this case.

cc @alexzherdev

@AlokTakshak
Copy link

Is it Still open?
if yes i would like to work on it.

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

Successfully merging a pull request may close this issue.

3 participants