8000 fix: use unified `performSyncWork` for parsing with remark config by JounQin · Pull Request #583 · mdx-js/eslint-mdx · GitHub
[go: up one dir, main page]

Skip to content

fix: use unified performSyncWork for parsing with remark config #583

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 14, 2025

Conversation

JounQin
Copy link
Member
@JounQin JounQin commented Jun 14, 2025

Initial checklist

  • I read the support docs
  • I read the contributing guide
  • I agree to follow the code of conduct
  • I searched issues and discussions and couldn’t find anything or linked relevant results below
  • I made sure the docs are up to date
  • I included tests (or that’s not needed)

Description of changes

close #576

@JounQin JounQin requested a review from Copilot June 14, 2025 03:58
@JounQin JounQin self-assigned this Jun 14, 2025
@JounQin JounQin added the 🐛 type/bug This is a problem label Jun 14, 2025
Copy link
changeset-bot bot commented Jun 14, 2025

🦋 Changeset detected

Latest commit: 58db688

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
eslint-plugin-mdx Patch
eslint-mdx Patch

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

Copy link
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR unifies the parsing logic to use performSyncWork with the remark config and removes the redundant fromMarkdown function. Key changes include:

  • Adding a new MDX test fixture (576.mdx) with mathematical syntax and updating associated snapshots.
  • Updating the markdown processor to use performSyncWork and introducing a helper function to resolve on-disk file paths.
  • Removing the fromMarkdown module and updating package.json with the new remark-math dependency.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/fixtures/576.mdx New MDX fixture with LaTeX and inline math syntax
test/snapshots/parser.test.ts.snap Updated snapshot for 576.mdx
test/snapshots/fixtures.test.ts.snap Updated fixture snapshot for 576.mdx
packages/eslint-plugin-mdx/src/processors/markdown.ts Updated parser logic to use performSyncWork and added getOnDiskFilepath helper
packages/eslint-plugin-mdx/src/from-markdown.ts Removed redundant fromMarkdown functionality
package.json Added remark-math dependency and updated remarkConfig plugins

Copy link
codesandbox-ci bot commented Jun 14, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Contributor
github-actions bot commented Jun 14, 2025

📊 Package size report   No changes

File Before After
Total (Includes all files) 4.4 MB 4.4 MB
Tarball size 1.2 MB 1.2 MB
Unchanged files
File Size
.babelrc 35 B
.changeset/config.json 372 B
.changeset/legal-pears-fail.md 122 B
.changeset/README.md 510 B
.codesandbox/ci.json 76 B
.editorconfig 145 B
.env.yarn 44 B
.gitattributes 35 B
.github/FUNDING.yml 204 B
.github/workflows/ci.yml 1.6 kB
.github/workflows/codeql.yml 1.1 kB
.github/workflows/pkg-size.yml 871 B
.github/workflows/release.yml 1.3 kB
.nano-staged.js 48 B
.prettierignore 38 B
.renovaterc 49 B
.simple-git-hooks.js 49 B
.yarn/plugins/plugin-prepare-lifecycle.cjs 202 B
.yarn/releases/yarn-4.9.2.cjs 3.0 MB
.yarnrc.yml 397 B
CHANGELOG.md 283 B
CONTRIBUTING.md 931 B
eslint.config.js 1.3 kB
LICENSE 1.1 kB
package.json 3.3 kB
packages/eslint-mdx/CHANGELOG.md 28.1 kB
packages/eslint-mdx/index.d.cts 52 B
packages/eslint-mdx/package.json 1.6 kB
packages/eslint-mdx/README.md 12.2 kB
packages/eslint-mdx/shim.d.ts 1.2 kB
packages/eslint-mdx/src/helpers.ts 3.4 kB
packages/eslint-mdx/src/index.ts 141 B
packages/eslint-mdx/src/meta.ts 206 B
packages/eslint-mdx/src/parser.ts 2.5 kB
packages/eslint-mdx/src/sync.ts 404 B
packages/eslint-mdx/src/tokens.ts 6.8 kB
packages/eslint-mdx/src/types.ts 2.2 kB
packages/eslint-mdx/src/worker.ts 23.0 kB
packages/eslint-mdx/tsconfig.json 166 B
packages/eslint-plugin-mdx/CHANGELOG.md 32.1 kB
packages/eslint-plugin-mdx/index.d.cts 52 B
packages/eslint-plugin-mdx/package.json 1.4 kB
packages/eslint-plugin-mdx/README.md 12.2 kB
packages/eslint-plugin-mdx/src/configs/base.ts 311 B
packages/eslint-plugin-mdx/src/configs/code-blocks.ts 1.1 kB
packages/eslint-plugin-mdx/src/configs/flat.ts 818 B
packages/eslint-plugin-mdx/src/configs/index.ts 454 B
packages/eslint-plugin-mdx/src/configs/overrides.ts 781 B
packages/eslint-plugin-mdx/src/configs/recommended.ts 1.5 kB
packages/eslint-plugin-mdx/src/from-markdown.ts 291 B
packages/eslint-plugin-mdx/src/helpers.ts 795 B
packages/eslint-plugin-mdx/src/index.ts 161 B
packages/eslint-plugin-mdx/src/meta.ts 207 B
packages/eslint-plugin-mdx/src/processors/helpers.ts 753 B
packages/eslint-plugin-mdx/src/processors/index.ts 218 B
packages/eslint-plugin-mdx/src/processors/markdown.ts 14.8 kB
packages/eslint-plugin-mdx/src/processors/options.ts 1.6 kB
packages/eslint-plugin-mdx/src/processors/remark.ts 1.9 kB
packages/eslint-plugin-mdx/src/processors/types.ts 464 B
packages/eslint-plugin-mdx/src/rules/index.ts 149 B
packages/eslint-plugin-mdx/src/rules/remark.ts 3.6 kB
packages/eslint-plugin-mdx/src/rules/types.ts 430 B
packages/eslint-plugin-mdx/src/worker.ts 403 B
packages/eslint-plugin-mdx/tsconfig.json 153 B
patches/@1stg+eslint-config+10.1.0.patch 3.2 kB
README.md 12.2 kB
test/__snapshots__/fixtures.test.ts.snap 45.4 kB
test/__snapshots__/parser.test.ts.snap 1.1 MB
test/fixtures.test.ts 3.2 kB
test/fixtures/287.mdx 204 B
test/fixtures/292.mdx 191 B
test/fixtures/334.mdx 70 B
test/fixtures/336.mdx 178 B
test/fixtures/367.mdx 87 B
test/fixtures/371.mdx 75 B
test/fixtures/380.mdx 11.0 kB
test/fixtures/391.mdx 62 B
test/fixtures/429.mdx 52 B
test/fixtures/435.mdx 134 B
test/fixtures/437.mdx 32 B
test/fixtures/445.mdx 188 B
test/fixtures/450.mdx 417 B
test/fixtures/488.mdx 78 B
test/fixtures/acorn.mdx 860 B
test/fixtures/adjacent.mdx 50 B
test/fixtures/async/.remarkrc 67 B
test/fixtures/async/test.md 15 B
test/fixtures/basic.mdx 405 B
test/fixtures/basic.tsx 77 B
test/fixtures/blank-lines.mdx 768 B
test/fixtures/code-blocks/278.md 511 B
test/fixtures/code-blocks/455.mdx 95 B
test/fixtures/code-blocks/470.mdx 88 B
test/fixtures/code-blocks/534.mdx 735 B
test/fixtures/comments.mdx 162 B
test/fixtures/details.mdx 881 B
test/fixtures/dir.mdx/.gitkeep 0 B
test/fixtures/esm/.remarkrc.mjs 103 B
test/fixtures/esm/test.md 15 B
test/fixtures/jsx-in-list.mdx 810 B
test/fixtures/leading-spaces.mdx 42 B
test/fixtures/markdown.md 5 B
test/fixtures/no-unescaped-entities.mdx 99 B
test/fixtures/no-unused-expressions.mdx 90 B
test/fixtures/processor.mdx 13 B
test/fixtures/remark.md 171 B
test/fixtures/remark.mdx 169 B
test/fixtures/style/.remarkrc 228 B
test/fixtures/style/nested.md 10 B
test/fixtures/style/plugin1.cjs 26 B
test/fixtures/style/plugin2.mjs 24 B
test/fixtures/unicorn.jsx 119 B
test/fixtures/unicorn.mdx 118 B
test/helpers.test.ts 874 B
test/helpers.ts 954 B
test/jest.serializer.cjs 347 B
test/jest.serializer.d.cts 143 B
test/jest.serializer.test.ts 527 B
test/parser.test.ts 4.7 kB
test/remark.test.ts 2.9 kB
tsconfig.base.json 253 B
tsconfig.json 213 B
tsconfig.lib.json 286 B

🤖 This report was automatically generated by pkg-size-action

Copy link
codecov bot commented Jun 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (27da917) to head (58db688).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #583   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        19    -1     
  Lines          272       274    +2     
  Branches        46        49    +3     
=========================================
+ Hits           272       274    +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@JounQin JounQin force-pushed the fix/preprocess_parse branch from 63a068a to 0a2f744 Compare June 14, 2025 04:02
@JounQin JounQin force-pushed the fix/preprocess_parse branch from 0a2f744 to 58db688 Compare June 14, 2025 04:05
@JounQin JounQin merged commit 8c9ef4b into master Jun 14, 2025
55 checks passed
@JounQin JounQin deleted the fix/preprocess_parse branch June 14, 2025 04:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 type/bug This is a problem
Development

Successfully merging this pull request may close these issues.

Parse errors occur on formulas with remark-math
1 participant
0