feat: add React and React Hooks support to ESLint configuration
This commit is contained in:
@@ -1,6 +1,8 @@
|
|||||||
import js from '@eslint/js';
|
import js from '@eslint/js';
|
||||||
import globals from 'globals';
|
import globals from 'globals';
|
||||||
import tseslint from 'typescript-eslint';
|
import tseslint from 'typescript-eslint';
|
||||||
|
import pluginReact from 'eslint-plugin-react';
|
||||||
|
import pluginReactHooks from 'eslint-plugin-react-hooks';
|
||||||
|
|
||||||
export default tseslint.config(
|
export default tseslint.config(
|
||||||
{
|
{
|
||||||
@@ -22,5 +24,19 @@ export default tseslint.config(
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
rules: {},
|
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,
|
||||||
|
},
|
||||||
|
},
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user