Skip to content

Commit

Permalink
Create strict JSON Schema for configuration (standalone for ease of u…
Browse files Browse the repository at this point in the history
…se) and corresponding strict TypeScript type (via extends for conciseness) (fixes #1248).
  • Loading branch information
DavidAnson committed Aug 28, 2024
1 parent bbca3ad commit 9c8e715
Show file tree
Hide file tree
Showing 10 changed files with 3,070 additions and 1,207 deletions.
7 changes: 7 additions & 0 deletions demo/markdownlint-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -3140,6 +3140,13 @@ module.exports = markdownlint;
* @typedef {import("./configuration").Configuration} Configuration
*/

/**
* Configuration object for linting rules strictly. For the JSON schema, see
* {@link ../schema/markdownlint-config-schema-strict.json}.
*
* @typedef {import("./configuration-strict").ConfigurationStrict} ConfigurationStrict
*/

/**
* Rule configuration object.
*
Expand Down
17 changes: 17 additions & 0 deletions example/typescript/type-check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,3 +164,20 @@ markdownlint(options, assertLintResultsCallback);
(async () => {
assertLintResultsCallback(null, await markdownlint.promises.markdownlint(options));
})();

const configuration: markdownlint.Configuration = {
"custom-rule": true,
"no-hard-tabs": false,
"heading-style": {
"style": "consistent"
}
};
assert(configuration);
const configurationStrict: markdownlint.ConfigurationStrict = {
// "custom-rule": true,
"no-hard-tabs": false,
"heading-style": {
"style": "consistent"
}
};
assert(configurationStrict);
Loading

0 comments on commit 9c8e715

Please # to comment.