From c088fced59bc43c78e7db898b024e0b790fd969a Mon Sep 17 00:00:00 2001 From: Tate Thurston Date: Fri, 28 Nov 2025 13:05:54 -0800 Subject: [PATCH] refactor config.mts --- .../src/config.mts | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/packages/eslint-plugin-react-prefer-function-component/src/config.mts b/packages/eslint-plugin-react-prefer-function-component/src/config.mts index bdd6c69..23630fd 100644 --- a/packages/eslint-plugin-react-prefer-function-component/src/config.mts +++ b/packages/eslint-plugin-react-prefer-function-component/src/config.mts @@ -2,19 +2,6 @@ import type { Linter } from "eslint"; import preferFunctionComponent from "./prefer-function-component/index.js"; -const recommended = { - plugins: { - "react-prefer-function-component": { - rules: { - "react-prefer-function-component": preferFunctionComponent.default, - }, - }, - }, - rules: { - "react-prefer-function-component/react-prefer-function-component": "error", - }, -} satisfies Linter.Config; - interface Config { configs: { recommended: Linter.Config; @@ -22,7 +9,21 @@ interface Config { } const config: Config = { - configs: { recommended }, + configs: { + recommended: { + plugins: { + "react-prefer-function-component": { + rules: { + "react-prefer-function-component": preferFunctionComponent.default, + }, + }, + }, + rules: { + "react-prefer-function-component/react-prefer-function-component": + "error", + }, + }, + }, }; export default config;