import js from '@eslint/js' import globals from 'globals' import reactHooks from 'eslint-plugin-react-hooks' import reactRefresh from 'eslint-plugin-react-refresh' import simpleImportSort from 'eslint-plugin-simple-import-sort' import tailwindcss from 'eslint-plugin-tailwindcss' import tseslint from 'typescript-eslint' import { defineConfig } from 'eslint/config' const tsconfigRootDir = new URL('.', import.meta.url).pathname export default defineConfig([ { ignores: ['dist', 'coverage', 'node_modules', 'build', 'public/**/*.ts'], }, { files: ['**/*.{ts,tsx,js,jsx}'], extends: [ js.configs.recommended, ...tseslint.configs.strictTypeChecked, ...tseslint.configs.stylisticTypeChecked, ], languageOptions: { ecmaVersion: 2022, globals: { ...globals.browser, }, parserOptions: { project: './tsconfig.app.json', tsconfigRootDir, }, }, plugins: { 'react-hooks': reactHooks, 'react-refresh': reactRefresh, 'simple-import-sort': simpleImportSort, tailwindcss, }, settings: { tailwindcss: { callees: ['cn'], config: 'tailwind.config.ts', }, }, rules: { ...reactHooks.configs.recommended.rules, 'react-refresh/only-export-components': 'off', 'simple-import-sort/imports': 'error', 'simple-import-sort/exports': 'error', '@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports' }], '@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_', ignoreRestSiblings: true }], '@typescript-eslint/no-misused-promises': ['error', { checksVoidReturn: { attributes: false } }], 'tailwindcss/classnames-order': 'warn', 'tailwindcss/no-arbitrary-value': 'off', 'tailwindcss/no-custom-classname': 'off', }, }, ])