mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2026-04-26 01:36:03 +03:00
[PR #1014] [CLOSED] Implement TypeScript type generation for the configuration #1163
Labels
No labels
bug
enhancement
enhancement
enhancement
fixed in next
fixed in next
fixed in next
new rule
new rule
new rule
pull-request
question
refactoring
refactoring
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/markdownlint#1163
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/DavidAnson/markdownlint/pull/1014
Author: @Lehoczky
Created: 10/21/2023
Status: ❌ Closed
Base:
next← Head:next📝 Commits (3)
cb40a37Implement TypeScript type generation for the configuratione32742apin quicktype dependency1473defFix typo📊 Changes
11 files changed (+1535 additions, -26 deletions)
View changed files
📝
.eslintrc.json(+8 -0)📝
.gitignore(+1 -0)📝
demo/markdownlint-browser.js(+19 -7)📝
lib/markdownlint.d.ts(+14 -8)📝
lib/markdownlint.js(+19 -7)📝
micromark/exports-html.mjs(+1 -1)📝
micromark/exports.mjs(+0 -2)📝
package.json(+4 -1)➕
schema/build-config-declaration.js(+191 -0)➕
schema/markdownlint-config.d.ts(+1268 -0)📝
test/markdownlint-test.js(+10 -0)📄 Description
Resolves #1004
📚Description
This PR adds a new script to the project:
schema/build-config-declaration.js. The script takes the existing configuration schema, and generated a new filemarkdownlint-config.d.tswith type declaration for the config. This script now runs as part of thebuild-declarationnpm script.The generated type is then used in the
libs/markdownlint.jsfile to enrich the existingConfigurationtype:With this change, the functions that already used this type now has proper suggestions:
A new
defineConfig()function was added as well to make it easier to define configurations injsfiles, like vite, astro or nuxt does.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.