Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tldr-lint

Package Overview
Dependencies
Maintainers
0
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tldr-lint

A linting tool to validate tldr pages

  • 0.0.16
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
93
increased by6.9%
Maintainers
0
Weekly downloads
 
Created
Source

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
TLDR111File name should not contain any Windows-forbidden character

Keywords

FAQs

Package last updated on 04 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc