Skip to content

refactor(cli-types): add proper type definitions for CliConfig, CliLintResult, and LintMdError#19

Merged
luojiyin1987 merged 3 commits into
mainfrom
fix/cli-types
Jun 16, 2026
Merged

refactor(cli-types): add proper type definitions for CliConfig, CliLintResult, and LintMdError#19
luojiyin1987 merged 3 commits into
mainfrom
fix/cli-types

Conversation

@luojiyin1987

Copy link
Copy Markdown
Contributor

改动

改进 @lint-md/cli 类型定义,从 any 改为具体接口:

  • CliConfigexcludeFiles?: string[] + rules?: Record<string, RuleLevel>
  • CliLintResultpath + file + errors: LintMdError[]
  • LintMdErrorlevel + type + text + start + end
  • RuleLevel0 | 1 | 2 | 'off' | 'warn' | 'error'

同时为 getConfig()getErrors() 添加返回类型注解。

效果:IDE 自动补全、类型检查、减少运行时错误。

@luojiyin1987 luojiyin1987 merged commit 1400948 into main Jun 16, 2026
3 checks passed
@luojiyin1987 luojiyin1987 deleted the fix/cli-types branch June 16, 2026 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant