textlint

textlint

  • Docs
  • Rules
  • Blog
  • Help
  • GitHub

›Recent Posts

Recent Posts

  • textlint v12.0.0
  • textlint 11 released
  • New website
  • Renewing

textlint v12.0.0

May 24, 2021

azu

We just publish textlint v12.0.0, which is a major release upgrade of textlint.

This release adds some new features and fixes several bugs found in the previous release. This release also has some breaking changes.

Summary

For textlint user

textlint improves markdown parsing, so it may found newer errors.

You can upgrade textlint via following commands:

npm install textlint@12
# or
yarn install textlint@12

textlint 12.0.0 requires Node.js 12+. If you are using Node.js 10.x, please upgrade your Node.js env.

  • Download | Node.js

For textlint rule creator

textlint-tester and textlint-scripts are updated.

npm install textlint-scripts@12 --save-dev
# or
yarn install textlint-scripts@12 --dev

textlint-tester@12 use export default instead of modules.exports =. So, you need to use import TextLintTester from "textlint-tester" instead of const TextLintTester = require("textlint-tester").

- const TextLintTester = require("textlint-tester");
+ import TextLintTester from "textlint-tester";

Migration script using Semgrep.

# Install semgrep
# For macOS
$ brew install semgrep

# For Ubuntu / Windows via WSL / Linux / macOS
$ python3 -m pip install semgrep

# ---- After installation ----

# Run migration script
semgrep --config s/azu:textlint-12-migration

