eslint-plugin-react
eslint-plugin-react copied to clipboard
React-specific linting rules for ESLint
Hello, Is there a way to make **coerce** to be the preferred strategy, and to not adjust the code when there's a ternary ? I have code that looks like...
A partial fix to #3323 I welcome suggestions and help if you think it does not improve performance 🙂
Version: 7.30.1 Config: ```js 'react/jsx-no-leaked-render': ['error', { validStrategies: ['coerce', 'ternary'] }], ``` Before fix: ```tsx const MyComponent = () => { const items = [] const breakpoint = { phones:...
I'm currently refactoring some code so I wanted to set this for now: `const [locale, _setLocale] = useState("en")` without using `setLocale` in the code. I'm using the @typescript-eslint/no-unused-vars rule with...
`react/jsx-curly-newline: [2, { multiline: "require", singleline: "consistent" }]` Initial formatting before applying eslint autofixes: ``` const ParentComponent = ({ condition }) => { return ( { condition ? : null...
Fixes [#2962](https://github.com/jsx-eslint/eslint-plugin-react/issues/2962)
Adds a new rule to enforce the use of function components over class components. Related issue: https://github.com/yannickcr/eslint-plugin-react/issues/2860 **Users wanting to try this lint rule today:** This functionality exists in [eslint-plugin-react-prefer-function-component](https://www.npmjs.com/package/eslint-plugin-react-prefer-function-component)....
Not sure what I'm doing wrong but no matter how I set/enable `jsx-handler-names` rule in my projects (Nextjs) it doesn't seem to be working at all 🤔 Any idea what...
For this component: ```js import React from 'react'; import ReactTable from 'react-table'; import 'react-table/react-table.css'; function Test() { const data = [ { name: 'Bob', }, ]; const columns = [...