{"name":"@eslint/markdown","version":"6.2.2","keywords":["eslint","eslintplugin","markdown","lint","linter"],"author":{"url":"https://github.com/btmills","name":"Brandon Mills"},"license":"MIT","_id":"@eslint/markdown@6.2.2","maintainers":[{"name":"openjsfoundation","email":"npm@openjsf.org"},{"name":"eslintbot","email":"nicholas@eslint.org"}],"homepage":"https://github.com/eslint/markdown#readme","bugs":{"url":"https://github.com/eslint/markdown/issues"},"dist":{"shasum":"6d0d5cbf2e570a3bbc063e2a5cb4840391dcb156","tarball":"http://registry-npm.ywwl.com/@eslint/markdown/download/@eslint/markdown-6.2.2.tgz","fileCount":7,"integrity":"sha512-U0/KgzI9BVUuHDQ9M2fuVgB0QZ1fSyzwm8jKmHr1dlsLHGHYzoeIA9yqLMdTbV3ivZfp6rTdt6zqre3TfNExUQ==","signatures":[{"sig":"MEUCIQCK9VXWr7yBTh1TCQFCvkZRb8dVmWu0m6fX5r2XPnARqQIgM7rU+RroxrEMZyps5pr1ul+RLJJeDyH0HB5jYwob+lo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@eslint%2fmarkdown@6.2.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":68517,"size":18243,"noattachment":false,"key":"/@eslint/markdown/-/@eslint/markdown-6.2.2.tgz"},"main":"dist/esm/index.js","type":"module","types":"dist/esm/index.d.ts","engines":{"node":"^18.18.0 || ^20.9.0 || >=21.1.0"},"exports":{".":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"}},"gitHead":"f874af3fdf64a9948ebb0525f233f1075bf7203b","scripts":{"fmt":"prettier --write .","lint":"eslint . && eslint -c eslint.config-content.js .","test":"c8 mocha \"tests/**/*.test.js\" --timeout 30000","build":"npm run build:rules && rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:update-rules-docs","prepare":"node ./npm-prepare.cjs && npm run build","lint:fix":"eslint --fix . && eslint --fix -c eslint.config-content.js .","test:jsr":"npx jsr@latest publish --dry-run","fmt:check":"prettier --check .","test:types":"tsc -p tests/types/tsconfig.json","build:rules":"node tools/build-rules.js","build:readme":"node tools/update-readme.js","build:dedupe-types":"node tools/dedupe-types.js dist/esm/index.js","build:update-rules-docs":"node tools/update-rules-docs.js"},"_npmUser":{"name":"eslintbot","email":"nicholas@eslint.org"},"gitHooks":{"pre-commit":"lint-staged"},"repository":{"url":"git+https://github.com/eslint/markdown.git","type":"git"},"_npmVersion":"10.9.2","description":"The official ESLint language plugin for Markdown","directories":{},"lint-staged":{"*.js":["eslint --fix","prettier --write"],"!(*.{js,md})":"prettier --write --ignore-unknown","{src/rules/*.js,tools/update-rules-docs.js,README.md}":"npm run build:update-rules-docs"},"_nodeVersion":"22.13.0","dependencies":{"@eslint/core":"^0.10.0","mdast-util-gfm":"^3.0.0","@eslint/plugin-kit":"^0.2.5","micromark-extension-gfm":"^3.0.0","mdast-util-from-markdown":"^2.0.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.2","got":"^14.4.2","chai":"^5.1.1","mocha":"^10.6.0","dedent":"^1.5.3","eslint":"^9.15.0","rollup":"^4.19.0","yorkie":"^2.0.0","globals":"^15.1.0","prettier":"^3.3.3","@eslint/js":"^9.4.0","typescript":"^5.5.4","lint-staged":"^15.2.9","@types/eslint":"^9.6.0","rollup-plugin-copy":"^3.5.0","eslint-config-eslint":"^11.0.0","eslint-plugin-eslint-plugin":"^6.3.2"},"_npmOperationalInternal":{"tmp":"tmp/markdown_6.2.2_1737671563123_0.6013228976409082","host":"s3://npm-registry-packages-npm-production"},"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 Markdown with ESLint, as well JS, JSX, TypeScript, and more inside Markdown.\n\n<img\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/>\n\n## Usage\n\n### Installing\n\nInstall the plugin alongside ESLint v9.15.0 or greater. Type compatibility is guaranteed with ESLint v9.39.0 or greater.\n\nFor Node.js and compatible runtimes:\n\n```sh\nnpm install @eslint/markdown -D\n# or\nyarn add @eslint/markdown -D\n# or\npnpm install @eslint/markdown -D\n# or\nbun add @eslint/markdown -D\n```\n\nFor Deno:\n\n```sh\ndeno add jsr:@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\t{\n\t\tfiles: [\"**/*.md\"],\n\t\tplugins: {\n\t\t\tmarkdown,\n\t\t},\n\t\textends: [\"markdown/recommended\"],\n\t},\n\t// 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\t{\n\t\tplugins: {\n\t\t\tmarkdown,\n\t\t},\n\t\textends: [\"markdown/recommended\"],\n\t\trules: {\n\t\t\t\"markdown/no-html\": \"error\",\n\t\t},\n\t},\n\n\t// your other configs here\n]);\n```\n\n### Rules\n\n<!-- NOTE: The following table is autogenerated. Do not manually edit. -->\n\n<!-- Rule Table Start -->\n\n| **Rule Name**                                                                  | **Description**                                                                                   | **Recommended** |\n| :----------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------ | :-------------: |\n| [`fenced-code-language`](./docs/rules/fenced-code-language.md)                 | Require languages for fenced code blocks                                                          |       yes       |\n| [`fenced-code-meta`](./docs/rules/fenced-code-meta.md)                         | Require or disallow metadata for fenced code blocks                                               |       no        |\n| [`heading-increment`](./docs/rules/heading-increment.md)                       | Enforce heading levels increment by one                                                           |       yes       |\n| [`no-bare-urls`](./docs/rules/no-bare-urls.md)                                 | Disallow bare URLs                                                                                |       no        |\n| [`no-duplicate-definitions`](./docs/rules/no-duplicate-definitions.md)         | Disallow duplicate definitions                                                                    |       yes       |\n| [`no-duplicate-headings`](./docs/rules/no-duplicate-headings.md)               | Disallow duplicate headings in the same document                                                  |       no        |\n| [`no-empty-definitions`](./docs/rules/no-empty-definitions.md)                 | Disallow empty definitions                                                                        |       yes       |\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-atx-heading-space`](./docs/rules/no-missing-atx-heading-space.md) | Disallow headings without a space after the hash characters                                       |       yes       |\n| [`no-missing-label-refs`](./docs/rules/no-missing-label-refs.md)               | Disallow missing label references                                                                 |       yes       |\n| [`no-missing-link-fragments`](./docs/rules/no-missing-link-fragments.md)       | Disallow link fragments that do not reference valid headings                                      |       yes       |\n| [`no-multiple-h1`](./docs/rules/no-multiple-h1.md)                             | Disallow multiple H1 headings in the same document                                                |       yes       |\n| [`no-reference-like-urls`](./docs/rules/no-reference-like-urls.md)             | Disallow URLs that match defined reference identifiers                                            |       yes       |\n| [`no-reversed-media-syntax`](./docs/rules/no-reversed-media-syntax.md)         | Disallow reversed link and image syntax                                                           |       yes       |\n| [`no-space-in-emphasis`](./docs/rules/no-space-in-emphasis.md)                 | Disallow spaces around emphasis markers                                                           |       yes       |\n| [`no-unused-definitions`](./docs/rules/no-unused-definitions.md)               | Disallow unused definitions                                                                       |       yes       |\n| [`require-alt-text`](./docs/rules/require-alt-text.md)                         | Require alternative text for images                                                               |       yes       |\n| [`table-column-count`](./docs/rules/table-column-count.md)                     | Disallow data rows in a GitHub Flavored Markdown table from having more cells than the header row |       yes       |\n\n<!-- Rule Table End -->\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\t{\n\t\tfiles: [\"**/*.md\"],\n\t\tplugins: {\n\t\t\tmarkdown,\n\t\t},\n\t\tlanguage: \"markdown/commonmark\",\n\t\trules: {\n\t\t\t\"markdown/no-html\": \"error\",\n\t\t},\n\t},\n]);\n```\n\nYou can individually disable rules in Markdown using HTML comments, such as:\n\n<!-- prettier-ignore-start -->\n```markdown\n<!-- eslint-disable-next-line markdown/no-html -- I want to allow HTML here -->\n<custom-element>Hello world!</custom-element>\n\n<!-- eslint-disable markdown/no-html -- here too -->\n<another-element>Goodbye world!</another-element>\n<!-- eslint-enable markdown/no-html -- safe to re-enable now -->\n\n[Object] <!-- eslint-disable-line markdown/no-missing-label-refs -- not meant to be a link ref -->\n```\n<!-- prettier-ignore-end -->\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\t{\n\t\tfiles: [\"**/*.md\"],\n\t\tplugins: {\n\t\t\tmarkdown,\n\t\t},\n\t\tlanguage: \"markdown/gfm\",\n\t\trules: {\n\t\t\t\"markdown/no-html\": \"error\",\n\t\t},\n\t},\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> `@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| `\"json\"`         | Enables JSON 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\t{\n\t\tfiles: [\"**/*.md\"],\n\t\tplugins: {\n\t\t\tmarkdown,\n\t\t},\n\t\tlanguage: \"markdown/gfm\",\n\t\tlanguageOptions: {\n\t\t\tfrontmatter: \"yaml\", // Or pass `\"toml\"` or `\"json\"` to enable TOML or JSON front matter parsing.\n\t\t},\n\t\trules: {\n\t\t\t\"markdown/no-html\": \"error\",\n\t\t},\n\t},\n]);\n```\n\n#### Enabling Math (LaTeX) in both `commonmark` and `gfm`\n\nBy default, Markdown parsers do not support [math](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions) ([LaTeX](https://www.latex-project.org/)). To enable math in both `commonmark` and `gfm`, you can use the `math` option in `languageOptions`.\n\n> `@eslint/markdown` internally uses [`micromark-extension-math`](https://github.com/micromark/micromark-extension-math) and [`mdast-util-math`](https://github.com/syntax-tree/mdast-util-math) to parse math.\n\n| **Option Value** | **Description**                                    |\n| ---------------- | -------------------------------------------------- |\n| `false`          | Disables math parsing in Markdown files. (Default) |\n| `true`           | Enables math 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\t{\n\t\tfiles: [\"**/*.md\"],\n\t\tplugins: {\n\t\t\tmarkdown,\n\t\t},\n\t\tlanguage: \"markdown/gfm\",\n\t\tlanguageOptions: {\n\t\t\tmath: true, // Or pass `false` to disable math parsing.\n\t\t},\n\t\trules: {\n\t\t\t\"markdown/no-html\": \"error\",\n\t\t},\n\t},\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## Migration from `eslint-plugin-markdown`\n\nSee [Migration](./docs/migration.md#from-eslint-plugin-markdown).\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<!-- NOTE: This section is autogenerated. Do not manually edit.-->\n<!--sponsorsstart-->\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<h3>Platinum Sponsors</h3>\n<p><a href=\"https://automattic.com\"><img src=\"https://images.opencollective.com/automattic/d0ef3e1/logo.png\" alt=\"Automattic\" height=\"128\"></a></p><h3>Gold Sponsors</h3>\n<p><a href=\"https://qlty.sh/\"><img src=\"https://images.opencollective.com/qltysh/33d157d/logo.png\" alt=\"Qlty Software\" height=\"96\"></a> <a href=\"https://shopify.engineering/\"><img src=\"https://avatars.githubusercontent.com/u/8085\" alt=\"Shopify\" height=\"96\"></a> <a href=\"https://www.coderabbit.ai/?utm_source=cr_org&utm_medium=github\"><img src=\"https://avatars.githubusercontent.com/u/132028505\" alt=\"CodeRabbit\" height=\"96\"></a></p><h3>Silver Sponsors</h3>\n<p><a href=\"https://vite.dev/\"><img src=\"https://images.opencollective.com/vite/d472863/logo.png\" alt=\"Vite\" height=\"64\"></a> <a href=\"https://liftoff.io/\"><img src=\"https://images.opencollective.com/liftoff/2d6c3b6/logo.png\" alt=\"Liftoff\" height=\"64\"></a> <a href=\"https://stackblitz.com\"><img src=\"https://avatars.githubusercontent.com/u/28635252\" alt=\"StackBlitz\" height=\"64\"></a></p><h3>Bronze Sponsors</h3>\n<p><a href=\"https://cybozu.co.jp/\"><img src=\"https://images.opencollective.com/cybozu/933e46d/logo.png\" alt=\"Cybozu\" height=\"32\"></a> <a href=\"https://opensource.sap.com\"><img src=\"https://avatars.githubusercontent.com/u/2531208\" alt=\"SAP\" height=\"32\"></a> <a href=\"https://www.crawljobs.com/\"><img src=\"https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png\" alt=\"CrawlJobs\" height=\"32\"></a> <a href=\"https://depot.dev\"><img src=\"https://images.opencollective.com/depot/39125a1/logo.png\" alt=\"Depot\" height=\"32\"></a> <a href=\"https://icons8.com/\"><img src=\"https://images.opencollective.com/icons8/7fa1641/logo.png\" alt=\"Icons8\" height=\"32\"></a> <a href=\"https://discord.com\"><img src=\"https://images.opencollective.com/discordapp/f9645d9/logo.png\" alt=\"Discord\" height=\"32\"></a> <a href=\"https://www.gitbook.com\"><img src=\"https://avatars.githubusercontent.com/u/7111340\" alt=\"GitBook\" height=\"32\"></a> <a href=\"https://citadel.co.jp\"><img src=\"https://avatars.githubusercontent.com/u/75781367\" alt=\"Citadel AI\" height=\"32\"></a></p>\n<h3>Technology Sponsors</h3>\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<p><a href=\"https://netlify.com\"><img src=\"https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg\" alt=\"Netlify\" height=\"32\"></a> <a href=\"https://algolia.com\"><img src=\"https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg\" alt=\"Algolia\" height=\"32\"></a> <a href=\"https://1password.com\"><img src=\"https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg\" alt=\"1Password\" height=\"32\"></a></p>\n<!--sponsorsend-->\n","publish_time":1737671563343,"_cnpm_publish_time":1737671563343,"dist-tags":{"latest":"8.0.3"}}