markdownlint 0.36.1 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/README.md +70 -117
  3. package/doc/CustomRules.md +6 -6
  4. package/helpers/README.md +2 -2
  5. package/helpers/{helpers.js → helpers.cjs} +15 -6
  6. package/helpers/micromark-helpers.cjs +5 -3
  7. package/helpers/package.json +2 -5
  8. package/lib/{cache.js → cache.mjs} +9 -17
  9. package/lib/configuration-strict.d.ts +104 -104
  10. package/lib/configuration.d.ts +1 -1
  11. package/lib/{constants.js → constants.mjs} +4 -6
  12. package/lib/exports-async.d.mts +1 -0
  13. package/lib/exports-async.mjs +3 -0
  14. package/lib/exports-promise.d.mts +1 -0
  15. package/lib/exports-promise.mjs +3 -0
  16. package/lib/exports-sync.d.mts +1 -0
  17. package/lib/exports-sync.mjs +3 -0
  18. package/lib/exports.d.mts +28 -0
  19. package/lib/exports.mjs +31 -0
  20. package/lib/markdownit.cjs +9 -5
  21. package/lib/{markdownlint.d.ts → markdownlint.d.mts} +66 -76
  22. package/lib/{markdownlint.js → markdownlint.mjs} +69 -75
  23. package/lib/{md001.js → md001.mjs} +5 -8
  24. package/lib/{md003.js → md003.mjs} +5 -8
  25. package/lib/{md004.js → md004.mjs} +6 -9
  26. package/lib/{md005.js → md005.mjs} +4 -7
  27. package/lib/{md007.js → md007.mjs} +8 -13
  28. package/lib/{md009.js → md009.mjs} +5 -8
  29. package/lib/{md010.js → md010.mjs} +7 -11
  30. package/lib/{md011.js → md011.mjs} +7 -11
  31. package/lib/{md012.js → md012.mjs} +5 -8
  32. package/lib/{md013.js → md013.mjs} +8 -9
  33. package/lib/{md014.js → md014.mjs} +4 -7
  34. package/lib/{md018.js → md018.mjs} +5 -8
  35. package/lib/{md019-md021.js → md019-md021.mjs} +7 -10
  36. package/lib/{md020.js → md020.mjs} +5 -8
  37. package/lib/{md022.js → md022.mjs} +5 -8
  38. package/lib/{md023.js → md023.mjs} +4 -7
  39. package/lib/{md024.js → md024.mjs} +5 -8
  40. package/lib/{md025.js → md025.mjs} +5 -8
  41. package/lib/{md026.js → md026.mjs} +5 -8
  42. package/lib/{md027.js → md027.mjs} +12 -9
  43. package/lib/{md028.js → md028.mjs} +4 -7
  44. package/lib/{md029.js → md029.mjs} +6 -9
  45. package/lib/{md030.js → md030.mjs} +4 -7
  46. package/lib/{md031.js → md031.mjs} +7 -10
  47. package/lib/{md032.js → md032.mjs} +5 -8
  48. package/lib/{md033.js → md033.mjs} +5 -8
  49. package/lib/{md034.js → md034.mjs} +5 -6
  50. package/lib/{md035.js → md035.mjs} +4 -7
  51. package/lib/{md036.js → md036.mjs} +6 -9
  52. package/lib/{md037.js → md037.mjs} +4 -7
  53. package/lib/{md038.js → md038.mjs} +5 -8
  54. package/lib/{md039.js → md039.mjs} +9 -12
  55. package/lib/{md040.js → md040.mjs} +5 -8
  56. package/lib/{md041.js → md041.mjs} +4 -8
  57. package/lib/{md042.js → md042.mjs} +5 -8
  58. package/lib/{md043.js → md043.mjs} +5 -8
  59. package/lib/{md044.js → md044.mjs} +8 -11
  60. package/lib/{md045.js → md045.mjs} +5 -8
  61. package/lib/{md046.js → md046.mjs} +4 -7
  62. package/lib/{md047.js → md047.mjs} +3 -6
  63. package/lib/{md048.js → md048.mjs} +5 -8
  64. package/lib/{md049-md050.js → md049-md050.mjs} +8 -11
  65. package/lib/{md051.js → md051.mjs} +8 -12
  66. package/lib/{md052.js → md052.mjs} +4 -7
  67. package/lib/{md053.js → md053.mjs} +4 -7
  68. package/lib/{md054.js → md054.mjs} +5 -8
  69. package/lib/{md055.js → md055.mjs} +6 -7
  70. package/lib/{md056.js → md056.mjs} +7 -8
  71. package/lib/{md058.js → md058.mjs} +6 -7
  72. package/{helpers/micromark-parse.cjs → lib/micromark-parse.mjs} +29 -33
  73. package/lib/micromark-types.d.mts +11 -0
  74. package/lib/rules.mjs +118 -0
  75. package/lib/types.d.mts +12 -0
  76. package/package.json +36 -32
  77. package/schema/.markdownlint.jsonc +51 -51
  78. package/schema/.markdownlint.yaml +51 -51
  79. package/schema/markdownlint-config-schema-strict.json +106 -106
  80. package/schema/markdownlint-config-schema.json +106 -106
  81. package/demo/markdownlint-browser.js +0 -7138
  82. package/helpers/test.cjs +0 -28
  83. package/lib/rules.js +0 -74
  84. /package/helpers/{shared.js → shared.cjs} +0 -0