Breaking Changes

  • All @textlint/* internal modules use same version
    • All modules are released as 12.0.0.
  • Drop Node.js 10.x support #600
    • update engines filels to "node": "^12.20.0 || ^14.13.1 || >=16.0.0"
  • Modules require ES2015 supported environments #777 #774
    • Now, all module target is ES2015
    • It means that textlint does not support IE
    • 📝 Node.js 12+ support ES2018+
  • Built-in markdown parser is updated
    • @textlint/markdown-to-ast@12 use remark@13.0.0

Package Versions

Breaking ChangesPackagePrevious versionCurrent version
✔textlint11.9.112.0.0
✔textlint-tester5.3.512.0.0
✔textlint-scripts3.0.012.0.0
@textlint/ast-node-types4.4.312.0.0
@textlint/ast-traverse2.3.512.0.0
@textlint/ast-tester2.3.512.0.0
@textlint/feature-flag3.3.512.0.0
@textlint/fixer-formatter3.3.512.0.0
@textlint/kernel3.4.512.0.0
@textlint/linter-formatter3.3.512.0.0
@textlint/module-interop1.2.512.0.0
✔@textlint/textlint-plugin-markdown5.3.512.0.0
@textlint/textlint-plugin-text4.3.512.0.0
✔@textlint/types1.5.512.0.0
@textlint/utils1.2.512.0.0

Now, This monorepo includes textlint-scripts package in #779.

@textlint/markdown-to-ast

It is a markdown parser in textlint. We have updated to remark@13.0.0, and it has many changes related to Markdown AST

You can see the changes at feat(markdown-to-ast): update to remark-parse@9 #767

This package updates also includes security fixes. CVE-2020-7753 has been fixed in textlint 12.0.0.

  • Regular Expression Denial of Service in trim · CVE-2020-7753 · GitHub Advisory Database

Features

Add FootnoteReference node

The NATO phonetic alphabet[^wiki].

[^wiki]: Read more about it on wikipedia: <http://en.wikipedia.org/wiki/NATO_phonetic_alphabet>.

Previously, It is called LinkReference, textlint@12 treat it as FootnoteReference. Some rules may report new errors on FootnoteReference.

Known bugs

  • gfm parsing bug that generate broken AST: remarkjs/remark-gfm#16
    • → textlint use workaround: remarkjs/remark-gfm#16 (comment) at c99218e
    • → markdown-to-ast does not generate broken AST.

textlint-tester

  • use export default instead of export = #775 #689

The textlint-tester user should use import instead of require.

- const TextLintTester = require("textlint-tester");
+ import TextLintTester from "textlint-tester";

Or, pick default property.

- const TextLintTester = require("textlint-tester");
+ const TextLintTester = require("textlint-tester").default;

textlint-scripts

  • Update to mocha@8

@textlint/types

  • Fix getSource argument type #770

@textlint/ast-tester

  • Improve error message #783

Community News 🆕

  • textlint-plugin-latex2e reach to v1.0.0 🎉
    • textlint can lint LaTeX files with this plugin
  • @textlint/editor beta released 🎉
    • textlint works on your browser as browser extension
    • textlint editor - Firefox
    • textlint editor - Chrome
    • It's purpose is privacy first linting tools!

Thanks to Support!

VELC supports @azu as GitHub Sponsors!

  • 会社(ヴェルク)としてGithub Sponsorsになりました - ヴェルク - IT起業の記録 (Japanese blog)

Many people support me, Thanks again!

If you're interested in GitHub Sponsor, please check @azu on GitHub Sponsors!

textlint 11 released

July 22, 2018

azu

We just pushed textlint v11.0.0, which is a major release upgrade of textlint.

This release adds some new features and fixes several bugs found in the previous release. This release also has some breaking changes.

Highlights

⭐️ Features

@textlint/textlint-plugin-text and @textlint/textlint-plugin-markdown support extensions option

Notes: @textlint/textlint-plugin-text and @textlint/textlint-plugin-markdown are built-in plugin.

For example, if you want to treat .hown as markdown, put extensions options to .textlintrc

{
    "plugins": {
        "@textlint/markdown": {
            "extensions": [".hown"]
        }
    }
}

For more details, please see custom extension example.

For developer:

if you want to support extensions options, see Plugin · textlint.

Show message if textlint --init is success #529

Add message to textlint --init

screen shot

🔥BREAKING CHANGE

Drop Node.js 4.x support #443

textlint does no more test on Node.js 4.x. Node.js 4.x was end of support.

  • nodejs/Release: Node.js Foundation Release Working Group

If you use Node.js 4.x, please update Node.js.

  • Node.js official site

[Developer] Freeze Rule's Context #508

textlint 11 freeze rule's context object.

Next code should throw error in textlint 11.

export default function(context) {
    // Error: `context` object can not be modified
    context.modifiedContext = true;
    const { Syntax } = context;
    return {
        [Syntax.Str](node) {
        }
    };
}

[Developer] Change default value of Rule's options and Plugin's options #535 #540

textlint@11 change the default value of options from true to {} (empty object).

For example, very-nice-rule's option is true(enable the rule) in .textlintrc

{
  "rules": {
    "very-nice-rule": true
  }
}

Before

very-nice-rule.js rule get true as options.

export default function(context, options) {
    console.log(options); // true
}

After:

very-nice-rule.js rule get {} (emptry object) as options.

export default function(context, options) {
    console.log(options); // {}
}

⚠ Deprecation

[Developer] Deprecate static availableExtensions() in plugin Processor

Insteadof it, support availableExtensions() instance method in plugin #534

You should change the implementaion of plugin. textlint still support static availableExtensions for backward-compatibility.

-    static availableExtensions() {
+    availableExtensions() {
        return [".txt", ".text"];
    }

This change allow to extends availableExtensions() by options.

  • Example: feat: markdown/text plugin support "extensions" options by azu · Pull Request #537 · textlint/textlint

For more information, see availableExtensions(): string[].


ALL CHANGELOG

textlint@11.0.0

fixes

  • textlint: add engine.availableExtensions for backward-compatible (e8652bc)
  • textlint: fix config type (0f2fd6f)
  • deps: update mocha (5df8af4)
  • textlint: add type of public TextlintrcDescriptor (7268b9e)
  • textlint: make static availableExtensions() optional (d471637)
  • remove @textlint/textlintrc-descriptor (3613e1f)
  • textlint: use shallowMerge (95d056d)
  • kernel: merge textlintrc-descriptor to kernel (3c01067)
  • kernel: separate linter and fixer descriptor (b5bc8bd)
  • textlint: fix to import util (6629bd5)
  • textlint: remove `extensions` from Config (7bc9ab8)
  • textlintrc-descriptor: Introduce textlintrc-descriptor (6177794)

features

  • textlint: show message if `textlint --init` is success (#529) (102d568)
  • textlint: support availableExtensions() instance method in plugin (a7cd053)
  • kernel: add plugin's option tests (f362257)
  • textlint: add cli output test (#533) (abd314a), closes #532
  • textlint: add tests for object-to-kernel-format (5fbb22d)
  • textlint: fix plugin tests (bbfc8f6)

breakingChanges

#535 #540

Change default value of Rule's options and Plugin's options.

textlint@11 change the default value of options from true to {} (empty object).

For example, very-nice-rule's option is true(enable the rule) in .textlintrc

{
  "rules": {
    "very-nice-rule": true
  }
}

Before

very-nice-rule.js rule get true as options.

export default function(context, options) {
    console.log(options); // true
}

After:

very-nice-rule.js rule get {} (emptry object) as options.

export default function(context, options) {
    console.log(options); // {}
}

@textlint/kernel@3.0.0

fixes

  • kernel: kernel use TextlintrcDescriptor (efd89c2)
  • kernel: make rule and plugin's option value {} by default (b7aa63d)
  • deps: update mocha (5df8af4)
  • remove @textlint/textlintrc-descriptor (3613e1f)
  • kernel: add comment (582d0d6)
  • kernel: add Processor validation (86ed609)
  • kernel: fix test title (4eeeff8)
  • kernel: support instance availableExtensions() method (b821fc5)
  • textlint: make static availableExtensions() optional (d471637)
  • textlint: use shallowMerge (95d056d)
  • kernel: merge textlintrc-descriptor to kernel (3c01067)
  • kernel: remove TextlintRuleDescriptorType (a5b0f30)
  • kernel: Replace Object.freeze directly with factory function (c43580b)
  • kernel: separate linter and fixer descriptor (b5bc8bd)
  • kernel: use textlintrc-descriptor instead of rule-creator-helper (f0eb4bf)
  • textlintrc-descriptor: Introduce textlintrc-descriptor (6177794)
  • typescript: update to TypeScript 2.8 (f7b2b08)

features

  • kernel: Freeze Context (7fc9ec8), closes #508 #508
  • textlint: support availableExtensions() instance method in plugin (a7cd053)
  • kernel: Add missing Readonly<T> (c5313c8)
  • kernel: add plugin's option tests (f362257)
  • textlint: add tests for object-to-kernel-format (5fbb22d)

breakingChanges

  • kernel: Previously, textlint pass true to rule and plugin as default value of option. #535 #540

@textlint/textlint-plugin-markdown@5.0.0

fixes

  • kernel: make rule and plugin's option value {} by default (b7aa63d)
  • deps: update mocha (5df8af4)
  • plugin: add plugin configuration (6e179ec)

features

  • textlint-plugin-markdown: Support "extensions" option (c3d55fe)

breakingChanges

  • kernel: Previously, textlint pass true to rule and plugin as default value of option. #535 #540

@textlint/textlint-plugin-text@4.0.0

fixes

  • kernel: make rule and plugin's option value {} by default (b7aa63d)
  • deps: update mocha (5df8af4)
  • plugin: add "extensions" option to docs (8026997)
  • plugin: add plugin configuration (6e179ec)

features

  • textlint-text-markdown: support "extensions" option (cce29ed)

breakingChanges

  • kernel: Previously, textlint pass `true` to rule and plugin as default value of option. #535 #540

gulp-textlint@5.0.11

fixes

  • deps: update to natives@1.1.3 (0c20f42)
  • deps: update mocha (5df8af4)

textlint-tester@5.0.0

fixes

  • kernel: make rule and plugin's option value {} by default (b7aa63d)
  • deps: update mocha (5df8af4)
  • kernel: separate linter and fixer descriptor (b5bc8bd)

breakingChanges

  • kernel: Previously, textlint pass `true` to rule and plugin as default value of option.

textlint-website@10.4.0

fixes

  • website: update index.css (6f7977e)
  • website: use https image (4495ed3)
  • website: use short menu name (81911ad)
  • website: add { search: true }, (0c3c4a9)
  • website: add Edit url (e85c6bf)
  • website: add new blog (cabc987)
  • website: add project link (2000dc4)
  • website: add textlint icon (54873c0)
  • website: change vuejs usecase (9d832e5)
  • website: Add a project depends on textlint (#523) (80b4b73)

features

  • website: enable search (9e18b9e)

New website

May 22, 2018

azu

textlint get a new website!

website

  • @0x6b start to work migrate exising document to website.
  • @uetchy design this website.
  • @azu implement the design and deploy.

If you have used textlint in your project or your office, please pull request to add your project to Users!

  • textlint · users

Related Issues

  • Introduce Docusaurus by 0x6b · Pull Request #461 · textlint/textlint
  • website: design · Issue #467 · textlint/textlint

Renewing

January 13, 2018

0x6b

We're renewing our website to be able to give you better experience.

textlint
Docs
User ManualDeveloper Guide
Community
Project Chat
More
BlogGitHubStar
Copyright © 2022 textlint organization