feat(lint-md-core): upgrade @lint-md/cli to @lint-md/core v2#23
Merged
Conversation
- Replace @lint-md/cli ^0.1.8 with @lint-md/core ^2.1.2 + glob ^13.0.6 - Rewrite lint-md-action.ts to use lintMarkdown API from @lint-md/core - Implement file loading with glob (directory recursion, excludeFiles) - Update rule names: space-round-alphabet -> space-around-alphabet - Remove obsolete src/@lint-md/cli.d.ts (core includes types) - Update tests to match new API (ReportOption format) - Update README.md with new version and rule names - Rebuild dist/index.js
- Replace LintResultWithPath (extends ReportOption) with proper LintResultItem
interface that includes severity field from lintMarkdown return type
- Add FileLintResult interface with { path, errors[] } structure
- Update getErrors() to return FileLintResult[] (grouped by file)
- Update isPass() to flatten fileResults before filtering
- Rebuild dist/index.js
glob v13 returns only the directory path itself (not its contents) when given a bare directory. The extension filter then removes it since it doesn't end with .md. Detect directories via fs.statSync and append /**/* so glob recurses into them.
The new API stores the full file path (e.g., .../bad.md) instead of just the directory. Update 3 test assertions to match.
space-round-alphabet → space-around-alphabet (v2 rule rename)
Missing config file is normal (most users use default rules), not a warning condition. Use core.info instead of core.warning.
- package.json version 0.1.2 → 0.2.0 (align with README) - lint(): reset fileResults on each call to prevent accumulation - Add test: directory recursion (files as directory path) - Add test: glob pattern matching (files as specific .md path) - Add test: excludeFiles exclusion via .lintmdrc config - Add examples/.lintmdrc for excludeFiles test fixture
…s test './*' after path.resolve becomes '/.../examples/./*' which glob can't parse with absolute: true. Use './' (directory) so the loadMdFiles directory-expansion logic kicks in.
- Remove Yarn-specific files (.pnp.cjs, .pnp.loader.mjs, .yarn/, yarn.lock) - Update .gitignore: remove yarn.lock and .yarnrc.yml, un-ignore package-lock.json - Generate fresh package-lock.json with npm install - Update CI build.yml: yarn install → npm ci, yarn test → npm test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
变更内容
验证
Closes #22