@@ -1,4 +1,4 @@
1
- import { ConfigurationStrict } from "./configuration-strict";
1
+ import type { ConfigurationStrict } from "./configuration-strict.d.ts";
2
2
 
3
3
  export interface Configuration extends ConfigurationStrict {
4
4
  /**
@@ -1,9 +1,7 @@
1
1
  // @ts-check
2
2
 
3
- "use strict";
4
-
5
- module.exports.deprecatedRuleNames = [];
6
- module.exports.fixableRuleNames = [
3
+ export const deprecatedRuleNames = [];
4
+ export const fixableRuleNames = [
7
5
  "MD004", "MD005", "MD007", "MD009", "MD010", "MD011",
8
6
  "MD012", "MD014", "MD018", "MD019", "MD020", "MD021",
9
7
  "MD022", "MD023", "MD026", "MD027", "MD030", "MD031",
@@ -11,5 +9,5 @@ module.exports.fixableRuleNames = [
11
9
  "MD047", "MD049", "MD050", "MD051", "MD053", "MD054",
12
10
  "MD058"
13
11
  ];
14
- module.exports.homepage = "https://github.com/DavidAnson/markdownlint";
15
- module.exports.version = "0.36.1";
12
+ export const homepage = "https://github.com/DavidAnson/markdownlint";
13
+ export const version = "0.37.0";
@@ -0,0 +1 @@
1
+ export { lintAsync as lint, readConfigAsync as readConfig } from "./markdownlint.mjs";
@@ -0,0 +1,3 @@
1
+ // @ts-check
2
+
3
+ export { lintAsync as lint, readConfigAsync as readConfig } from "./markdownlint.mjs";
@@ -0,0 +1 @@
1
+ export { extendConfigPromise as extendConfig, lintPromise as lint, readConfigPromise as readConfig } from "./markdownlint.mjs";
@@ -0,0 +1,3 @@
1
+ // @ts-check
2
+
3
+ export { extendConfigPromise as extendConfig, lintPromise as lint, readConfigPromise as readConfig } from "./markdownlint.mjs";
@@ -0,0 +1 @@
1
+ export { lintSync as lint, readConfigSync as readConfig } from "./markdownlint.mjs";
@@ -0,0 +1,3 @@
1
+ // @ts-check
2
+
3
+ export { lintSync as lint, readConfigSync as readConfig } from "./markdownlint.mjs";
@@ -0,0 +1,28 @@
1
+ export type Configuration = import("./markdownlint.mjs").Configuration;
2
+ export type ConfigurationParser = import("./markdownlint.mjs").ConfigurationParser;
3
+ export type ConfigurationStrict = import("./markdownlint.mjs").ConfigurationStrict;
4
+ export type FixInfo = import("./markdownlint.mjs").FixInfo;
5
+ export type LintCallback = import("./markdownlint.mjs").LintCallback;
6
+ export type LintContentCallback = import("./markdownlint.mjs").LintContentCallback;
7
+ export type LintError = import("./markdownlint.mjs").LintError;
8
+ export type LintResults = import("./markdownlint.mjs").LintResults;
9
+ export type MarkdownItToken = import("./markdownlint.mjs").MarkdownItToken;
10
+ export type MarkdownParsers = import("./markdownlint.mjs").MarkdownParsers;
11
+ export type MicromarkToken = import("./markdownlint.mjs").MicromarkToken;
12
+ export type MicromarkTokenType = import("./markdownlint.mjs").MicromarkTokenType;
13
+ export type Options = import("./markdownlint.mjs").Options;
14
+ export type ParserMarkdownIt = import("./markdownlint.mjs").ParserMarkdownIt;
15
+ export type ParserMicromark = import("./markdownlint.mjs").ParserMicromark;
16
+ export type Plugin = import("./markdownlint.mjs").Plugin;
17
+ export type ReadConfigCallback = import("./markdownlint.mjs").ReadConfigCallback;
18
+ export type ResolveConfigExtendsCallback = import("./markdownlint.mjs").ResolveConfigExtendsCallback;
19
+ export type Rule = import("./markdownlint.mjs").Rule;
20
+ export type RuleConfiguration = import("./markdownlint.mjs").RuleConfiguration;
21
+ export type RuleFunction = import("./markdownlint.mjs").RuleFunction;
22
+ export type RuleOnError = import("./markdownlint.mjs").RuleOnError;
23
+ export type RuleOnErrorFixInfo = import("./markdownlint.mjs").RuleOnErrorFixInfo;
24
+ export type RuleOnErrorFixInfoNormalized = import("./markdownlint.mjs").RuleOnErrorFixInfoNormalized;
25
+ export type RuleOnErrorInfo = import("./markdownlint.mjs").RuleOnErrorInfo;
26
+ export type RuleParams = import("./markdownlint.mjs").RuleParams;
27
+ export type ToStringCallback = import("./markdownlint.mjs").ToStringCallback;
28
+ export { applyFix, applyFixes, getVersion } from "./markdownlint.mjs";
@@ -0,0 +1,31 @@
1
+ // @ts-check
2
+
3
+ export { applyFix, applyFixes, getVersion } from "./markdownlint.mjs";
4
+
5
+ /** @typedef {import("./markdownlint.mjs").Configuration} Configuration */
6
+ /** @typedef {import("./markdownlint.mjs").ConfigurationParser} ConfigurationParser */
7
+ /** @typedef {import("./markdownlint.mjs").ConfigurationStrict} ConfigurationStrict */
8
+ /** @typedef {import("./markdownlint.mjs").FixInfo} FixInfo */
9
+ /** @typedef {import("./markdownlint.mjs").LintCallback} LintCallback */
10
+ /** @typedef {import("./markdownlint.mjs").LintContentCallback} LintContentCallback */
11
+ /** @typedef {import("./markdownlint.mjs").LintError} LintError */
12
+ /** @typedef {import("./markdownlint.mjs").LintResults} LintResults */
13
+ /** @typedef {import("./markdownlint.mjs").MarkdownItToken} MarkdownItToken */
14
+ /** @typedef {import("./markdownlint.mjs").MarkdownParsers} MarkdownParsers */
15
+ /** @typedef {import("./markdownlint.mjs").MicromarkToken} MicromarkToken */
16
+ /** @typedef {import("./markdownlint.mjs").MicromarkTokenType} MicromarkTokenType */
17
+ /** @typedef {import("./markdownlint.mjs").Options} Options */
18
+ /** @typedef {import("./markdownlint.mjs").ParserMarkdownIt} ParserMarkdownIt */
19
+ /** @typedef {import("./markdownlint.mjs").ParserMicromark} ParserMicromark */
20
+ /** @typedef {import("./markdownlint.mjs").Plugin} Plugin */
21
+ /** @typedef {import("./markdownlint.mjs").ReadConfigCallback} ReadConfigCallback */
22
+ /** @typedef {import("./markdownlint.mjs").ResolveConfigExtendsCallback} ResolveConfigExtendsCallback */
23
+ /** @typedef {import("./markdownlint.mjs").Rule} Rule */
24
+ /** @typedef {import("./markdownlint.mjs").RuleConfiguration} RuleConfiguration */
25
+ /** @typedef {import("./markdownlint.mjs").RuleFunction} RuleFunction */
26
+ /** @typedef {import("./markdownlint.mjs").RuleOnError} RuleOnError */
27
+ /** @typedef {import("./markdownlint.mjs").RuleOnErrorFixInfo} RuleOnErrorFixInfo */
28
+ /** @typedef {import("./markdownlint.mjs").RuleOnErrorFixInfoNormalized} RuleOnErrorFixInfoNormalized */
29
+ /** @typedef {import("./markdownlint.mjs").RuleOnErrorInfo} RuleOnErrorInfo */
30
+ /** @typedef {import("./markdownlint.mjs").RuleParams} RuleParams */
31
+ /** @typedef {import("./markdownlint.mjs").ToStringCallback} ToStringCallback */
@@ -4,6 +4,11 @@
4
4
 
5
5
  const { newLineRe } = require("../helpers");
6
6
 
7
+ // @ts-expect-error https://github.com/microsoft/TypeScript/issues/52529
8
+ /** @typedef {import("markdownlint").MarkdownItToken} MarkdownItToken */
9
+ // @ts-expect-error https://github.com/microsoft/TypeScript/issues/52529
10
+ /** @typedef {import("markdownlint").Plugin} Plugin */
11
+
7
12
  /**
8
13
  * @callback InlineCodeSpanCallback
9
14
  * @param {string} code Code content.
@@ -67,7 +72,7 @@ function forEachInlineCodeSpan(input, handler) {
67
72
  /**
68
73
  * Freeze all freeze-able members of a token and its children.
69
74
  *
70
- * @param {import("./markdownlint").MarkdownItToken} token A markdown-it token.
75
+ * @param {MarkdownItToken} token A markdown-it token.
71
76
  * @returns {void}
72
77
  */
73
78
  function freezeToken(token) {
@@ -98,8 +103,7 @@ function freezeToken(token) {
98
103
  */
99
104
  function annotateAndFreezeTokens(tokens, lines) {
100
105
  let trMap = null;
101
- // eslint-disable-next-line jsdoc/valid-types
102
- /** @type import("./markdownlint").MarkdownItToken[] */
106
+ /** @type {MarkdownItToken[]} */
103
107
  // @ts-ignore
104
108
  const markdownItTokens = tokens;
105
109
  for (const token of markdownItTokens) {
@@ -148,10 +152,10 @@ function annotateAndFreezeTokens(tokens, lines) {
148
152
  /**
149
153
  * Gets an array of markdown-it tokens for the input.
150
154
  *
151
- * @param {import("./markdownlint").Plugin[]} markdownItPlugins Additional plugins.
155
+ * @param {Plugin[]} markdownItPlugins Additional plugins.
152
156
  * @param {string} content Markdown content.
153
157
  * @param {string[]} lines Lines of Markdown content.
154
- * @returns {import("../lib/markdownlint").MarkdownItToken} Array of markdown-it tokens.
158
+ * @returns {MarkdownItToken} Array of markdown-it tokens.
155
159
  */
156
160
  function getMarkdownItTokens(markdownItPlugins, content, lines) {
157
161
  const markdownit = require("markdown-it");
@@ -1,4 +1,3 @@
1
- export = markdownlint;
2
1
  /**
3
2
  * Lint specified Markdown files.
4
3
  *
@@ -6,49 +5,60 @@ export = markdownlint;
6
5
  * @param {LintCallback} callback Callback (err, result) function.
7
6
  * @returns {void}
8
7
  */
9
- declare function markdownlint(options: Options | null, callback: LintCallback): void;
10
- declare namespace markdownlint {
11
- export { markdownlintSync as sync, readConfig, readConfigSync, getVersion, promises, applyFix, applyFixes, RuleFunction, RuleParams, MarkdownParsers, ParserMarkdownIt, ParserMicromark, MarkdownItToken, MicromarkTokenType, MicromarkToken, RuleOnError, RuleOnErrorInfo, RuleOnErrorFixInfo, RuleOnErrorFixInfoNormalized, Rule, Options, Plugin, ToStringCallback, LintResults, LintError, FixInfo, LintContentCallback, LintCallback, Configuration, ConfigurationStrict, RuleConfiguration, ConfigurationParser, ReadConfigCallback, ResolveConfigExtendsCallback };
12
- }
8
+ export function lintAsync(options: Options | null, callback: LintCallback): void;
13
9
  /**
14
- * Lint specified Markdown files synchronously.
10
+ * Lint specified Markdown files.
11
+ *
12
+ * @param {Options | null} options Configuration options.
13
+ * @returns {Promise<LintResults>} Results object.
14
+ */
15
+ export function lintPromise(options: Options | null): Promise<LintResults>;
16
+ /**
17
+ * Lint specified Markdown files.
15
18
  *
16
19
  * @param {Options | null} options Configuration options.
17
20
  * @returns {LintResults} Results object.
18
21
  */
19
- declare function markdownlintSync(options: Options | null): LintResults;
22
+ export function lintSync(options: Options | null): LintResults;
23
+ /**
24
+ * Extend specified configuration object.
25
+ *
26
+ * @param {Configuration} config Configuration object.
27
+ * @param {string} file Configuration file name.
28
+ * @param {ConfigurationParser[] | undefined} parsers Parsing function(s).
29
+ * @param {Object} fs File system implementation.
30
+ * @returns {Promise<Configuration>} Configuration object.
31
+ */
32
+ export function extendConfigPromise(config: Configuration, file: string, parsers: ConfigurationParser[] | undefined, fs: any): Promise<Configuration>;
20
33
  /**
21
34
  * Read specified configuration file.
22
35
  *
23
36
  * @param {string} file Configuration file name.
24
- * @param {ConfigurationParser[] | ReadConfigCallback} parsers Parsing
37
+ * @param {ConfigurationParser[] | ReadConfigCallback} [parsers] Parsing
25
38
  * function(s).
26
39
  * @param {Object} [fs] File system implementation.
27
40
  * @param {ReadConfigCallback} [callback] Callback (err, result) function.
28
41
  * @returns {void}
29
42
  */
30
- declare function readConfig(file: string, parsers: ConfigurationParser[] | ReadConfigCallback, fs?: any, callback?: ReadConfigCallback): void;
43
+ export function readConfigAsync(file: string, parsers?: ConfigurationParser[] | ReadConfigCallback, fs?: any, callback?: ReadConfigCallback): void;
31
44
  /**
32
- * Read specified configuration file synchronously.
45
+ * Read specified configuration file.
33
46
  *
34
47
  * @param {string} file Configuration file name.
35
48
  * @param {ConfigurationParser[]} [parsers] Parsing function(s).
36
49
  * @param {Object} [fs] File system implementation.
37
- * @returns {Configuration} Configuration object.
38
- * @throws An Error if processing fails.
50
+ * @returns {Promise<Configuration>} Configuration object.
39
51
  */
40
- declare function readConfigSync(file: string, parsers?: ConfigurationParser[], fs?: any): Configuration;
52
+ export function readConfigPromise(file: string, parsers?: ConfigurationParser[], fs?: any): Promise<Configuration>;
41
53
  /**
42
- * Gets the (semantic) version of the library.
54
+ * Read specified configuration file.
43
55
  *
44
- * @returns {string} SemVer string.
56
+ * @param {string} file Configuration file name.
57
+ * @param {ConfigurationParser[]} [parsers] Parsing function(s).
58
+ * @param {Object} [fs] File system implementation.
59
+ * @returns {Configuration} Configuration object.
45
60
  */
46
- declare function getVersion(): string;
47
- declare namespace promises {
48
- export { markdownlintPromise as markdownlint };
49
- export { extendConfigPromise as extendConfig };
50
- export { readConfigPromise as readConfig };
51
- }
61
+ export function readConfigSync(file: string, parsers?: ConfigurationParser[], fs?: any): Configuration;
52
62
  /**
53
63
  * Applies the specified fix to a Markdown content line.
54
64
  *
@@ -57,7 +67,7 @@ declare namespace promises {
57
67
  * @param {string} [lineEnding] Line ending to use.
58
68
  * @returns {string | null} Fixed content or null if deleted.
59
69
  */
60
- declare function applyFix(line: string, fixInfo: RuleOnErrorFixInfo, lineEnding?: string): string | null;
70
+ export function applyFix(line: string, fixInfo: RuleOnErrorFixInfo, lineEnding?: string): string | null;
61
71
  /**
62
72
  * Applies as many of the specified fixes as possible to Markdown content.
63
73
  *
@@ -65,15 +75,21 @@ declare function applyFix(line: string, fixInfo: RuleOnErrorFixInfo, lineEnding?
65
75
  * @param {RuleOnErrorInfo[]} errors RuleOnErrorInfo instances.
66
76
  * @returns {string} Fixed content.
67
77
  */
68
- declare function applyFixes(input: string, errors: RuleOnErrorInfo[]): string;
78
+ export function applyFixes(input: string, errors: RuleOnErrorInfo[]): string;
79
+ /**
80
+ * Gets the (semantic) version of the library.
81
+ *
82
+ * @returns {string} SemVer string.
83
+ */
84
+ export function getVersion(): string;
69
85
  /**
70
86
  * Function to implement rule logic.
71
87
  */
72
- type RuleFunction = (params: RuleParams, onError: RuleOnError) => void;
88
+ export type RuleFunction = (params: RuleParams, onError: RuleOnError) => void;
73
89
  /**
74
90
  * Rule parameters.
75
91
  */
76
- type RuleParams = {
92
+ export type RuleParams = {
77
93
  /**
78
94
  * File/string name.
79
95
  */
@@ -102,7 +118,7 @@ type RuleParams = {
102
118
  /**
103
119
  * Markdown parser data.
104
120
  */
105
- type MarkdownParsers = {
121
+ export type MarkdownParsers = {
106
122
  /**
107
123
  * Markdown parser data from markdown-it (only present when Rule.parser is "markdownit").
108
124
  */
@@ -115,7 +131,7 @@ type MarkdownParsers = {
115
131
  /**
116
132
  * Markdown parser data from markdown-it.
117
133
  */
118
- type ParserMarkdownIt = {
134
+ export type ParserMarkdownIt = {
119
135
  /**
120
136
  * Token objects from markdown-it.
121
137
  */
@@ -124,7 +140,7 @@ type ParserMarkdownIt = {
124
140
  /**
125
141
  * Markdown parser data from micromark.
126
142
  */
127
- type ParserMicromark = {
143
+ export type ParserMicromark = {
128
144
  /**
129
145
  * Token objects from micromark.
130
146
  */
@@ -133,7 +149,7 @@ type ParserMicromark = {
133
149
  /**
134
150
  * markdown-it token.
135
151
  */
136
- type MarkdownItToken = {
152
+ export type MarkdownItToken = {
137
153
  /**
138
154
  * HTML attributes.
139
155
  */
@@ -195,11 +211,11 @@ type MarkdownItToken = {
195
211
  */
196
212
  line: string;
197
213
  };
198
- type MicromarkTokenType = import("markdownlint-micromark").TokenType;
214
+ export type MicromarkTokenType = import("micromark-util-types").TokenType;
199
215
  /**
200
216
  * micromark token.
201
217
  */
202
- type MicromarkToken = {
218
+ export type MicromarkToken = {
203
219
  /**
204
220
  * Token type.
205
221
  */
@@ -236,11 +252,11 @@ type MicromarkToken = {
236
252
  /**
237
253
  * Error-reporting callback.
238
254
  */
239
- type RuleOnError = (onErrorInfo: RuleOnErrorInfo) => void;
255
+ export type RuleOnError = (onErrorInfo: RuleOnErrorInfo) => void;
240
256
  /**
241
257
  * Fix information for RuleOnError callback.
242
258
  */
243
- type RuleOnErrorInfo = {
259
+ export type RuleOnErrorInfo = {
244
260
  /**
245
261
  * Line number (1-based).
246
262
  */
@@ -269,7 +285,7 @@ type RuleOnErrorInfo = {
269
285
  /**
270
286
  * Fix information for RuleOnErrorInfo.
271
287
  */
272
- type RuleOnErrorFixInfo = {
288
+ export type RuleOnErrorFixInfo = {
273
289
  /**
274
290
  * Line number (1-based).
275
291
  */
@@ -290,7 +306,7 @@ type RuleOnErrorFixInfo = {
290
306
  /**
291
307
  * RuleOnErrorInfo with all optional properties present.
292
308
  */
293
- type RuleOnErrorFixInfoNormalized = {
309
+ export type RuleOnErrorFixInfoNormalized = {
294
310
  /**
295
311
  * Line number (1-based).
296
312
  */
@@ -311,7 +327,7 @@ type RuleOnErrorFixInfoNormalized = {
311
327
  /**
312
328
  * Rule definition.
313
329
  */
314
- type Rule = {
330
+ export type Rule = {
315
331
  /**
316
332
  * Rule name(s).
317
333
  */
@@ -344,7 +360,7 @@ type Rule = {
344
360
  /**
345
361
  * Configuration options.
346
362
  */
347
- type Options = {
363
+ export type Options = {
348
364
  /**
349
365
  * Configuration object.
350
366
  */
@@ -395,21 +411,21 @@ type Options = {
395
411
  /**
396
412
  * A markdown-it plugin.
397
413
  */
398
- type Plugin = any[];
414
+ export type Plugin = any[];
399
415
  /**
400
416
  * Function to pretty-print lint results.
401
417
  */
402
- type ToStringCallback = (ruleAliases?: boolean) => string;
418
+ export type ToStringCallback = (ruleAliases?: boolean) => string;
403
419
  /**
404
420
  * Lint results (for resultVersion 3).
405
421
  */
406
- type LintResults = {
422
+ export type LintResults = {
407
423
  [x: string]: LintError[];
408
424
  };
409
425
  /**
410
426
  * Lint error.
411
427
  */
412
- type LintError = {
428
+ export type LintError = {
413
429
  /**
414
430
  * Line number (1-based).
415
431
  */
@@ -446,7 +462,7 @@ type LintError = {
446
462
  /**
447
463
  * Fix information.
448
464
  */
449
- type FixInfo = {
465
+ export type FixInfo = {
450
466
  /**
451
467
  * Line number (1-based).
452
468
  */
@@ -467,60 +483,34 @@ type FixInfo = {
467
483
  /**
468
484
  * Called with the result of linting a string or document.
469
485
  */
470
- type LintContentCallback = (error: Error | null, result?: LintError[]) => void;
486
+ export type LintContentCallback = (error: Error | null, result?: LintError[]) => void;
471
487
  /**
472
488
  * Called with the result of the lint function.
473
489
  */
474
- type LintCallback = (error: Error | null, results?: LintResults) => void;
490
+ export type LintCallback = (error: Error | null, results?: LintResults) => void;
475
491
  /**
476
492
  * Configuration object for linting rules. For the JSON schema, see
477
493
  * {@link ../schema/markdownlint-config-schema.json}.
478
494
  */
479
- type Configuration = import("./configuration").Configuration;
495
+ export type Configuration = import("./configuration.d.ts").Configuration;
480
496
  /**
481
497
  * Configuration object for linting rules strictly. For the JSON schema, see
482
498
  * {@link ../schema/markdownlint-config-schema-strict.json}.
483
499
  */
484
- type ConfigurationStrict = import("./configuration-strict").ConfigurationStrict;
500
+ export type ConfigurationStrict = import("./configuration-strict.d.ts").ConfigurationStrict;
485
501
  /**
486
502
  * Rule configuration.
487
503
  */
488
- type RuleConfiguration = boolean | any;
504
+ export type RuleConfiguration = boolean | any;
489
505
  /**
490
506
  * Parses a configuration string and returns a configuration object.
491
507
  */
492
- type ConfigurationParser = (text: string) => Configuration;
508
+ export type ConfigurationParser = (text: string) => Configuration;
493
509
  /**
494
510
  * Called with the result of the readConfig function.
495
511
  */
496
- type ReadConfigCallback = (err: Error | null, config?: Configuration) => void;
512
+ export type ReadConfigCallback = (err: Error | null, config?: Configuration) => void;
497
513
  /**
498
514
  * Called with the result of the resolveConfigExtends function.
499
515
  */
500
- type ResolveConfigExtendsCallback = (err: Error | null, path?: string) => void;
501
- /**
502
- * Lint specified Markdown files.
503
- *
504
- * @param {Options} options Configuration options.
505
- * @returns {Promise<LintResults>} Results object.
506
- */
507
- declare function markdownlintPromise(options: Options): Promise<LintResults>;
508
- /**
509
- * Extend specified configuration object.
510
- *
511
- * @param {Configuration} config Configuration object.
512
- * @param {string} file Configuration file name.
513
- * @param {ConfigurationParser[]} [parsers] Parsing function(s).
514
- * @param {Object} [fs] File system implementation.
515
- * @returns {Promise<Configuration>} Configuration object.
516
- */
517
- declare function extendConfigPromise(config: Configuration, file: string, parsers?: ConfigurationParser[], fs?: any): Promise<Configuration>;
518
- /**
519
- * Read specified configuration file.
520
- *
521
- * @param {string} file Configuration file name.
522
- * @param {ConfigurationParser[]} [parsers] Parsing function(s).
523
- * @param {Object} [fs] File system implementation.
524
- * @returns {Promise<Configuration>} Configuration object.
525
- */
526
- declare function readConfigPromise(file: string, parsers?: ConfigurationParser[], fs?: any): Promise<Configuration>;
516
+ export type ResolveConfigExtendsCallback = (err: Error | null, path?: string) => void;