eslint / markdown

Lint JavaScript code blocks in Markdown documents
MIT License
406 stars 63 forks source link

feat: Support different names for code block languages #245

Closed DMartens closed 6 months ago

DMartens commented 7 months ago

Currently the processor uses the raw language of the code block for the file extension of the block. This works for using js as language but not for javascript or node as the resulting blocks would be excluded as the linter thinks they do not contain JavaScript. It would be great for if there would be a normalization for mapping the code block language to the blocks file extension:

javascript -> js
node       -> js
ecmascript -> js
typescript -> ts
markdown   -> md
nzakas commented 7 months ago

That seems reasonable to me. Would you like to submit a PR for that?

nzakas commented 7 months ago

TSC Summary: This change seeks to use recognizable filename extensions for common code block types like node, javascript, ecmascript to .js, markdown to .md, and typescript to .ts. Currently, the plugin would use the code block type as the filename extension, so javascript becomes 0.javascript, which is a bit confusing.

TSC Question: This represents a breaking change, do we want to accept this and publish a new major version?

sam3k commented 7 months ago

Per TSC 2024-04-04 meeting, we've agreed to accept this proposal but will omit node option at this time.