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

@funboxteam/markdown-lint

v2.0.2

Published

Markdown code style linter

Downloads

33

Readme

⛔ THIS REPO IS UNMAINTAINED

Future development moved to https://github.com/343dev/markdown-lint.

@funboxteam/markdown-lint

npm

Markdown code style linter that makes your documentation looks nicer.

It’s based on Prettier, Remark & Typograf.

По-русски

Rationale

Some projects have a lot of documentation inside the repos. Once we decided to start linting their grammar and check for spelling errors. For that purpose we built languagetool-node.

But at the same time we decided to lint the Markdown syntax of those files, as we do with our JS, CSS, etc files. And we’ve created this linter.

Getting Started

To install the tool and use it globally run:

npm install -g @funboxteam/markdown-lint

To install the tool into the project and setup pre-commit hook run:

npm install --dev husky lint-staged @funboxteam/markdown-lint

Project Setup

To automatically lint Markdown files on precommit you should setup husky and lint-staged to work with markdown-lint in your project’s package.json.

Example:

{
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.md": [
      "markdown-lint --fix --typograph"
    ]
  }
}

CLI Usage

To check files and directories manually you should run markdown-lint:

# check the passed file
markdown-lint README.md

# check all the files inside the passed directory (w/o recursive search)
markdown-lint ./docs

# check all the files inside the passed directory (recursively)
markdown-lint -r ./docs

# check the passed file and automatically fix errors
markdown-lint --fix README.md

Options

  • --fix — automatically fix errors.
  • --ext <value> — specify file extensions (default: md). It’s possible to set several extensions like this: --ext apib --ext txt.
  • -t, --typograph — run typograph over the text inside the files.
  • -r, --recursive — search for files in the subdirectories of the passed directory.
  • -c, --config <file> — use external config file to extend the default one.
  • -v, --version — show current tool version.
  • -h, --help — show help.

Configuration

The linter works upon the Markdown processor called remark.

The linting itself works is done by remark-lint and the set of rules defined in remark-preset-lint-markdown-style-guide.

You may use your own configuration file by passing the path to that file using --config option:

markdown-lint --fix --config ~/.markdownlintrc.js README.md

Example of configuration file:

module.exports = {
  // prettier is used when `--fix` is passed
  prettier: {
    // hard wrap lines to 120 characters
    printWidth: '120'
  },

  remark: {
    // plugins for remark-lint
    plugins: [
      // print errors when there're lines longer that 120 characters
      [require('remark-lint-maximum-line-length'), 120],

      // disable rule `no-inline-padding`
      [require('remark-lint-no-inline-padding'), false],

      // set `*` as the only allowed marker for unordered list
      [require('remark-lint-unordered-list-marker-style'), '*']
    ],

    // settings for remark-stringify which is used when `--fix` is passed
    stringifySettings: {
      // automatically replace list markers to `*`
      bullet: '*'
    }
  },

  typograf: {
    // rules API — https://github.com/typograf/typograf/blob/dev/docs/api_rules.md
    // list of ruls — https://github.com/typograf/typograf/blob/dev/docs/RULES.en-US.md
    locale: ['ru', 'en-US'],
    enableRules: [],
    disableRules: [
      // these rules have to be turned off to make it possible to use typograph
      'common/space/delTrailingBlanks',
      'common/space/trimLeft',
      'common/space/trimRight'
    ],
    rulesSettings: []
  }
};

Example

Original text

Linux kernel
============

There are several guides for kernel developers and users. These guides can be rendered in a number of formats, like HTML and PDF. Please read Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or ``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory, several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the requirements for building and running the kernel, and information about the problems which may result by upgrading your kernel.

__Useful links__

* [Linux kernel licensing rules](https://www.kernel.org/doc/html/latest/process/license-rules.html#kernel-licensing)
* [Reporting bugs](https://www.kernel.org/doc/html/latest/admin-guide/reporting-bugs.html)

The text processed with --fix option enabled

# Linux kernel

There are several guides for kernel developers and users. These guides can be
rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use `make htmldocs` or `make pdfdocs`. The
formatted documentation can also be read online at:

```
https://www.kernel.org/doc/html/latest/
```

There are various text files in the Documentation/ subdirectory, several of them
using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about the
problems which may result by upgrading your kernel.

**Useful links**

- [Linux kernel licensing rules](https://www.kernel.org/doc/html/latest/process/license-rules.html#kernel-licensing)
- [Reporting bugs](https://www.kernel.org/doc/html/latest/admin-guide/reporting-bugs.html)

Credits

Shiny picture for the project was made by Igor Garybaldi.

Sponsored by FunBox