From 32cd241982403e35cf5425ff185c98ac6870b9bd Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Tue, 19 Nov 2024 19:01:00 +0530 Subject: [PATCH] Merge --- web/packages/build-config/eslintrc-react.mjs | 28 +++++--------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/web/packages/build-config/eslintrc-react.mjs b/web/packages/build-config/eslintrc-react.mjs index c83c6b03e1..156ffaf9e3 100644 --- a/web/packages/build-config/eslintrc-react.mjs +++ b/web/packages/build-config/eslintrc-react.mjs @@ -1,3 +1,5 @@ +// @ts-check + import reactPlugin from "eslint-plugin-react"; import hooksPlugin from "eslint-plugin-react-hooks"; import reactRefreshPlugin from "eslint-plugin-react-refresh"; @@ -14,26 +16,17 @@ export default [ version: "detect", }, }, - }, - { - files: ["**/*.{jsx,tsx}"], plugins: { "react-hooks": hooksPlugin, - }, - rules: { - ...hooksPlugin.configs.recommended.rules, - }, - }, - { - files: ["**/*.{jsx,tsx}"], - plugins: { "react-refresh": reactRefreshPlugin, }, rules: { - // Apparently Fast refresh only works if a file only exports components, - // and this rule warns about that. + ...hooksPlugin.configs.recommended.rules, + // Apparently Fast refresh only works if a file only exports + // components, and this rule warns about that. // - // Constants are okay though (otherwise we'll need to create unnecessary helper files). + // Constants are okay though (otherwise we'll need to create + // unnecessary helper files). "react-refresh/only-export-components": [ "warn", { allowConstantExport: true }, @@ -57,13 +50,6 @@ export default [ // "react/jsx-no-target-blank": ["warn", { allowReferrer: true }], // /* Otherwise we need to do unnecessary boilerplating when using memo. */ // "react/display-name": "off", -// /* Apparently Fast refresh only works if a file only exports components, -// and this rule warns about that. Constants are okay though (otherwise -// we'll need to create unnecessary helper files). */ -// "react-refresh/only-export-components": [ -// "warn", -// { allowConstantExport: true }, -// ], // /* Next.js supports the JSX transform introduced in React 17 */ // "react/react-in-jsx-scope": "off", // /* Without React in scope, this rule starts causing false positives (We