From 9674f9f693240213210388f2d182418220ad6947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Altamirano?= <38230545+sebastian-altamirano@users.noreply.github.com> Date: Fri, 23 May 2025 21:47:19 -0300 Subject: [PATCH] fix: add support for `exactOptionalPropertyTypes` in type definitions --- src/index.js | 24 +++++++++++++++++++++++- tests/types/tsconfig.json | 3 ++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 07c7a245..c9e904f2 100644 --- a/src/index.js +++ b/src/index.js @@ -19,7 +19,28 @@ import rules from "./build/rules.js"; /** @typedef {import("eslint").Linter.RulesRecord} RulesRecord*/ /** @typedef {import("eslint").Linter.Config} Config*/ -/** @typedef {import("eslint").ESLint.Plugin} Plugin */ +/** @typedef {import("eslint").Linter.LegacyConfig} LegacyConfig*/ +/** @typedef {import("eslint").Linter.Processor} Processor*/ +/** + * @typedef {import("eslint").ESLint.Plugin & + * { meta: { + * name: string; + * version: string; + * }} & + * { processors: { + * markdown: Processor; + * }} & + * { languages: { + * commonmark: Language; + * gfm: Language; + * }} & + * { configs: { + * "recommended-legacy": LegacyConfig; + * recommended: Config[]; + * processor: Config[]; + * }} + * } Plugin + */ /** * @typedef {import("./types.ts").MarkdownRuleDefinition} MarkdownRuleDefinition * @template {Partial} [Options={}] @@ -57,6 +78,7 @@ const processorRulesConfig = { let recommendedPlugins, processorPlugins; +/** @type {Plugin} */ const plugin = { meta: { name: "@eslint/markdown", diff --git a/tests/types/tsconfig.json b/tests/types/tsconfig.json index 8bc51769..03c94a5a 100644 --- a/tests/types/tsconfig.json +++ b/tests/types/tsconfig.json @@ -4,7 +4,8 @@ "emitDeclarationOnly": false, "noEmit": true, "rootDir": "../..", - "strict": true + "strict": true, + "exactOptionalPropertyTypes": true }, "files": [], "include": [".", "../../dist"]