Roff
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.pre-commit-config.yaml
.pre-commit-hooks.yaml
Dockerfile_redis.3.2
README.md
package.json

README.md

Known Vulnerabilities

Useful pre-commit hooks based on NodeJS scripts.

Does not require to have NodeJS installed: pre-commit will fetch & install it under the hood.

The test Dockerfile in this repo was taken from here.

Table of contents

Usage

-   repo: https://github.com/Lucas-C/pre-commit-hooks-nodejs
    sha: v1.1.0
    hooks:
    -   id: dockerfile_lint
    -   id: markdown-toc
    -   id: htmlhint
        # optional custom config:
        args: [--config, .htmlhintrc]
    -   id: htmllint

htmlhint

Regex-based linter: https://github.com/yaniswang/HTMLHint

htmllint

Uses htmlparser2-based linter: htmllint.

Requires you to have a config file like this default .htmllintrc.

markdown-toc

By default, a table of content will be inserted in your repo root README.md, injecting the TOC on lines with: "<!-- toc -->"

When the TOC is added or updated, the hook will fail with Files were modified by this hook. You then just have to git add your README.md and commit again (or git commit -a).