Skip to content

tyler36/textlint-demo

Repository files navigation

Textlint

Overview

Textlint is a plug-able linting tool for text and Markdown.

Supports: .txt, .md Required:

  • Node.js 16+

Homepage: https://github.com/textlint/textlint Online playground: https://textlint.github.io/playground/

Usage

  • To install:
npm install --save-dev textlint

When installed global, also install addons globally.

Configuration

Valid configuration files are:

  • .textlintrc
  • .textlintrc.json
  • .textlintrc.yaml
  • .textlintrc.js

To create a configuration file:

npx textlint --init
{
  // .textlintrc.json
  "plugins": {},
  "filters": {},
  "rules": {}
}

Rules

No defaults rules.

Preset:

@textlint-rule/textlint-rule-no-unmatched-pair

Textlint rule that check unmatched pairs like and ].

❌ これは(秘密)です。
❌ John said "Hello World!'.

Textlint-rule-alive-link

Textlint rule to make sure every link in a document is available.

❌ https://www.goooogle.com

Textlint-rule-common-misspellings

Textlint rule to find common misspellings from Wikipedia: Lists of common misspellings.

❌ unsuccesful
✅ unsuccessful

Textlint-rule-en-capitalization

Textlint rule that check capitalization in english text.

❌ text should be capitalized in sentences.
✅ Text should be capitalized in sentences.

Textlint-rule-date-weekday-mismatch

Textlint rule that found mismatch between date and weekday.

❌ 2016-12-29(Friday)
✅ 2016-12-29(Thursday)
❌ 2016年12月29日(金曜日)
✅ 2016年12月29日(木曜日)

Textlint-rule-doubled-spaces

Textlint rule for check doubled spaces in sentence.

❌ Pen  Pineapple   Apple  Pen
✅ Pen Pineapple Apple Pen

Textlint-rule-no-todo

This textlint rule check todo mark.

❌ TODO: this is TODO
❌ - [ ] TODO

Textlint-rule-stop-words

Textlint rule to find filler words, buzzwords and clichés — 1600+ words and phrases in English.

❌ You can not use allowlist anymore.

Textlint-rule-terminology

Textlint rule to check and fix terms, brands and technologies spelling in your tech writing in English.

❌ Javascript
✅ JavaScript
❌ front-end
✅ frontend

Textlint-rule-unexpanded-acronym

Textlint rule that found Unexpanded Acronym.

❌ I like ABC.
(What does ABC stand for ???)

Textlint-rule-write-good

Textlint rule to check your English writing styles with btford/write-good. @see https://github.com/btford/write-good#checks

❌ This is very good. // weasel word.

Addons

Filters

Textlint-filter-rule-comments

Textlint rule that ignore error using comments directive.

<!-- textlint-disable -->
This is ignored           text by rule.
Disables all rules between comments
<!-- textlint-enable -->

Plugins

Textlint-plugin-HTML

Add HTML support for textlint.

VScode

  "[markdown]": {
    "editor.defaultFormatter": "taichi.vscode-textlint"
  },
  "textlint.nodePath": "./node_modules/.bin",
  "textlint.configPath": "./.textlintrc",
  "textlint.autoFixOnSave": true,

Releases

No releases published

Packages

No packages published

Languages