Skip to content

Commit 9674f9f

Browse files
fix: add support for exactOptionalPropertyTypes in type definitions
1 parent 84c87c4 commit 9674f9f

File tree

2 files changed

+25
-2
lines changed

2 files changed

+25
-2
lines changed

src/index.js

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,28 @@ import rules from "./build/rules.js";
1919

2020
/** @typedef {import("eslint").Linter.RulesRecord} RulesRecord*/
2121
/** @typedef {import("eslint").Linter.Config} Config*/
22-
/** @typedef {import("eslint").ESLint.Plugin} Plugin */
22+
/** @typedef {import("eslint").Linter.LegacyConfig} LegacyConfig*/
23+
/** @typedef {import("eslint").Linter.Processor} Processor*/
24+
/**
25+
* @typedef {import("eslint").ESLint.Plugin &
26+
* { meta: {
27+
* name: string;
28+
* version: string;
29+
* }} &
30+
* { processors: {
31+
* markdown: Processor;
32+
* }} &
33+
* { languages: {
34+
* commonmark: Language;
35+
* gfm: Language;
36+
* }} &
37+
* { configs: {
38+
* "recommended-legacy": LegacyConfig;
39+
* recommended: Config[];
40+
* processor: Config[];
41+
* }}
42+
* } Plugin
43+
*/
2344
/**
2445
* @typedef {import("./types.ts").MarkdownRuleDefinition<Options>} MarkdownRuleDefinition<Options>
2546
* @template {Partial<import("./types.ts").MarkdownRuleDefinitionTypeOptions>} [Options={}]
@@ -57,6 +78,7 @@ const processorRulesConfig = {
5778

5879
let recommendedPlugins, processorPlugins;
5980

81+
/** @type {Plugin} */
6082
const plugin = {
6183
meta: {
6284
name: "@eslint/markdown",

tests/types/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"emitDeclarationOnly": false,
55
"noEmit": true,
66
"rootDir": "../..",
7-
"strict": true
7+
"strict": true,
8+
"exactOptionalPropertyTypes": true
89
},
910
"files": [],
1011
"include": [".", "../../dist"]

0 commit comments

Comments
 (0)