open-md-lint

Open source markdown lint

do not need
Last updated 5 months ago by wu_sl .
MIT · Repository · Original npm · Tarball · package.json
$ cnpm install open-md-lint 
SYNC missed versions from official npm registry.

open-md-lint

open-md-lint is an open source module for markdown file format checking.

Getting start

Install

npm i open-md-lint

Demo

package.json

{
  "scripts": {
    "md-lint": "open-md-lint"
  }
}
# npm run md-lint

Docs

The definition of Config

interface Config {
  requires?: string;
  patterns: string[];
  options: {
    useGitIgnore?: boolean;
    usePackageJson?: boolean;
    configKey?: string;
    gitIgnoreFile?: string;
    ignore?: string[];
    cwd?: string;
  };
}
  • requires(optional): Path to the js file containing the user deinfined rules, the default configuration is declare in the src/default_requires.js
  • For the rest configuration, please refer to deglob

Default config

{
  patterns: [ '**/*.md' ],
  options: {
    useGitIgnore: true,
    ignore: [ 'node_modules/**/*' ],
  },
}

Customer configuration

Note: In order to facilitate the user to integrate the configuration into the package.json file, after loading the configuration file, the configuration will be read from the open-md-lint field, so the specific configuration should be included in the open-md-lint field, for example:

{
  "open-md-lint": {
    "requires": "./requires.js",
    "patterns": [ "**/*.md" ],
    "options": {
      "useGitIgnore": true,
      "ignore": [ "node_modules/**/*" ]
    }
  }
}

You can place the configuration anywhere and specify the file location by setting the MD_LINT_CONFIG_PATH environment variable. E.g

# export MD_LINT_CONFIG_PATH=./open-md-lint.json
# npm run md-lint

Customer md-lint rules

You can specify which checks are enabled. This option requires a js file, for example:

module.exports = [
  require('remark-lint-final-newline'),
  require('remark-lint-list-item-bullet-indent')
]

The js file can be placed in any location and specified by the requires field in the configuration. If it is a relative path, the current path is automatically added to form an absolute path.

Current Tags

  • 0.0.4                                ...           latest (5 months ago)

4 Versions

  • 0.0.4 [deprecated]           ...           5 months ago
  • 0.0.3 [deprecated]           ...           5 months ago
  • 0.0.2 [deprecated]           ...           5 months ago
  • 0.0.1 [deprecated]           ...           5 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |