Skip to content

Commit

Permalink
Cleanup eslint config.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbouder committed Oct 14, 2024
1 parent ed15000 commit d5d72be
Showing 1 changed file with 18 additions and 20 deletions.
38 changes: 18 additions & 20 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
import globals from 'globals';
import pluginJs from '@eslint/js';
import tseslint from 'typescript-eslint';
import prettierRecommended from 'eslint-plugin-prettier/recommended';
import reactPlugin from 'eslint-plugin-react';
import hooksPlugin from 'eslint-plugin-react-hooks';

export default [
// Flat Configs
pluginJs.configs.recommended,
...tseslint.configs.recommended,
reactPlugin.configs.flat.recommended,
prettierRecommended,
// Default Configs
{
files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'],
settings: {
Expand All @@ -20,12 +25,9 @@ export default [
},
},
},
},
pluginJs.configs.recommended,
...tseslint.configs.recommended,
reactPlugin.configs.flat.recommended,
prettierRecommended,
{
plugins: {
'react-hooks': hooksPlugin,
},
rules: {
// Base Warnings
'no-console': 'warn',
Expand All @@ -44,25 +46,21 @@ export default [
],

// TypeScript
'@typescript-eslint/no-unused-vars': 'error',
},
},
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unsafe-function-type': 'off',

// React
...hooksPlugin.configs.recommended.rules,
'react-hooks/exhaustive-deps': 'off',
'react/react-in-jsx-scope': 'off',
},
ignores: ['*.stories.tsx'],
},
// Storybook Configs
{
plugins: {
'react-hooks': hooksPlugin,
},
files: ['*.stories.tsx'],
rules: {
'react/react-in-jsx-scope': 'off',
...hooksPlugin.configs.recommended.rules,
'react-hooks/exhaustive-deps': 'off',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/no-unsafe-function-type': 'error',
},
ignores: ['*.test.tsx'],
},
];

0 comments on commit d5d72be

Please sign in to comment.