feat: add React and React Hooks support to ESLint configuration

This commit is contained in:
GW_MC
2025-12-20 13:17:09 +08:00
parent 7d99a4852b
commit a88e4d7274

View File

@@ -1,6 +1,8 @@
import js from '@eslint/js';
import globals from 'globals';
import tseslint from 'typescript-eslint';
import pluginReact from 'eslint-plugin-react';
import pluginReactHooks from 'eslint-plugin-react-hooks';
export default tseslint.config(
{
@@ -22,5 +24,19 @@ export default tseslint.config(
},
},
rules: {},
},
{
...pluginReact.configs.flat.recommended, // Enables core React rules
...pluginReactHooks.configs.flat.recommended, // Enables React Hooks rules
languageOptions: {
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
},
},
}
);