feat: add fenced-code-meta rule#512
Conversation
There was a problem hiding this comment.
Pull Request Overview
This pull request introduces a new ESLint rule fenced-code-meta that enforces consistent policies for metadata in fenced code block info strings. The rule can either require metadata when a language is specified ("always" mode) or disallow metadata entirely ("never" mode).
- Added a new rule that validates the presence or absence of metadata in fenced code blocks
- Comprehensive test coverage for both backtick and tilde fenced code blocks with various configurations
- Complete documentation with examples and usage guidelines
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/rules/fenced-code-meta.js |
Implements the core rule logic for validating fenced code block metadata |
tests/rules/fenced-code-meta.test.js |
Comprehensive test suite covering valid and invalid cases for both rule modes |
docs/rules/fenced-code-meta.md |
User documentation with examples and configuration options |
README.md |
Updates rule table and formatting improvements for ESLint disable comments |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
nzakas
left a comment
There was a problem hiding this comment.
Thanks for working on this. Overall it looks good. I think the Copilot comments bring up good points, so please take a look at those. Also, double-check the CI errors.
nzakas
left a comment
There was a problem hiding this comment.
LGTM. Would like another review before merging.
|
@TKDev7 when you're available again, please take a look at the comments here. |
lumirlumir
left a comment
There was a problem hiding this comment.
LGTM, thanks!
Would like @snitin315 and @nzakas to verify the changes before merging.
Prerequisites checklist
What is the purpose of this pull request?
This pull request introduces a new rule,
fenced-code-meta, that enforces a consistent policy for metadata in fenced code block info strings. It allows teams to require metadata when a language is specified or to disallow metadata entirely.What changes did you make? (Give an overview)
Related Issues
Fixes #477
Is there anything you'd like reviewers to focus on?