No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
dependabot[bot] 214df2054f
chore: Bump the all-dependencies group with 3 updates (#219)
Bumps the all-dependencies group with 3 updates: [eslint](https://github.com/eslint/eslint), [eslint-plugin-github](https://github.com/github/eslint-plugin-github) and [vitest](https://github.com/vitest-dev/vitest/tree/HEAD/packages/vitest).


Updates `eslint` from 9.39.4 to 9.39.5
- [Release notes](https://github.com/eslint/eslint/releases)
- [Commits](https://github.com/eslint/eslint/compare/v9.39.4...v9.39.5)

Updates `eslint-plugin-github` from 6.0.0 to 6.1.1
- [Release notes](https://github.com/github/eslint-plugin-github/releases)
- [Commits](https://github.com/github/eslint-plugin-github/compare/v6.0.0...v6.1.1)

Updates `vitest` from 4.1.9 to 4.1.10
- [Release notes](https://github.com/vitest-dev/vitest/releases)
- [Changelog](https://github.com/vitest-dev/vitest/blob/main/docs/releases.md)
- [Commits](https://github.com/vitest-dev/vitest/commits/v4.1.10/packages/vitest)

---
updated-dependencies:
- dependency-name: eslint
  dependency-version: 9.39.5
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: all-dependencies
- dependency-name: eslint-plugin-github
  dependency-version: 6.1.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
  dependency-group: all-dependencies
- dependency-name: vitest
  dependency-version: 4.1.10
  dependency-type: direct:development
  update-type: version-update:semver-patch
  dependency-group: all-dependencies
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-07-14 12:58:40 -04:00
.github chore: Bump actions/setup-node from 6.4.0 to 7.0.0 (#218) 2026-07-14 12:54:42 -04:00
docs/rules Introduce a no-empty-alt-text rule (#85) 2023-10-09 11:04:52 -04:00
src Bump to 0.2.0 (ESM Migration) 2025-01-23 12:33:41 -05:00
style Update config files to use plain JS instead of JSON (#149) 2025-04-23 15:06:41 -04:00
test chore: Bump the all-dependencies group across 1 directory with 4 updates (#152) 2025-06-26 17:45:59 -04:00
.gitignore feat: adds no-default-alt-text from The Hub; scaffolds tests 2022-07-28 15:55:39 +03:00
.markdownlint-cli2.mjs chore: Bump the all-dependencies group across 1 directory with 4 updates (#152) 2025-06-26 17:45:59 -04:00
.npmrc Supply chain improvements (#209) 2026-06-03 15:35:41 -04:00
.nvmrc Supply chain improvements (#209) 2026-06-03 15:35:41 -04:00
CHANGELOG.md Bump to 0.2.0 (ESM Migration) 2025-01-23 12:33:41 -05:00
CODE_OF_CONDUCT.md Prep repo for open source (#34) 2023-02-02 10:50:14 -05:00
CODEOWNERS Prep repo for open source (#34) 2023-02-02 10:50:14 -05:00
CONTRIBUTING.md Enforce asterisk-style unordered lists (#41) 2023-04-26 11:15:13 -04:00
eslint.config.js Upgrade js-yaml to v5.1.0 and migrate to Vitest from Jest (#215) 2026-06-24 16:10:10 -04:00
index.js Update config files to use plain JS instead of JSON (#149) 2025-04-23 15:06:41 -04:00
LICENSE.txt Prep repo for open source (#34) 2023-02-02 10:50:14 -05:00
package-lock.json chore: Bump the all-dependencies group with 3 updates (#219) 2026-07-14 12:58:40 -04:00
package.json chore: Bump the all-dependencies group with 3 updates (#217) 2026-07-07 15:25:24 -04:00
README.md chore: Bump the all-dependencies group across 1 directory with 4 updates (#152) 2025-06-26 17:45:59 -04:00
SECURITY.md Add SECURITY and SUPPORT file (#35) 2023-02-02 15:16:04 -05:00
SUPPORT.md Add SECURITY and SUPPORT file (#35) 2023-02-02 15:16:04 -05:00
vitest.config.js Upgrade js-yaml to v5.1.0 and migrate to Vitest from Jest (#215) 2026-06-24 16:10:10 -04:00

Markdownlint-github

This repository provides GitHub's recommended markdownlint configurations, and additional rules for use on GitHub open source and internal projects.

Opinions

In addition to defaults defined by markdownlint, we use this repository to enforce rules not defined by default, including our own custom rules.

See opinions codified in index.js.

Rules

The following are custom rules defined in this plugin.

See markdownlint rules for documentation on rules pulled in from markdownlint.

Usage

Important: We support the use of markdownlint through markdownlint-cli2 instead of markdownlint-cli for compatibility with the vscode-markdownlint plugin.

  1. Create a .markdownlint-cli2.mjs file in the root of your repository.

    touch .markdownlint-cli2.mjs
    
  2. Install packages.

    npm install -D markdownlint-cli2 # if updating existing package, check for updates
    npm install -D @github/markdownlint-github [--@github:registry=https://registry.npmjs.org]
    npm install -D markdownlint-cli2-formatter-pretty
    
  3. Add/modify your linting script in package.json.

    "scripts": {
      "lint:markdown": "markdownlint-cli2 \"**/*.{md,mdx}\" \"!node_modules\""
    }
    
  4. Edit .markdownlint-cli2.mjs file to suit your needs. Start with

    import markdownIt from "markdown-it"
    import configOptions, {init} from "@github/markdownlint-github"
    const markdownItFactory = () => markdownIt({ html: true })
    const options = {
        config: init(),
        customRules: ["@github/markdownlint-github"],
        markdownItFactory,
        outputFormatters: [
          [ "markdownlint-cli2-formatter-pretty", { "appendLink": true } ] // ensures the error message includes a link to the rule documentation
        ]
    }
    export default options
    

    Or, you can also pass in configuration options that you wish to override the default. Read more at Customizing configurations. This looks like:

    import markdownIt from "markdown-it"
    import configOptions, {init} from "@github/markdownlint-github"
    const overriddenOptions = init({
        'fenced-code-language': false, // Custom overrides
    })
    const markdownItFactory = () => markdownIt({ html: true })
    const options = {
        config: overriddenOptions,
        customRules: ["@github/markdownlint-github"],
        markdownItFactory,
        outputFormatters: [
          [ "markdownlint-cli2-formatter-pretty", { "appendLink": true } ]
        ]
    }
    export default options
    
  5. Install the vscode-markdownlint plugin to ensure markdownlint violations are surfaced in the file. This plugin should flag rules based off your .markdownlint-cli2.mjs configuration. When you make edits to your configuration, you will need to reload the VSCode window (Ctrl+Shift+P -> Reload Window) to ensure the extension syncs. If your project runs on Codespaces, consider adding this extension to your .devcontainer/devcontainer.json so that this extension is installed to new Codespaces by default.

Customizing configurations

You may determine that the defaults set by this plugin are not suitable for your project.

This plugin will pull in the the defaults defined by markdownlint, several of which pertain to stylistic practices. You may choose to disable these rules if you determine it doesn't provide value for your project.

However, others of these rules should NOT be disabled because they encourage best accessibility practices. Disabling these rules will negatively impact accessibility. These rules are defined in accessibility.json.

To review configurations supported by markdownlint, see markdownlint-cli2 configuration.

Advanced: Adding custom rules in your codebase

You may write custom rules within your repository. Follow the custom rules guide in markdownlint to write your rule.

The rule will need to be enabled in the configuration. For instance, if you introduce some-rule.js with the name "some-rule", you must set the path of the custom rule in the .markdownlint-cli2.mjs file:

import configOptions, {init} from "@github/markdownlint-github"
import markdownIt from "markdown-it"
const markdownItFactory = () => markdownIt({ html: true })
const options = init({
    "some-rule": true,
    customRules: ["@github/markdownlint-github", "some-rule.js"],
    markdownItFactory
})
export default options

See markdownlint-cli2 configuration.

Consider upstreaming any rules you find useful as proposals to this repository.

License

This project is licensed under the terms of the MIT open source license. Please refer to the MIT license for the full terms.

Maintainers

See CODEOWNERS.

Contributing

Please read Contributing Guide for more information.