0.0.15 • Published 1 month ago

tldr-lint v0.0.15

Weekly downloads
197
License
MIT
Repository
github
Last release
1 month ago

tldr-lint

npm version Build Status Matrix chat

tldr-lint is a linting tool for validating tldr pages. It can also format your pages for you!

Installation

tldr-lint and its alias tldrl can be installed via npm:

npm install --global tldr-lint

Usage

It's really simple.

Usage: tldr-lint [options] <file|dir>

Options:
  -V, --version        output the version number
  -f, --format         also attempt formatting (to stdout, or as specified by -o)
  -o, --output <file>  output to formatted file
  -i, --in-place       formats in place
  -t, --tabular        format errors in a tabular format
  -v, --verbose        print verbose output
  -I, --ignore <codes> ignore comma separated tldr-lint error codes (e.g. "TLDR001,TLDR0014")
  -h, --help           display help for command

Usage via Docker

We provide a Dockerfile for reproducibly building and testing tldr-lint even without having NodeJS installed.

For building the Docker image, run this command inside the cloned tldr-lint repository:

docker build -t tldr-lint .

For running a tldr-lint container, you need to mount a volume containing the page(s) you want to lint to the container. For checking a single page, run (replacing {{/path/to/page.md}} with the path to the page you want to check):

docker run --rm -v {{/path/to/page.md}}:/app/page.md tldr-lint page.md

In order to run the container on a directory, mount this directory as follows:

docker run --rm -v {{/path/to/directory}}:/app/pages tldr-lint pages/

!NOTE For Windows users, specify the full path to the directory or page you want to check along with the docker run command above.

Linter errors

All of the errors can be found in lib/tldr-lint.js.

Error CodeDescription
TLDR001File should contain no leading whitespace
TLDR002A single space should precede a sentence
TLDR003Descriptions should start with a capital letter
TLDR004Command descriptions should end in a period
TLDR005Example descriptions should end in a colon with no trailing characters
TLDR006Command name and description should be separated by an empty line
TLDR007Example descriptions should be surrounded by empty lines
TLDR008File should contain no trailing whitespace
TLDR009Page should contain a newline at end of file
TLDR010Only Unix-style line endings allowed
TLDR011Page never contains more than a single empty line
TLDR012Page should contain no tabs
TLDR013Title should be alphanumeric with dashes, underscores or spaces
TLDR014Page should contain no trailing whitespace
TLDR015Example descriptions should start with a capital letter
TLDR016Label for information link should be spelled exactly More information:
TLDR017Information link should be surrounded with angle brackets
TLDR018Page should only include a single information link
TLDR019Page should only include a maximum of 8 examples
TLDR020Label for additional notes should be spelled exactly Note: (with a succeeding whitespace)
TLDR021Command example should not begin or end in whitespace
TLDR101Command description probably not properly annotated
TLDR102Example description probably not properly annotated
TLDR103Command example is missing its closing backtick
TLDR104Example descriptions should prefer infinitive tense (e.g. write) over present (e.g. writes) or gerund (e.g. writing)
TLDR105There should be only one command per example
TLDR106Page title should start with a hash (#)
TLDR107File name should end with .md extension
TLDR108File name should not contain whitespace
TLDR109File name should be lowercase
TLDR110Command example should not be empty
0.0.15

1 month ago

0.0.14

1 month ago

0.0.13

3 years ago

0.0.12

3 years ago

0.0.11

3 years ago

0.0.10

3 years ago

0.0.9

3 years ago

0.0.8

4 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago