Skip to content

Conversation

lumirlumir
Copy link
Member

@lumirlumir lumirlumir commented Apr 4, 2025

Hello,

This PR addresses issue eslint/rewrite#175.

I also added rollup-plugin-delete to fix the build issues in CI. It's the same plugin used in JSON's rollup.config.js.

Summary

When using IMarkdownSourceCode, we don't have access to methods like getParent, getAncestors, getText, and lines. To fix this, I replaced it with MarkdownSourceCode, which does provide those methods. This approach is already being used in the JSON plugin.

Fixes

Fixes: eslint/rewrite#175.

@eslint-github-bot eslint-github-bot bot added the bug label Apr 4, 2025
@lumirlumir lumirlumir marked this pull request as draft April 4, 2025 10:21
@lumirlumir lumirlumir marked this pull request as ready for review April 4, 2025 11:15
@lumirlumir lumirlumir changed the title fix: update type reference for MarkdownRuleDefinition fix: replace IMarkdownSourceCode with MarkdownSourceCode in MarkdownRuleDefinition Apr 4, 2025
@eslint-github-bot
Copy link

Hi @lumirlumir!, thanks for the Pull Request

The pull request title isn't properly formatted. We ask that you update the pull request title to match this format, as we use it to generate changelogs and automate releases.

  • The length of the commit message must be less than or equal to 72

To Fix: You can fix this problem by clicking 'Edit' next to the pull request title at the top of this page.

Read more about contributing to ESLint here

@lumirlumir lumirlumir changed the title fix: replace IMarkdownSourceCode with MarkdownSourceCode in MarkdownRuleDefinition fix: replace IMarkdownSourceCode with MarkdownSourceCode Apr 4, 2025
nzakas
nzakas previously approved these changes Apr 4, 2025
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks!

Would like @fasttime to review before merging.

@nzakas nzakas added this to Triage Apr 4, 2025
@nzakas nzakas moved this to Second Review Needed in Triage Apr 4, 2025
Copy link
Member

@fasttime fasttime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a merge conflict now.

@lumirlumir lumirlumir marked this pull request as draft April 5, 2025 07:26
@lumirlumir lumirlumir marked this pull request as ready for review April 6, 2025 09:14
@lumirlumir
Copy link
Member Author

lumirlumir commented Apr 6, 2025

@fasttime

I've removed the IMarkdownSourceCode interface and replaced it with MarkdownSourceCode in 6330ad4.

Let me know if you need anything else!

Copy link
Member

@fasttime fasttime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that there is a new merge conflict now in src/language/markdown-source-code.js.

@lumirlumir
Copy link
Member Author

@fasttime

I've exported the TextSourceCode type in 6a90d10.

It's now generic, with default options included!

@lumirlumir lumirlumir requested a review from fasttime April 8, 2025 12:39
@lumirlumir lumirlumir requested a review from fasttime April 9, 2025 11:24
Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM pending @fasttime's approval.

Copy link
Member

@fasttime fasttime left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@fasttime fasttime merged commit ec2846b into eslint:main Apr 10, 2025
15 checks passed
@github-project-automation github-project-automation bot moved this from Second Review Needed to Complete in Triage Apr 10, 2025
@lumirlumir lumirlumir deleted the fix-update-type-reference-for-markdownruledefinition branch April 10, 2025 07:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

Change Request: Support getParent, getAncestors, getText and lines as a optional values for SourceCodeBase interface
3 participants