Understand the rules. You can trick the linter into believing the code is right and still not be solving the issue. The most common case I've seen is using unique and stable values as keys in elements that are produced by iterating arrays. You could call a function that always generates a different id, and ESLint will stop complaining about it but your keys will be even worse than array indexes.
Read what the rule is about and why does it exist. Don't go just for disappearing the red line, that's how you get into worse problems than the one the linter is trying to avoid.
Log in to continue
We're a place where coders share, stay up-to-date and grow their careers.
About 5:
Understand the rules. You can trick the linter into believing the code is right and still not be solving the issue. The most common case I've seen is using unique and stable values as keys in elements that are produced by iterating arrays. You could call a function that always generates a different id, and ESLint will stop complaining about it but your keys will be even worse than array indexes.
Read what the rule is about and why does it exist. Don't go just for disappearing the red line, that's how you get into worse problems than the one the linter is trying to avoid.