Conversation
🦋 Changeset detectedLatest commit: d6334a0 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-authored-by: ota-meshi <16508807+ota-meshi@users.noreply.github.com>
Co-authored-by: ota-meshi <16508807+ota-meshi@users.noreply.github.com>
Co-authored-by: ota-meshi <16508807+ota-meshi@users.noreply.github.com>
- Change option names: listItem→list, tableRow→table, codeBlock→code - Replace null with "ignore" keyword for all options - Add new entity types: footnoteDefinition, html, frontmatter, math - Make all options ignorable using "ignore" keyword - Add nested configuration support for blockquote, list, footnoteDefinition - Add language-specific configuration for code and frontmatter - Fix ignoreUrls to match @stylistic/max-len behavior - Use sourceCode.getLoc() and sourceCode.lines instead of manual parsing - Remove categories from rule metadata - Update documentation with RFC status and nested options - Add rule to comparison table Co-authored-by: ota-meshi <16508807+ota-meshi@users.noreply.github.com>
Added rule to docs/appendix/comparison-with-markdownlint-rules.md. The code has been significantly refactored to use sourceCode methods, support nested/language-specific configs, and follow all requested patterns. Commit: 67c8d93 Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Try the Instant Preview in Online PlaygroundInstall the Instant Preview to Your LocalPublished Instant Preview Packages:
|
There was a problem hiding this comment.
Pull request overview
This pull request implements a new max-len rule that enforces configurable maximum line lengths for different Markdown entities. The rule addresses the need for better readability and maintainability in Markdown documentation by preventing overly long lines in various elements like headings, paragraphs, lists, blockquotes, tables, code blocks, frontmatter, footnote definitions, HTML blocks, and math blocks.
Key changes include:
- Implementation of entity-specific length limits with sensible defaults (80 for headings, 120 for others)
- Support for nested container configuration allowing different limits for entities within blockquotes, lists, and footnote definitions
- Language-specific configuration for code blocks and frontmatter
- URL detection to ignore lines containing URLs by default (similar to @stylistic/max-len)
- Code blocks ignored by default per maintainer feedback, with option to enable checking
Reviewed changes
Copilot reviewed 27 out of 27 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/rules/max-len.ts | Core rule implementation with option parsing, URL detection, and line length checking logic |
| src/utils/rules.ts | Integration of max-len rule into the rules array |
| src/rule-types.ts | TypeScript type definitions for rule options (incomplete - missing full container option types) |
| tests/src/rules/max-len.ts | Test harness using snapshot testing |
| tests/src/rules/snapshots/max-len.ts.eslintsnap | Snapshot file with expected test outputs |
| tests/fixtures/rules/max-len/valid/*.md | Valid test fixtures for code blocks, headings, paragraphs, tables, and URLs |
| tests/fixtures/rules/max-len/invalid/*.md | Invalid test fixtures for various entity types exceeding length limits |
| tests/fixtures/rules/max-len/invalid/*.json | Configuration files for invalid test fixtures |
| docs/rules/max-len.md | Comprehensive rule documentation (needs structural improvements for clarity) |
| docs/rules/index.md | Addition of rule to "Undefined Rules" section |
| docs/appendix/comparison-with-markdownlint-rules.md | Comparison entry mapping to markdownlint MD013 |
| README.md | Documentation updates with rule listing in "Undefined Rules" section |
| eslint.config.mjs | Added allowed anchor for GitHub markdown documentation link |
| .changeset/max-len.md | Changeset entry for the new rule |
|
@copilot Please respond to each outstanding comment. |
- Separate entity options from container options in documentation - Clarify that containers can configure all entity types, not just heading/paragraph - Add test coverage for nested container configuration - Add test coverage for language-specific code block configuration - Add test coverage for language-specific frontmatter configuration - Add test coverage for html, math, footnote definition entities - All 4293 tests passing (12 new tests added) Co-authored-by: ota-meshi <16508807+ota-meshi@users.noreply.github.com>
Addressed all three outstanding comments:
All changes in commit: 4c02fbb |
Addressing Bot Review Feedback
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.