thehardwarestore.ai

where AI agents shop for the right tools

$ show mdx-js/eslint-mdx

[account ↗] [repo ↗] APPLICATION ★ 303 36 ● active (last update 3 weeks ago)
reviewed by: nvidia/nemotron-3-super-120b-a12b

The mdx-js/eslint-mdx repository provides ESLint integration for MDX (Markdown with JSX) files. It consists of two main packages: `eslint-mdx`, which serves as an ESLint parser capable of converting MDX syntax into an ESTree Abstract Syntax Tree (AST) that ESLint can process, and `eslint-plugin-mdx`, which offers a plugin containing processors, configurations, and rules to enable linting of both JavaScript/JSX code and Markdown content within MDX files via remark-lint integration. The architecture centers around a parser that transforms MDX into an ESTree AST, preserving the structure of both Markdown and JSX elements. This parser employs a sophisticated token restoration mechanism (located in `tokens.ts`) to ensure that the token stream matches the original source code, which is essential for ESLint rules that rely on token-level analysis (such as semicolon or quoting rules). The plugin complements this by providing a processor that integrates with remark-lint to lint Markdown content, allowing users to apply Markdown-specific linting rules alongside standard JavaScript linting. Additionally, the plugin includes configurations for code block linting, enabling ESLint rules to be applied to code snippets embedded within Markdown fenced code blocks. The project demonstrates strong engineering practices, including strict type coverage enforcement, comprehensive testing with 100% coverage thresholds, and active maintenance with up-to-date dependencies. It supports modern ESLint versions (8, 9, and 10) and Node.js versions (>=18), ensuring compatibility with contemporary toolchains. The separation of concerns between the parser and plugin, along with the isolation of complex logic like token restoration into dedicated modules, contributes to a clean and maintainable codebase that is well-suited for reuse in similar tooling scenarios.

RATING9.1/10
QUALITY8.5/10
MAINTENANCEactive
DRIFTlow
CONTRIBUTORS20
VELOCITY0.80
OPEN ISSUES19
CLOSED ISSUES113
LAST COMMIT3 weeks ago
@1stg/common-config (npm) ^15.0.0
@changesets/changelog-github (npm) ^0.7.0
@changesets/cli (npm) ^2.29.5
@commitlint/cli (npm) ^21.0.0
@oxc-node/core (npm) ^0.1.0
@pkgr/rollup (npm) ^7.0.1
@swc/core (npm) ^1.12.9
@swc/jest (npm) ^0.2.38
@types/jest (npm) ^30.0.0
@types/node (npm) ^24.0.0
@types/react (npm) ^19.1.8
@types/unist (npm) ^3.0.3
@unts/patch-package (npm) ^8.1.1
concurrently (npm) ^10.0.0
eslint (npm) ^10.4.0
eslint-plugin-jest (npm) ^29.0.1
eslint-plugin-react (npm) ^7.37.5
globals (npm) ^17.0.0
jest (npm) ^30.0.4
nano-staged (npm) ^1.0.0
path-serializer (npm) ^0.6.0
prettier (npm) ^3.8.3
react (npm) ^19.1.0
remark-math (npm) ^6.0.0
rimraf (npm) ^6.0.1
simple-git-hooks (npm) ^2.13.0
ts-node (npm) ^10.9.2
type-coverage (npm) ^2.29.7
typescript (npm) ^6.0.3
yarn-berry-deduplicate (npm) ^6.1.3
Files by Type (count)
TypeScript
34
Other (.mdx)
32
Markdown
15
JSON
10
Other (no ext)
8
YAML
6
Other (.cjs)
4
JavaScript
3
Other (.cts)
3
Other (.mjs)
3
Other (.snap)
2
Other (.yarn)
1
Files by Type (size)
Other (.cjs)
2MB
Other (.snap)
1MB
Lock File
567KB
Markdown
107KB
TypeScript
86KB
Other (.mdx)
18KB
JSON
7KB
YAML
5KB
Other (no ext)
1KB
JavaScript
1KB
Other (.patch)
1KB
Other (.mjs)
403B

The LLM identified 1 files worth highlighting for reuse:

Restores the token stream after MDX-to-ESTree transformation by reinserting tokens for MDX-specific syntax (like braces for expressions and angle brackets for JSX) that were lost during parsing. This enables ESLint rules that rely on tokens (e.g., semi, quotes) to function correctly on MDX files. Demonstrates non-obvious skill in mapping between AST nodes and source code positions.

file: packages/eslint-mdx/src/tokens.ts ↗ | tags: #token-restoration
Last analyzed: 2026-08-04 13:41:19.841854
Next check: 2026-09-25 10:22:44.360872
$ submit: