npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@github/markdownlint-github

v0.6.3

Published

An opinionated collection of markdownlint rules used by GitHub.

Downloads

23,326

Readme

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.cjs file in the root of your repository.

    touch .markdownlint-cli2.cjs
  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.cjs file to suit your needs. Start with

    const options = require('@github/markdownlint-github').init()
    module.exports = {
        config: options,
        customRules: ["@github/markdownlint-github"],
        outputFormatters: [
          [ "markdownlint-cli2-formatter-pretty", { "appendLink": true } ] // ensures the error message includes a link to the rule documentation
        ]
    }

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

    const options = require('@github/markdownlint-github').init({
        'fenced-code-language': false, // Custom overrides
    })
    module.exports = {
        config: options,
        customRules: ["@github/markdownlint-github"],
        outputFormatters: [
          [ "markdownlint-cli2-formatter-pretty", { "appendLink": true } ]
        ]
    }
  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.cjs 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.cjs file:

module.exports = require('@github/markdownlint-github').init({
    "some-rule": true,
    customRules: ["@github/markdownlint-github", "some-rule.js"],
})

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 MIT for the full terms.

Maintainers

See CODEOWNERS.

Contributing

Please read Contributing Guide for more information.