From d51c9f3758dea840a2f212fd16c6cf27f64244f8 Mon Sep 17 00:00:00 2001 From: jimmy-guzman Date: Sun, 7 Apr 2024 16:13:55 -0500 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20setup=20react-refresh=20p?= =?UTF-8?q?lugin=20correctly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- eslint.config.mjs | 12 +++++++++++- fixtures/tsx.tsx | 3 +++ src/configs/react.ts | 2 +- tsconfig.json | 5 ++++- 4 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 fixtures/tsx.tsx diff --git a/eslint.config.mjs b/eslint.config.mjs index 1c04aad..e2ebe8c 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -9,4 +9,14 @@ const jiti = JITI(import.meta.url); // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access const jimmyDotCodes = jiti("./src").default; -export default jimmyDotCodes({ typescript: true, vitest: true }); +export default jimmyDotCodes({ + typescript: true, + vitest: true, + react: true, + testingLibrary: true, + overrides: [ + { + ignores: ["fixtures"], + }, + ], +}); diff --git a/fixtures/tsx.tsx b/fixtures/tsx.tsx new file mode 100644 index 0000000..0fff75d --- /dev/null +++ b/fixtures/tsx.tsx @@ -0,0 +1,3 @@ +export function Component1() { + return
; +} diff --git a/src/configs/react.ts b/src/configs/react.ts index e96dcc9..63621ea 100644 --- a/src/configs/react.ts +++ b/src/configs/react.ts @@ -1,7 +1,7 @@ import jsxA11y from "eslint-plugin-jsx-a11y"; import react from "eslint-plugin-react"; import reactHooks from "eslint-plugin-react-hooks"; -import reactRefresh from "eslint-plugin-react-refresh"; +import * as reactRefresh from "eslint-plugin-react-refresh"; import globals from "globals"; import { GLOB_JSX, GLOB_TSX } from "../constants"; diff --git a/tsconfig.json b/tsconfig.json index f4182c6..f3eaedc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -15,6 +15,9 @@ "module": "ESNext", "noEmit": true, + "jsx": "react-jsx", + "types": ["vitest/globals"] - } + }, + "exclude": ["./fixtures/**/*.*"] }