From 063db21ec2dab6d21b3bfe68d74950b11aaacece Mon Sep 17 00:00:00 2001 From: Henry Cai Date: Mon, 13 Jan 2025 21:21:27 -0800 Subject: [PATCH] fix(types): fix types of flat configs Fixes #3878 --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 64ff9bbdc4..77f9fc57cb 100644 --- a/index.js +++ b/index.js @@ -90,14 +90,14 @@ const configs = { 'react/jsx-uses-react': SEVERITY_OFF, }, }, - flat: /** @type {Record} */ ({ + flat: /** @type {Record<"recommended"|"all"|"jsx-runtime", ReactFlatConfig>} */ ({ __proto__: null, }), }; /** @typedef {{ plugins: { react: typeof plugin }, rules: import('eslint').Linter.RulesRecord, languageOptions: { parserOptions: import('eslint').Linter.ParserOptions } }} ReactFlatConfig */ -/** @type {{ deprecatedRules: typeof deprecatedRules, rules: typeof allRules, configs: typeof configs & { flat: Record }}} */ +/** @type {{ deprecatedRules: typeof deprecatedRules, rules: typeof allRules, configs: typeof configs & { flat: Record<"recommended"|"all"|"jsx-runtime", ReactFlatConfig> }}} */ const plugin = { deprecatedRules, rules: allRules,