eslint-plugin-react
eslint-plugin-react copied to clipboard
React-specific linting rules for ESLint
Hey guys! I was wondering if there are any plans to do a similar rule to react/no-access-state-in-setstate but for useState? I feel that there is still a lot of benefit...
Hello First, thank you for the plugin which works very well and helps us catch a lot of issues at code time :-) I have a use-case in my project...
[The documentation for the `function-component-definition` rule](https://github.com/jsx-eslint/eslint-plugin-react/blob/HEAD/docs/rules/function-component-definition.md) helpfully points out, that certain cases in TypeScript code using generics can not be fixed. For example this: ```ts function Component(props: Props) { return...
After upgrading to 7.25.0 I get a false positive from `react/function-component-definition` on the anonymous arrow function returned inside this: ``` function mapStateToProps() { const internItems = makeInternArray(); const internClassList =...
The sort props rule is fantastic for consistency, but I'm wondering if it's possible to order props besides just alphabetically or by the given booleans in the current rule options....
Autofix for jsx-sort-props doesn't respect comments. For example: ```jsx ``` will be fixed like this: ```jsx ``` But I think it should be like this: ```jsx ```
There's a false positive on the rule with forwarded children. Use cases are pretty rare but still exist. Without a fragment around the `children`, code breaks at runtime ``` const...
The rule `react/no-unused-prop-types` doesn't seem to pick up that the component has unused props. Environment: Dependencies: ``` "typescript": "4.6.3", "eslint-plugin-react": "7.30.1", "@typescript-eslint/eslint-plugin": "5.29.0", "@typescript-eslint/parser": "5.29.0", ``` `eslintrc.js` ```js module.exports =...
Please see this comment: https://github.com/prettier/eslint-plugin-prettier/issues/65#issuecomment-1184764958
I have this code example ```js ``` Both target and rel attribute are dynamically defined, and always both present when needed. However, the rule reports it as an error: ```...