oranguru/eslint.config.ts

37 lines
1.1 KiB
TypeScript

import js from '@eslint/js';
import perfectionist from 'eslint-plugin-perfectionist';
import pluginReact from 'eslint-plugin-react';
//import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
import { defineConfig } from 'eslint/config';
import globals from 'globals';
import tseslint from 'typescript-eslint';
const config = defineConfig([
{
extends: ['js/recommended'],
files: ['**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
languageOptions: { globals: globals.browser },
plugins: { js },
},
// reactHooks.configs['recommended-latest'],
{...reactRefresh.configs.vite, ignores: ['**/*.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],},
tseslint.configs.recommended,
{
...pluginReact.configs.flat.recommended,
ignores: ['**/*.test.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
rules: {...pluginReact.configs.flat.recommended.rules,
'react/react-in-jsx-scope': 'off',
}
},
perfectionist.configs['recommended-alphabetical'],
{
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
},
},
]);
export default config;