This bumps all eslint packages, ensuring compatibility with TypeScript 5.7.3. Previously, the following would be thrown: ```bash WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree. You may find that it works just fine, or you may not. SUPPORTED TYPESCRIPT VERSIONS: >=4.7.4 <5.7.0 YOUR TYPESCRIPT VERSION: 5.7.3 Please only submit bug reports when using the officially supported version ``` This [might have caused errors during linting](https://payloadcms.slack.com/archives/C04H7CQ615K/p1741707183505329?thread_ts=1741707036.030089&cid=C04H7CQ615K). `payload` lint before: ✖ 380 problems (9 errors, 371 warnings) `payload` lint after: ✖ 381 problems (9 errors, 372 warnings) `ui` lint before: ✖ 154 problems (12 errors, 142 warnings) `ui` lint after: ✖ 267 problems (12 errors, 255 warnings) The additional warnings in `ui` come from the new `@eslint-react/no-use-context` and `@eslint-react/no-context-provider` rules which are good to have in React 19.
51 lines
1.1 KiB
JavaScript
51 lines
1.1 KiB
JavaScript
import reactRules from './rules/react.mjs'
|
|
import reactA11yRules from './rules/react-a11y.mjs'
|
|
import jsxA11y from 'eslint-plugin-jsx-a11y'
|
|
import react from '@eslint-react/eslint-plugin'
|
|
import reactHooks from 'eslint-plugin-react-hooks'
|
|
import globals from 'globals'
|
|
import { deepMerge } from '../../deepMerge.js'
|
|
|
|
/** @type {import('eslint').Linter.Config} */
|
|
export const index = deepMerge(
|
|
react.configs['recommended-type-checked'],
|
|
{
|
|
rules: {
|
|
...reactHooks.configs.recommended.rules,
|
|
'@eslint-react/hooks-extra/no-direct-set-state-in-use-effect': 'off',
|
|
'@eslint-react/naming-convention/use-state': 'off',
|
|
},
|
|
},
|
|
{
|
|
rules: reactRules,
|
|
},
|
|
{
|
|
rules: reactA11yRules,
|
|
},
|
|
{
|
|
languageOptions: {
|
|
globals: {
|
|
...globals.browser,
|
|
},
|
|
parserOptions: {
|
|
ecmaFeatures: {
|
|
jsx: true,
|
|
},
|
|
},
|
|
},
|
|
plugins: {
|
|
'jsx-a11y': jsxA11y,
|
|
'react-hooks': reactHooks,
|
|
},
|
|
settings: {
|
|
react: {
|
|
version: 'detect',
|
|
},
|
|
},
|
|
rules: {
|
|
'react-hooks/rules-of-hooks': 'error',
|
|
},
|
|
},
|
|
)
|
|
export default index
|