commonmark / commonmark/commonmark.js

API for testing the type of a node

Open
#92 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.6k
Forks
231
Avg merge
2d 11h
Merged PRs (30d)
3

Description

Updating to use the recent changes we discussed I got bitten by the fact that I was using magic strings for comparing against Node.type, I suggest that Node expose constants for each type so that this can be avoided in the future and allows changing the type naming convention without impacting consumers of the AST.

I am happy to do the leg work, check tests/benchmarks and submit a PR if you agree this is a good move.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Node.type API and review the existing tests and benchmarks mentioned in the issue to understand how node types are currently compared. Done means exposing constants for each node type so consumers no longer need magic strings, with corresponding tests and benchmark checks.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.