diff --git a/client/eslint.config.js b/client/eslint.config.js index 238d2e4..aaf69f9 100644 --- a/client/eslint.config.js +++ b/client/eslint.config.js @@ -1,38 +1,35 @@ -import js from '@eslint/js' -import globals from 'globals' -import react from 'eslint-plugin-react' -import reactHooks from 'eslint-plugin-react-hooks' -import reactRefresh from 'eslint-plugin-react-refresh' +import globals from 'globals'; +import pluginJs from '@eslint/js'; +import tseslint from 'typescript-eslint'; +import pluginReact from 'eslint-plugin-react'; +import hooksPlugin from 'eslint-plugin-react-hooks'; +import prettier from 'eslint-plugin-prettier'; +// TODO: Better understand and improve this config along with tsconfig. +/** @type {import('eslint').Linter.Config[]} */ export default [ - { ignores: ['dist'] }, + { files: ['**/*.{js,mjs,cjs,ts,jsx,tsx}'] }, + { languageOptions: { globals: globals.browser } }, + pluginJs.configs.recommended, + ...tseslint.configs.recommended, + pluginReact.configs.flat.recommended, { - files: ['**/*.{js,jsx}'], - languageOptions: { - ecmaVersion: 2020, - globals: globals.browser, - parserOptions: { - ecmaVersion: 'latest', - ecmaFeatures: { jsx: true }, - sourceType: 'module', - }, - }, - settings: { react: { version: '18.3' } }, plugins: { - react, - 'react-hooks': reactHooks, - 'react-refresh': reactRefresh, - }, - rules: { - ...js.configs.recommended.rules, - ...react.configs.recommended.rules, - ...react.configs['jsx-runtime'].rules, - ...reactHooks.configs.recommended.rules, - 'react/jsx-no-target-blank': 'off', - 'react-refresh/only-export-components': [ - 'warn', - { allowConstantExport: true }, - ], + prettier, }, + rules: { + 'react/react-in-jsx-scope': 'off' + }, + settings: { + react: { + version: 'detect' + } + } }, -] + { + plugins: { + 'react-hooks': hooksPlugin, + }, + rules: hooksPlugin.configs.recommended.rules, + } +]; diff --git a/client/index.html b/client/index.html index 6cd75fa..8c814ea 100644 --- a/client/index.html +++ b/client/index.html @@ -8,6 +8,6 @@
- +