Skip to content

[New] no-unused-state: Support ignore option #3881

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

fwgood
Copy link

@fwgood fwgood commented Jan 16, 2025

This is adding a new property ignore to ignore specific state.

@fwgood fwgood closed this Jun 27, 2025
@ljharb
Copy link
Member

ljharb commented Jun 27, 2025

Sorry this fell through the cracks. Can you elaborate a bit more on the problem this will solve?

@ljharb ljharb reopened this Jun 27, 2025
@fwgood
Copy link
Author

fwgood commented Jun 28, 2025

Sorry this fell through the cracks. Can you elaborate a bit more on the problem this will solve?

@ljharb I'm very glad that you can reopen this PR.

In some React frameworks that use JSX, certain specific states are defined for internal rendering purposes (such as marking rendering stages, measuring performance, etc.). There is a similar usage pattern where the state is not consumed by the developers but is consumed by the framework internally. In this case, an ignore rule is needed (the usage of links uses hooks, which is different from class-based states, but the principle is similar). https://lynxjs.org/guide/performance/evaluating-performance.html

@ljharb
Copy link
Member

ljharb commented Jun 28, 2025

I'm not familiar with Lynx but this is eslint-plugin-react - it's intended for use with a react codebase, not any jsx codebase.

Unfortunately that link doesn't explain the use case to me - but it doesn't make sense to me that you'd declare state that you don't personally set - if the framework is assigning state, it should be declaring it.

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

Successfully merging this pull request may close these issues.

2 participants