Skip to main content

textlint v12.0.0

ยท 4 min read
azu
textlint creator

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.

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

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.

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โ€‹

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 ๐Ÿ†•โ€‹

Thanks to Support!โ€‹

VELC supports @azu as GitHub Sponsors!

Many people support me, Thanks again!

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