You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// eslint-disable-next-line no-unused-vars on each jsx component
Problem
Having to manually add this all the time
Disable no-unused-vars for react pattern
How?
Add "varsIgnorePattern": "React" in my ESLint config. see varsIgnorePattern
Problem
Looks like a hack. Have false positive preventing ESLint to find actually unused-vars.
Additional context
The ESLint rule "react/jsx-uses-react" should be able to mark variables as used. But it seems this rule is not applied to the js found in HTML files by this plugin.
I've tried to add .html and .js extensions eslint-plugin-react configuration
Description
ESLint no-unused-vars rule reports all jsx components declared in HTML as unused.
Linting the following html would report
'App' is assigned a value but never used
error:Alternatives
Disable locally
How?
// eslint-disable-next-line no-unused-vars
on each jsx componentProblem
Having to manually add this all the time
Disable no-unused-vars for react pattern
How?
Add "varsIgnorePattern": "React" in my ESLint config. see varsIgnorePattern
Problem
Looks like a hack. Have false positive preventing ESLint to find actually unused-vars.
Additional context
The ESLint rule "react/jsx-uses-react" should be able to mark variables as used. But it seems this rule is not applied to the js found in HTML files by this plugin.
I've tried to add
.html
and.js
extensions eslint-plugin-react configurationBut it does not work.
Any idea what's going on?
The text was updated successfully, but these errors were encountered: