feat: add support for Markdown Front Matter parsing#92
Merged
nzakas merged 5 commits intoApr 23, 2025
Conversation
✅ Deploy Preview for eslint-code-explorer ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
Member
|
This is looking good. Can you please check the CI failures? |
There was a problem hiding this comment.
Pull Request Overview
This pull request adds support for Markdown Front Matter parsing in code-explorer by introducing a new front matter option that supports "yaml" and "toml" formats as well as an "off" setting.
- Added a new constant array for front matter options in src/lib/const.ts
- Extended option types in src/hooks/use-explorer.ts and enabled corresponding parsing in src/hooks/use-ast.ts
- Updated the options component in src/components/options.tsx to include a front matter selection dropdown
Reviewed Changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/lib/const.ts | Introduced markdownFrontmatters constant and updated defaultMarkdownOptions |
| src/hooks/use-explorer.ts | Added MarkdownFrontmatter type |
| src/hooks/use-ast.ts | Updated AST parsing to use front matter setting |
| src/components/options.tsx | Added LabeledSelect for markdownFrontmatter |
Files not reviewed (1)
- package.json: Language not supported
Comments suppressed due to low confidence (1)
src/lib/const.ts:193
- [nitpick] The constant name 'markdownFrontmatters' is inconsistent with the singular option property 'markdownFrontmatter' used elsewhere. Consider renaming it (e.g., 'markdownFrontmatterOptions') for improved clarity.
export const markdownFrontmatters = [
lumirlumir
commented
Apr 22, 2025
…ithub.com/lumirlumir/fork-code-explorer into feat-support-markdown-frontmatter-parsing
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.
Prerequisites checklist
What is the purpose of this pull request?
Hello,
I've added support for Markdown Front Matter parsing in code-explorer!
This feature leverages the newly introduced Front Matter parsing capability in
@eslint/markdown@6.4.0. (eslint/markdown#328)code-explorer now supports parsing Front Matter in both
yamlandtomlformats.yamltomlWhat changes did you make? (Give an overview)
I've added
markdownFrontmatteroptions to properly parse bothyamlandtomlfront matter.I've also introduced an
Offoption, which is interpreted as the booleanfalse.Related Issues
eslint/markdown#328
Is there anything you'd like reviewers to focus on?