diff --git a/.changeset/seven-guests-bake.md b/.changeset/seven-guests-bake.md new file mode 100644 index 0000000..3ed626a --- /dev/null +++ b/.changeset/seven-guests-bake.md @@ -0,0 +1,6 @@ +--- +'@commencis/eslint-config': patch +--- + +update dependency: eslint-plugin-react-hooks@5.1.0 +fix: type declarations for eslint-plugin-react diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 1648ce9..478b59d 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -70,7 +70,7 @@ "eslint-plugin-jsx-a11y": "6.10.2", "eslint-plugin-prettier": "5.2.1", "eslint-plugin-react": "7.37.2", - "eslint-plugin-react-hooks": "5.0.0", + "eslint-plugin-react-hooks": "5.1.0", "eslint-plugin-simple-import-sort": "12.1.1", "eslint-plugin-vue": "9.31.0", "globals": "15.13.0", diff --git a/packages/eslint-config/src/plugins/reactPlugin.ts b/packages/eslint-config/src/plugins/reactPlugin.ts index 825f063..d29cda5 100644 --- a/packages/eslint-config/src/plugins/reactPlugin.ts +++ b/packages/eslint-config/src/plugins/reactPlugin.ts @@ -5,16 +5,21 @@ import { type FlatConfig } from '@/types'; import { reactRules } from '@/rules'; +const reactPluginFlatConfig = reactPlugin.configs.flat as Record< + string, + reactPlugin.ReactFlatConfig +>; + export const reactPluginConfig: FlatConfig = { name: 'commencis/plugin:react', files: JSX_TSX_FILE_PATTERNS, - languageOptions: { ...reactPlugin.configs.flat.recommended.languageOptions }, + languageOptions: { ...reactPluginFlatConfig.recommended.languageOptions }, plugins: { react: reactPlugin, }, rules: { - ...reactPlugin.configs.flat.recommended.rules, - ...reactPlugin.configs.flat['jsx-runtime'].rules, + ...reactPluginFlatConfig.recommended.rules, + ...reactPluginFlatConfig['jsx-runtime'].rules, ...reactRules, }, settings: { diff --git a/packages/eslint-config/src/types/types.d.ts b/packages/eslint-config/src/types/types.d.ts index 844a8f1..03cb92a 100644 --- a/packages/eslint-config/src/types/types.d.ts +++ b/packages/eslint-config/src/types/types.d.ts @@ -1,4 +1,3 @@ declare module '@next/eslint-plugin-next'; declare module 'eslint-plugin-jsx-a11y'; -declare module 'eslint-plugin-react'; declare module 'eslint-plugin-react-hooks'; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6e3a143..63b27b9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -94,8 +94,8 @@ importers: specifier: 7.37.2 version: 7.37.2(eslint@9.16.0(jiti@1.21.6)) eslint-plugin-react-hooks: - specifier: 5.0.0 - version: 5.0.0(eslint@9.16.0(jiti@1.21.6)) + specifier: 5.1.0 + version: 5.1.0(eslint@9.16.0(jiti@1.21.6)) eslint-plugin-simple-import-sort: specifier: 12.1.1 version: 12.1.1(eslint@9.16.0(jiti@1.21.6)) @@ -1526,6 +1526,12 @@ packages: peerDependencies: eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 + eslint-plugin-react-hooks@5.1.0: + resolution: {integrity: sha512-mpJRtPgHN2tNAvZ35AMfqeB3Xqeo273QxrHJsbBEPWODRM4r0yB6jfoROqKEYrOn27UtRPpcpHc2UqyBSuUNTw==} + engines: {node: '>=10'} + peerDependencies: + eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0 || ^9.0.0 + eslint-plugin-react@7.37.2: resolution: {integrity: sha512-EsTAnj9fLVr/GZleBLFbj/sSuXeWmp1eXIN60ceYnZveqEaUCyW4X+Vh4WTdUhCkW4xutXYqTXCUSyqD4rB75w==} engines: {node: '>=4'} @@ -4686,6 +4692,10 @@ snapshots: dependencies: eslint: 9.16.0(jiti@1.21.6) + eslint-plugin-react-hooks@5.1.0(eslint@9.16.0(jiti@1.21.6)): + dependencies: + eslint: 9.16.0(jiti@1.21.6) + eslint-plugin-react@7.37.2(eslint@9.16.0(jiti@1.21.6)): dependencies: array-includes: 3.1.8