# markdownlint-rule-trace-template-headers

> markdownlint custom rule that checks the headers is same to template

Latest version **2.0.3** (published 2023-07-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install markdownlint-rule-trace-template-headers
pnpm add markdownlint-rule-trace-template-headers
yarn add markdownlint-rule-trace-template-headers
bun add markdownlint-rule-trace-template-headers
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.3 |
| Published | 2023-07-30 |
| First published | 2023-03-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 16.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | lainNao |
| Maintainers | lainnao |
| Keywords | markdownlint-rule |

## Links

- npm: https://www.npmjs.com/package/markdownlint-rule-trace-template-headers
- Repository: https://github.com/lainNao/markdownlint-rule-trace-template-headers
- Homepage: https://github.com/lainNao/markdownlint-rule-trace-template-headers#readme
- Issues: https://github.com/lainNao/markdownlint-rule-trace-template-headers/issues
- npm.io page: https://npm.io/package/markdownlint-rule-trace-template-headers

## Dependencies (2)

- [minimatch](https://npm.io/package/minimatch.md) ^7.4.3
- [app-root-path](https://npm.io/package/app-root-path.md) ^3.1.0

## Alternatives

- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) — 2.9M weekly downloads
- [eslint-config-expo](https://npm.io/package/eslint-config-expo.md) — 1.5M weekly downloads
- [@matter/protocol](https://npm.io/package/@matter/protocol.md) — 63.5K weekly downloads
- [@eventcatalog/linter](https://npm.io/package/@eventcatalog/linter.md) — 24.8K weekly downloads
- [@inrupt/eslint-config-base](https://npm.io/package/@inrupt/eslint-config-base.md) — 4.5K weekly downloads

## Recent versions

- 2.0.3 (latest) — 2023-07-30
- 2.0.2 — 2023-07-05
- 2.0.0 — 2023-06-28
- 1.0.6 — 2023-06-09
- 1.0.4 — 2023-06-09
- 1.0.3 — 2023-06-09
- 1.0.2 — 2023-06-09
- 1.0.1 — 2023-06-09
- 1.0.0 — 2023-03-26

## README

# markdownlint-rule-trace-template-headers

A custom markdownlint rule that provides the functionality to check the headers of a Markdown file based on the headers of a template file, verifying the match and order of the headers.

This package is compatible with markdownlint-cli2 and not markdownlint-cli.

## Usage

### CLI

1. Install dependencies.

    ```shell
    npm install -D markdownlint-cli2 @lainNao/markdownlint-trace-template-headers
    ```

1. Create config file.

    ```shell
    touch .markdownlint-cli2.jsonc
    ```

1. Edit `.markdownlint-cli2.jsonc` .

    - if markdownlint-rule-trace-template-headers is v2 or higher

    ```jsonc
    {
      "customRules": [
        "markdownlint-rule-trace-template-headers"
      ],
      "config": {
        "markdownlint-rule-trace-template-headers": {
          "settings": [
            {
              "templateFile": "YOUR_TEMPLATE_FILE.md", // template headers file
              "includedFiles": ["*.md"], // files to lint
              "excludedFiles": [] // files to exclude
            },
            ...
          ]
        }
      }
    }
    ```

    - if markdownlint-rule-trace-template-headers is v1 or lower

    ```jsonc
    {
      "customRules": [
        "markdownlint-rule-trace-template-headers"
      ],
      "config": {
        "markdownlint-rule-trace-template-headers": {
          "templateFile": "YOUR_TEMPLATE_FILE.md", // template headers file
          "includedFiles": ["*.md"], // files to lint
          "excludedFiles": [] // files to exclude
        }
      }
    }
    ```

1. Run lint.

    ```shell
    npx markdownlint-cli2 SOME_MARKDOWN_FILE.md
    ```

### VSCode

1. Install `markdownlint` in your VSCode extensions marketplace.
1. Create and edit `.markdownlint-cli2.jsonc` like above.
1. Verify the lint rule works works in Editor.

## Other

To disable the rule, edit `.markdownlint-cli2.jsonc` .

```jsonc
{
  "customRules": [
    "markdownlint-rule-trace-template-headers"
  ],
  "config": {
    "markdownlint-rule-trace-template-headers": false    // change this value to falsy
  }
}
```

## TODO

- Improve CI/CD. Add auto tests and auto versioning, updating changelog, release scripts.
- Create CONTRIBUTION.md
- Config to select error/warn

---
_Source: https://npm.io/package/markdownlint-rule-trace-template-headers · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
