Skip to content

Commit

Permalink
fix(eslint): fix TypeError in React Hooks ESLint plugin for rule viol…
Browse files Browse the repository at this point in the history
…ations using ESLint compat to ensure compatibility with ESLint 9 (#8)
  • Loading branch information
ironheart122 authored Jul 11, 2024
1 parent b6f8d23 commit 625da69
Show file tree
Hide file tree
Showing 3 changed files with 4,609 additions and 4,595 deletions.
5 changes: 4 additions & 1 deletion eslint.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { fixupPluginRules } from '@eslint/compat'
import globals from 'globals'

const ERROR = 'error'
Expand Down Expand Up @@ -95,7 +96,9 @@ export const config = [
? {
files: ['**/*.ts?(x)', '**/*.js?(x)'],
plugins: {
'react-hooks': (await import('eslint-plugin-react-hooks')).default,
'react-hooks': fixupPluginRules(
await import('eslint-plugin-react-hooks'),
),
},
rules: {
'react-hooks/rules-of-hooks': ERROR,
Expand Down
Loading

0 comments on commit 625da69

Please sign in to comment.