{"id":13784001,"url":"https://github.com/eslint/markdown","last_synced_at":"2025-05-14T07:08:32.493Z","repository":{"id":34451349,"uuid":"38386462","full_name":"eslint/markdown","owner":"eslint","description":"Lint JavaScript code blocks in Markdown documents","archived":false,"fork":false,"pushed_at":"2025-05-12T12:12:49.000Z","size":516,"stargazers_count":448,"open_issues_count":18,"forks_count":69,"subscribers_count":21,"default_branch":"main","last_synced_at":"2025-05-12T12:44:23.400Z","etag":null,"topics":["development","ecmascript","eslint","javascript","linter","markdown","static-code-analysis"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eslint.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"eslint","open_collective":"eslint","tidelift":"npm/eslint"}},"created_at":"2015-07-01T18:00:13.000Z","updated_at":"2025-05-10T13:34:02.000Z","dependencies_parsed_at":"2023-02-15T13:46:07.293Z","dependency_job_id":"dfcb14d7-4095-4406-80b2-6d0566a3e745","html_url":"https://github.com/eslint/markdown","commit_stats":{"total_commits":219,"total_committers":34,"mean_commits":"6.4411764705882355","dds":0.7899543378995434,"last_synced_commit":"92c3353cf2c4d420987bbec55c98fc82d93765a8"},"previous_names":["eslint/markdown"],"tags_count":36,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eslint%2Fmarkdown","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eslint%2Fmarkdown/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eslint%2Fmarkdown/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eslint%2Fmarkdown/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eslint","download_url":"https://codeload.github.com/eslint/markdown/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253744846,"owners_count":21957311,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["development","ecmascript","eslint","javascript","linter","markdown","static-code-analysis"],"created_at":"2024-08-03T19:00:34.216Z","updated_at":"2025-05-14T07:08:32.480Z","avatar_url":"https://github.com/eslint.png","language":"JavaScript","readme":"# ESLint Markdown Language Plugin\n\n[![npm Version](https://img.shields.io/npm/v/@eslint/markdown.svg)](https://www.npmjs.com/package/@eslint/markdown)\n[![Downloads](https://img.shields.io/npm/dm/@eslint/markdown.svg)](https://www.npmjs.com/package/@eslint/markdown)\n[![Build Status](https://github.com/eslint/markdown/workflows/CI/badge.svg)](https://github.com/eslint/markdown/actions)\n\nLint JS, JSX, TypeScript, and more inside Markdown.\n\n\u003cimg\n    src=\"screenshot.png\"\n    height=\"142\"\n    width=\"432\"\n    alt=\"A JS code snippet in a Markdown editor has red squiggly underlines. A tooltip explains the problem.\"\n/\u003e\n\n## Usage\n\n### Installing\n\nInstall the plugin alongside ESLint v9 or greater:\n\n```sh\nnpm install --save-dev eslint @eslint/markdown\n```\n\n### Configurations\n\n| **Configuration Name** | **Description** |\n|---------------|-----------------|\n| `recommended` | Lints all `.md` files with the recommended rules and assumes [CommonMark](https://commonmark.org/) format. |\n| `processor` | Enables extracting code blocks from all `.md` files so code blocks can be individually linted. |\n\nIn your `eslint.config.js` file, import `@eslint/markdown` and include the recommended config to enable Markdown parsing and linting:\n\n```js\n// eslint.config.js\nimport { defineConfig } from \"eslint/config\";\nimport markdown from \"@eslint/markdown\";\n\nexport default defineConfig([\n    markdown.configs.recommended\n\n    // your other configs here\n]);\n```\n\nYou can also modify the recommended config by using `extends`:\n\n```js\n// eslint.config.js\nimport { defineConfig } from \"eslint/config\";\nimport markdown from \"@eslint/markdown\";\n\nexport default defineConfig([\n    {\n        plugins: {\n            markdown\n        },\n        extends: [\"markdown/recommended\"],\n        rules: {\n            \"markdown/no-html\": \"error\"\n        }\n    }\n\n    // your other configs here\n]);\n```\n\n### Rules\n\n\u003c!-- NOTE: The following table is autogenerated. Do not manually edit. --\u003e\n\n\u003c!-- Rule Table Start --\u003e\n| **Rule Name** | **Description** | **Recommended** |\n| :- | :- | :-: |\n| [`fenced-code-language`](./docs/rules/fenced-code-language.md) | Require languages for fenced code blocks | yes |\n| [`heading-increment`](./docs/rules/heading-increment.md) | Enforce heading levels increment by one | yes |\n| [`no-duplicate-headings`](./docs/rules/no-duplicate-headings.md) | Disallow duplicate headings in the same document | no |\n| [`no-empty-images`](./docs/rules/no-empty-images.md) | Disallow empty images | yes |\n| [`no-empty-links`](./docs/rules/no-empty-links.md) | Disallow empty links | yes |\n| [`no-html`](./docs/rules/no-html.md) | Disallow HTML tags | no |\n| [`no-invalid-label-refs`](./docs/rules/no-invalid-label-refs.md) | Disallow invalid label references | yes |\n| [`no-missing-label-refs`](./docs/rules/no-missing-label-refs.md) | Disallow missing label references | yes |\n\u003c!-- Rule Table End --\u003e\n\n**Note:** This plugin does not provide formatting rules. We recommend using a source code formatter such as [Prettier](https://prettier.io) for that purpose.\n\nIn order to individually configure a rule in your `eslint.config.js` file, import `@eslint/markdown` and configure each rule with a prefix:\n\n```js\n// eslint.config.js\nimport { defineConfig } from \"eslint/config\";\nimport markdown from \"@eslint/markdown\";\n\nexport default defineConfig([\n    {\n        files: [\"**/*.md\"],\n        plugins: {\n            markdown\n        },\n        language: \"markdown/commonmark\",\n        rules: {\n            \"markdown/no-html\": \"error\"\n        }\n    }\n]);\n```\n\nYou can individually disable rules in Markdown using HTML comments, such as:\n\n```markdown\n\u003c!-- eslint-disable-next-line markdown/no-html -- I want to allow HTML here --\u003e\n\u003ccustom-element\u003eHello world!\u003c/custom-element\u003e\n\n\u003c!-- eslint-disable markdown/no-html -- here too --\u003e\n\u003canother-element\u003eGoodbye world!\u003c/another-element\u003e\n\u003c!-- eslint-enable markdown/no-html -- safe to re-enable now --\u003e\n\n[Object] \u003c!-- eslint-disable-line markdown/no-missing-label-refs -- not meant to be a link ref --\u003e\n```\n\n### Languages\n\n| **Language Name** | **Description** |\n|---------------|-----------------|\n| `commonmark` | Parse using [CommonMark](https://commonmark.org) Markdown format | \n| `gfm` | Parse using [GitHub-Flavored Markdown](https://github.github.com/gfm/) format | \n\nIn order to individually configure a language in your `eslint.config.js` file, import `@eslint/markdown` and configure a `language`:\n\n```js\n// eslint.config.js\nimport { defineConfig } from \"eslint/config\";\nimport markdown from \"@eslint/markdown\";\n\nexport default defineConfig([\n    {\n        files: [\"**/*.md\"],\n        plugins: {\n            markdown\n        },\n        language: \"markdown/gfm\",\n        rules: {\n            \"markdown/no-html\": \"error\"\n        }\n    }\n]);\n```\n\n### Language Options\n\n#### Enabling Front Matter in both `commonmark` and `gfm`\n\nBy default, Markdown parsers do not support [front matter](https://jekyllrb.com/docs/front-matter/). To enable front matter in both `commonmark` and `gfm`, you can use the `frontmatter` option in `languageOptions`.  \n\n\u003e `@eslint/markdown` internally uses [`micromark-extension-frontmatter`](https://github.com/micromark/micromark-extension-frontmatter) and [`mdast-util-frontmatter`](https://github.com/syntax-tree/mdast-util-frontmatter) to parse front matter.\n\n| **Option Value** | **Description**                                            |\n|------------------|------------------------------------------------------------|\n| `false`          | Disables front matter parsing in Markdown files. (Default) |\n| `\"yaml\"`         | Enables YAML front matter parsing in Markdown files.       |\n| `\"toml\"`         | Enables TOML front matter parsing in Markdown files.       |\n\n```js\n// eslint.config.js\nimport { defineConfig } from \"eslint/config\";\nimport markdown from \"@eslint/markdown\";\n\nexport default defineConfig([\n    {\n        files: [\"**/*.md\"],\n        plugins: {\n            markdown\n        },\n        language: \"markdown/gfm\",\n        languageOptions: {\n            frontmatter: \"yaml\", // Or pass `\"toml\"` to enable TOML front matter parsing.\n        },\n        rules: {\n            \"markdown/no-html\": \"error\"\n        }\n    }\n]);\n```\n\n### Processors\n\n| **Processor Name** | **Description** |\n|---------------|-----------------|\n| [`markdown`](./docs/processors/markdown.md) | Extract fenced code blocks from the Markdown code so they can be linted separately. | \n\n## Editor Integrations\n\n### VSCode\n\n[`vscode-eslint`](https://github.com/microsoft/vscode-eslint) has built-in support for the Markdown processor.\n\n## File Name Details\n\nThis processor will use file names from blocks if a `filename` meta is present.\n\nFor example, the following block will result in a parsed file name of `src/index.js`:\n\n````md\n```js filename=\"src/index.js\"\nexport const value = \"Hello, world!\";\n```\n````\n\nThis can be useful for user configurations that include linting overrides for specific file paths. In this example, you could then target the specific code block in your configuration using `\"file-name.md/*src/index.js\"`.\n\n## Contributing\n\n```sh\n$ git clone https://github.com/eslint/markdown.git\n$ cd markdown\n$ npm install\n$ npm test\n```\n\nThis project follows the [ESLint contribution guidelines](https://eslint.org/docs/latest/contribute/).\n\n\u003c!-- NOTE: This section is autogenerated. Do not manually edit.--\u003e\n\u003c!--sponsorsstart--\u003e\n\n## Sponsors\n\nThe following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)\nto get your logo on our READMEs and [website](https://eslint.org/sponsors).\n\n\u003ch3\u003eDiamond Sponsors\u003c/h3\u003e\n\u003cp\u003e\u003ca href=\"https://www.ag-grid.com/\"\u003e\u003cimg src=\"https://images.opencollective.com/ag-grid/bec0580/logo.png\" alt=\"AG Grid\" height=\"128\"\u003e\u003c/a\u003e\u003c/p\u003e\u003ch3\u003ePlatinum Sponsors\u003c/h3\u003e\n\u003cp\u003e\u003ca href=\"https://automattic.com\"\u003e\u003cimg src=\"https://images.opencollective.com/automattic/d0ef3e1/logo.png\" alt=\"Automattic\" height=\"128\"\u003e\u003c/a\u003e \u003ca href=\"https://www.airbnb.com/\"\u003e\u003cimg src=\"https://images.opencollective.com/airbnb/d327d66/logo.png\" alt=\"Airbnb\" height=\"128\"\u003e\u003c/a\u003e\u003c/p\u003e\u003ch3\u003eGold Sponsors\u003c/h3\u003e\n\u003cp\u003e\u003ca href=\"https://qlty.sh/\"\u003e\u003cimg src=\"https://images.opencollective.com/qltysh/33d157d/logo.png\" alt=\"Qlty Software\" height=\"96\"\u003e\u003c/a\u003e \u003ca href=\"https://trunk.io/\"\u003e\u003cimg src=\"https://images.opencollective.com/trunkio/fb92d60/avatar.png\" alt=\"trunk.io\" height=\"96\"\u003e\u003c/a\u003e \u003ca href=\"https://shopify.engineering/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/8085\" alt=\"Shopify\" height=\"96\"\u003e\u003c/a\u003e\u003c/p\u003e\u003ch3\u003eSilver Sponsors\u003c/h3\u003e\n\u003cp\u003e\u003ca href=\"https://vite.dev/\"\u003e\u003cimg src=\"https://images.opencollective.com/vite/e6d15e1/logo.png\" alt=\"Vite\" height=\"64\"\u003e\u003c/a\u003e \u003ca href=\"https://liftoff.io/\"\u003e\u003cimg src=\"https://images.opencollective.com/liftoff/5c4fa84/logo.png\" alt=\"Liftoff\" height=\"64\"\u003e\u003c/a\u003e \u003ca href=\"https://americanexpress.io\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/3853301\" alt=\"American Express\" height=\"64\"\u003e\u003c/a\u003e \u003ca href=\"https://stackblitz.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/28635252\" alt=\"StackBlitz\" height=\"64\"\u003e\u003c/a\u003e\u003c/p\u003e\u003ch3\u003eBronze Sponsors\u003c/h3\u003e\n\u003cp\u003e\u003ca href=\"https://cybozu.co.jp/\"\u003e\u003cimg src=\"https://images.opencollective.com/cybozu/933e46d/logo.png\" alt=\"Cybozu\" height=\"32\"\u003e\u003c/a\u003e \u003ca href=\"https://www.crosswordsolver.org/anagram-solver/\"\u003e\u003cimg src=\"https://images.opencollective.com/anagram-solver/2666271/logo.png\" alt=\"Anagram Solver\" height=\"32\"\u003e\u003c/a\u003e \u003ca href=\"https://icons8.com/\"\u003e\u003cimg src=\"https://images.opencollective.com/icons8/7fa1641/logo.png\" alt=\"Icons8\" height=\"32\"\u003e\u003c/a\u003e \u003ca href=\"https://discord.com\"\u003e\u003cimg src=\"https://images.opencollective.com/discordapp/f9645d9/logo.png\" alt=\"Discord\" height=\"32\"\u003e\u003c/a\u003e \u003ca href=\"https://www.gitbook.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/7111340\" alt=\"GitBook\" height=\"32\"\u003e\u003c/a\u003e \u003ca href=\"https://nolebase.ayaka.io\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/11081491\" alt=\"Neko\" height=\"32\"\u003e\u003c/a\u003e \u003ca href=\"https://nx.dev\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/23692104\" alt=\"Nx\" height=\"32\"\u003e\u003c/a\u003e \u003ca href=\"https://opensource.mercedes-benz.com/\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/34240465\" alt=\"Mercedes-Benz Group\" height=\"32\"\u003e\u003c/a\u003e \u003ca href=\"https://herocoders.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/37549774\" alt=\"HeroCoders\" height=\"32\"\u003e\u003c/a\u003e \u003ca href=\"https://www.lambdatest.com\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/171592363\" alt=\"LambdaTest\" height=\"32\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003ch3\u003eTechnology Sponsors\u003c/h3\u003e\nTechnology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.\n\u003cp\u003e\u003ca href=\"https://netlify.com\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg\" alt=\"Netlify\" height=\"32\"\u003e\u003c/a\u003e \u003ca href=\"https://algolia.com\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg\" alt=\"Algolia\" height=\"32\"\u003e\u003c/a\u003e \u003ca href=\"https://1password.com\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg\" alt=\"1Password\" height=\"32\"\u003e\u003c/a\u003e\u003c/p\u003e\n\u003c!--sponsorsend--\u003e\n","funding_links":["https://github.com/sponsors/eslint","https://opencollective.com/eslint","https://tidelift.com/funding/github/npm/eslint"],"categories":["JavaScript","Built on remark"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feslint%2Fmarkdown","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feslint%2Fmarkdown","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feslint%2Fmarkdown/lists"}