gulp-textlint

gulp-textlint

npm i gulp-textlint

98 Versions

13.3.1

latest
24 days ago
What's Changed Bug Fixes Documentation Dependency Updates

Full Changelog: https://github.com/textlint/textlint/compare/v13.3.0...13.3.1


13.3.0

1 month ago
What's Changed Features Dependency Updates Other Changes

Full Changelog: https://github.com/textlint/textlint/compare/v13.2.0...13.3.0


13.2.0

1 month ago
What's Changed Features
import TextLintTester from "textlint-tester";
import rule from "textlint-rule-no-todo";
const tester = new TextLintTester();
tester.run("rule name", rule, {
    valid: [
        { text: "This is ok", description: "It is normal text" }
    ],
    invalid: [
        {
            text: "- [ ] string",
            description: "It todo test",
            errors: [
                {
                    message: "Found TODO: '- [ ] string'",
                    range: [2, 6]
                }
            ]
        }
    ]
});
Dependency Updates

Full Changelog: https://github.com/textlint/textlint/compare/v13.1.4...13.2.0


13.1.4

1 month ago
What's Changed Bug Fixes Dependency Updates

Full Changelog: https://github.com/textlint/textlint/compare/v13.1.3...13.1.4


13.1.3

2 months ago
What's Changed Bug Fixes

Full Changelog: https://github.com/textlint/textlint/compare/v13.1.2...13.1.3


13.1.2

2 months ago
What's Changed Refactoring Testing Dependency Updates

Full Changelog: https://github.com/textlint/textlint/compare/v13.1.1...13.1.2


13.1.1

2 months ago
What's Changed Bug Fixes Refactoring

Full Changelog: https://github.com/textlint/textlint/compare/v13.1.0...13.1.1


13.1.0

2 months ago
What's Changed Features
$ npm install textlint textlint-plugin-html textlint-rule-preset-ja-technical-writing
$ npx textlint --init

will generate .textlintrc.json

{
  "plugins": {
    "html": true
  },
  "filters": {},
  "rules": {
    "preset-ja-technical-writing": true
  }
}
Testing Dependency Updates

Full Changelog: https://github.com/textlint/textlint/compare/v13.0.5...13.1.0


13.0.5

2 months ago
What's Changed Bug Fixes

This release correct ast-node-type types.

Full Changelog: https://github.com/textlint/textlint/compare/v13.0.4...13.0.5


13.0.4

2 months ago
What's Changed Dependency Updates

It will reduce textlint package size.

https://bundlephobia.com/package/textlint@13.0.3
https://bundlephobia.com/package/textlint@13.0.4

172.8kb ⬇️

Full Changelog: https://github.com/textlint/textlint/compare/v13.0.3...13.0.4


13.0.3

2 months ago
What's Changed Refactoring

It will reduce @textlint/kernel package size.

15.1kb ⬇️

Dependency Updates

Full Changelog: https://github.com/textlint/textlint/compare/v13.0.2...13.0.3


13.0.2

2 months ago
What's Changed Bug Fixes

Full Changelog: https://github.com/textlint/textlint/compare/v13.0.1...13.0.2


13.0.1

2 months ago
What's Changed Bug Fixes

If you have used TextNodeRange, TxtNodeLineLocation, TxtNodePosition, please change following:

- import type { TextNodeRange, TxtNodeLineLocation, TxtNodePosition } from "@textlint/ast-node-types";
+ import type { TxtNodeRange, TxtNodeLocation, TxtNodePosition } from "@textlint/ast-node-types";
Refactoring

Full Changelog: https://github.com/textlint/textlint/compare/v13.0.0...13.0.1


13.0.0

2 months ago

textlint v13 support ESM rules/plugins 🎉

We have rewritten CLI and textlint package. However, it is not a breaking change for most textlint CLI users. Almost CLI behaviors are the same as textlint v12.

Please share your feedback to us!

🔥 Breaking Changes
  • Require Node.js 16+
  • textlint --init output .textlintrc.json
    • Previously, textlint --init output .textlintrc
  • Improve @textlint/ast-node-types types
    • Now, All node types are defined!
    • It changes the existing node type and it is a breaking change
    • If you want to know TxtAST, please read TxtAST Interface
    • See also Release v13.0.1 · textlint/textlint
    • - import type { TextNodeRange, TxtNodeLineLocation, TxtNodePosition } from "@textlint/ast-node-types";
      + import type { TxtNodeRange, TxtNodeLocation, TxtNodePosition } from "@textlint/ast-node-types";
      
  • Use New-CLI instead of Old-CLI
    • textlint has introduced New-CLI and New-APIs in v12.3.0
    • New-CLI uses new APIs: createLinter/loadTextlintrc/loadLinterFormatter/loadFixerFormatter( If you want to know new APIs, please read Use as Node Modules)
    • It means that textlint support rules/plugins that are written by ESM 🎉
    • Remove Old-CLI
Difference between Old-CLI and New-CLI
  • New CLI support ESM rules/plugins
  • New CLI must require --stdin-filename with --stdin
    • --stdin-filename may be optional in Old-CLI
  • Correct exit status
Exit Status on new CLI

0: No Error

  • Not found lint error
  • --fix: found errors but fix all errors, so exit with 0
  • --output-file: Found lint error but --output-file is specified
  • --dryRun: Found lint error but --dryRun is specified

1: Lint Error

  • found lint error
  • --fix: found errors and could not fix all errors, so exit with 1

2: Fatal Error

  • Crash textlint process
  • Fail to load config/rule/plugin etc...
Remove undocumented way to override preset rule option

textlint v12 supported next textlintrc, but it is undocumented way.

{
  "rules": {
    "preset-ja-technical-writing": true,
    "ja-technical-writing/sentence-length": {
      "max": 100 // It override preset-ja-technical-writing's option
    }
  }
}

textlint v13 will remove this undocumented way.

You need to use next textlintrc.

{
  "rules": {
    "preset-ja-technical-writing": {
      "sentence-length": {
        "max": 100 // It override preset-ja-technical-writing's option
      }
    }
  }
}

For more details, see Configuring textlint · textlint

🆕 Features Add individual Node type and Add Table/TableRow/TableCell node #1008
  • Define all node types in @textlint/ast-node-types
  • Add Table/TableRow/TableCell node to @textlint/ast-node-types

These types are defined in @textlint/ast-node-types.

Type nameNode typeDescription
ASTNodeTypes.DocumentTxtDocumentNode(TxtParentNode)Root Node
ASTNodeTypes.DocumentExitTxtDocumentNode(TxtParentNode)
ASTNodeTypes.ParagraphTxtParagraphNode(TxtParentNode)Paragraph Node
ASTNodeTypes.ParagraphExitTxtParagraphNode(TxtParentNode)
ASTNodeTypes.BlockQuoteTxtBlockQuoteNode(TxtParentNode)> Block Quote Node
ASTNodeTypes.BlockQuoteExitTxtBlockQuoteNode(TxtParentNode)
ASTNodeTypes.ListTxtListNode(TxtParentNode)List Node
ASTNodeTypes.ListExitTxtListNode(TxtParentNode)
ASTNodeTypes.ListItemTxtListItemNode(TxtParentNode)List (each) item Node
ASTNodeTypes.ListItemExitTxtListItemNode(TxtParentNode)
ASTNodeTypes.HeaderTxtHeaderNode(TxtParentNode)# Header Node
ASTNodeTypes.HeaderExitTxtHeaderNode(TxtParentNode)
ASTNodeTypes.CodeBlockTxtCodeBlockNode(TxtParentNode)Code Block Node
ASTNodeTypes.CodeBlockExitTxtCodeBlockNode(TxtParentNode)
ASTNodeTypes.HtmlBlockTxtHtmlBlockNode(TxtParentNode)HTML Block Node
ASTNodeTypes.HtmlBlockExitTxtHtmlBlockNode(TxtParentNode)
ASTNodeTypes.LinkTxtLinkNode(TxtParentNode)Link Node
ASTNodeTypes.LinkExitTxtLinkNode(TxtParentNode)
ASTNodeTypes.DeleteTxtDeleteNode(TxtParentNode)Delete Node(~Str~)
ASTNodeTypes.DeleteExitTxtDeleteNode(TxtParentNode)
ASTNodeTypes.EmphasisTxtEmphasisNode(TxtParentNode)Emphasis(*Str*)
ASTNodeTypes.EmphasisExitTxtEmphasisNode(TxtParentNode)
ASTNodeTypes.StrongTxtStrongNode(TxtParentNode)Strong Node(**Str**)
ASTNodeTypes.StrongExitTxtStrongNode(TxtParentNode)
ASTNodeTypes.BreakTxtBreakNodeHard Break Node(Str<space><space>)
ASTNodeTypes.BreakExitTxtBreakNode
ASTNodeTypes.ImageTxtImageNodeImage Node
ASTNodeTypes.ImageExitTxtImageNode
ASTNodeTypes.HorizontalRuleTxtHorizontalRuleNodeHorizontal Node(---)
ASTNodeTypes.HorizontalRuleExitTxtHorizontalRuleNode
ASTNodeTypes.CommentTxtCommentNodeComment Node
ASTNodeTypes.CommentExitTxtCommentNode
ASTNodeTypes.StrTxtStrNodeStr Node
ASTNodeTypes.StrExitTxtStrNode
ASTNodeTypes.CodeTxtCodeNodeInline Code Node
ASTNodeTypes.CodeExitTxtCodeNode
ASTNodeTypes.HtmlTxtHtmlNodeInline HTML Node
ASTNodeTypes.HtmlExitTxtHtmlNode
ASTNodeTypes.TableTxtTableNodeTable node. textlint 13+
ASTNodeTypes.TableExitTxtTableNode
ASTNodeTypes.TableRowTxtTableRowNodeTable row node. textlint 13+
ASTNodeTypes.TableRowExitTxtTableRowNode
ASTNodeTypes.TableCellTxtTableCellNodeTable cell node. textlint 13+
ASTNodeTypes.TableCellExitTxtTableCellNode

Some nodes have additional properties. For example, TxtHeaderNode has level property.

export interface TxtHeaderNode extends TxtParentNode {
    type: "Header";
    depth: 1 | 2 | 3 | 4 | 5 | 6;
    children: PhrasingContent[];
}

For more details, see @textlint/ast-node-types.

CHANGELOGS Breaking Changes Other Changes

Full Changelog: https://github.com/textlint/textlint/compare/v12.6.1...13.0.0


12.6.1

2 months ago
What's Changed Refactoring Dependency Updates

Full Changelog: https://github.com/textlint/textlint/compare/v12.6.0...12.6.1


12.6.0

2 months ago
What's Changed Features Bug Fixes Refactoring Dependency Updates

Full Changelog: https://github.com/textlint/textlint/compare/v12.5.1...12.6.0


12.5.2

2 months ago
What's Changed Features Bug Fixes Refactoring Dependency Updates

Full Changelog: https://github.com/textlint/textlint/compare/v12.5.1...12.5.2


12.5.1

3 months ago
12.5.1 (2023-01-04) Bug Fixes

Full Changelog: https://github.com/textlint/textlint/compare/v12.5.0...v12.5.1


12.5.0

3 months ago
12.5.0 (2023-01-04) Features

Example:

$ cat README.md | npx textlint --stdin --stdin-filename README.md --fix --format fixed-result --output-file NEW.md

For more details, see https://textlint.github.io/docs/cli.html#pipe-to-textlint

New Contributors

Full Changelog: https://github.com/textlint/textlint/compare/v12.4.0...v12.5.0


12.4.0

3 months ago
12.4.0 (2023-01-02) Features
  • textlint: add --print-config flag (9aa400f)
What's Changed

Full Changelog: https://github.com/textlint/textlint/compare/v12.3.1...v12.4.0


12.3.1

3 months ago
12.3.1 (2022-12-30) Bug Fixes
  • deps: update babel monorepo to ^7.20.7 (30a1386)
  • textlint: fix ESM loading issue on Windows (#972) (a6b9bf5)

12.3.0

3 months ago
12.3.0 (2022-12-29) Features
  • monorepo: upgrade to lerna@6 and use NX (#964) (e372795)
  • textlint: add new APIs and new CLI for ESM (#965) (3be8e39)
Overview
  • Support Rules/Filter/Pluugins that are written in ECMAScript Modules
  • Add new CLI
  • Add new APIs: createLinter/loadTextlintrc/loadLinterFormatter/loadFixerFormatter
    • It will replace TextLintCore/TextFixEngine/TextLintEngine

📝 ESM Rules/Filter/Pluugins only works in createLinter API. This is because TextLintCore/TextFixEngine/TextLintEngine were assumed to be synchronous processes. createLinter API does loading as async.

Breaking Changes

No changes in existing CLI.

Difference between Old-CLI and New-CLI
  • New CLI support ESM
  • New CLI must require --stdin-filename with --stdin
    • --stdin-filename may be optional in Old-CLI
  • Correct exit status
Exit Status on new CLI

0: No Error

  • Not found lint error
  • --fix: found errors but fix all errors, so exit with 0
  • --output-file: Found lint error but --output-file is specified
  • --dryRun: Found lint error but --dryRun is specified

1: Lint Error

  • found lint error
  • --fix: found errors and could not fix all errors, so exit with 1

2: Fatal Error

  • Crash textlint process
  • Fail to load config/rule/plugin etc...
New APIs

Ww introduce new API like createLinter for supporting Async APIs. v13 continue to support current TextLintEngine and TextFixEngine for backward compatible.

  • #902

New createLinter and loadTextlintrc support ESM rules/plugins. In other hands, TextLintEngine and TextFixEngine can not support ESM rules/plugins.

https://github.com/textlint/textlint/blob/60cea514f7eaefbff4411087d16a51daf68f12a4/packages/textlint/src/index.ts

APIDescriptionBehaviorTarget PlatformPrev StatusNext Status
cliCommand LIne InterfaceAsyncNode.js✅ (Use createTextlint internally)
textlintTextLintCore aliasAsyncNode.js/CommonJS❌ Deprecated❌ Deprecated
TextLintCoreOld API. It is Procedural API. Lint Only Single File. Recommended to use @texltint/kernel module instead of It.AsyncNode.js/CommonJS❌ Deprecated❌ Deprecated
TextLintEngineLint Engine API. It load .textlintrc automaticaly◉ Loading is Sync
◉ Linting is Async
Node.js/CommonJS✅ Recommended❌ Deprecated
TextFixEngineFix Engine API. It load .textlintrc automaticaly◉ Loading is Sync
◉ Fixing is Async
Node.js/CommonJS✅ Recommended❌ Deprecated
createLinter/loadTextlintrcSupport Async APIs.◉ Loading is Async
◉ Linting/Fixing is Async
Node.js/CommonJS and ESMNone✅ Recommended
  • createLinter: create linter instance
    • lintFiles(files): lint files and return linter messages
    • lintText(text, filePath) lint text with virtual filePath and return linter messages
    • fixFiles(files lint text and return fixer messages
    • fixText(text, filePath) lint text with virtual filePath and return fixer messages
      • fixFiles and fixText does not modify files
  • loadTextlintrc: load .textlintrc config file and return a descriptor object
  • loadLinerFormatter and loadFixerFormatter: load formatter

Lint files and output to console.

import { createLinter, loadTextlintrc, loadLinterFormatter } from "textlint";
// descriptor is a structure object for linter
// It includes rules, plugins, and options
const descriptor = await loadTextlintrc();
const linter = createLinter({
    descriptor
});
const results = await linter.lintFiles(["*.md"]);
// textlint has two types formatter sets for linter and fixer
const formatter = await loadLinterFormatter({ formatterName: "stylish" })
const output = formatter.format(results);
console.log(output);

For more details, see https://textlint.github.io/docs/use-as-modules.html

How to use New CLI

New CLI is opt-in for avoiding Breaking Changes. It will be default in next major version.

You can try new textlint CLI via textlint-esm command.

- $ textlint "**/*.md"
+ $ textlint-esm "**/*.md"

Or, when TEXTLINT_USE_NEW_CLI=1 is set, textlint use new CLI

$ TEXTLINT_USE_NEW_CLI=1 textlint "**/*.md"

🔥 Welcome to feedback on Discussion: https://github.com/textlint/textlint/discussions/968

fix #868 fix https://github.com/textlint/textlint/issues/744 - new CLI fix this fix https://github.com/textlint/textlint/issues/103 - new CLI fix this fix #797 - extends descriptor instead of Config fix #293 - TextlintCore will be removed in the future


12.2.4

4 months ago
12.2.4 (2022-12-04) Bug Fixes
  • deps: update babel monorepo to ^7.20.2 (4f0364a)
  • deps: update dependency @babel/cli to ^7.19.3 (c7124c6)
  • textlint: support linting dot files (#947) (8811922) by @kellyselden

This release allow to lint dot file when setting dot file name for extensions.

{
  plugins: {
    '@textlint/text': {
      extensions: ['.lint-todo'],
    },
  }
  rules: {
    'eol-last': true,
  }
};

This version can lint .lint-todo file.

npx textlint .lint-todo

12.2.3

4 months ago
12.2.3 (2022-11-10) Bug Fixes
  • deps: update babel monorepo to ^7.19.1 (6a0dbb8)
  • deps: update babel monorepo to ^7.19.3 (e5c80eb)
  • deps: update dependency @babel/core to ^7.19.6 (3ba99ea)
  • deps: update dependency @babel/preset-env to ^7.19.4 (d1049bd)
  • deps: update dependency table to ^6.8.1 (abcb864)
  • deps: update dependency traverse to ^0.6.7 (fc0ea91)
  • linter-formatter: added lodash to dependencies (#934) (e97efb8)
  • types: expose TextlintPluginPreProcessResult/TextlintPluginPostProcessResult type #920 (49d990a)

12.2.2

6 months ago
12.2.2 (2022-09-20) Bug Fixes
  • markdown-to-ast: add mdast-util-gfm-autolink-literal to explicit deps (#904) (d2888a5)

This will fix pnpm issue #903

Dependencies Updates
  • deps: update babel monorepo to ^7.18.10 (dc0c555)
  • deps: update babel monorepo to ^7.18.6 (d8e30ae)
  • deps: update babel monorepo to ^7.18.6 (0f1b0fb)
  • deps: update babel monorepo to ^7.18.9 (558b4ee)
  • deps: update dependency @babel/core to ^7.18.13 (5c3ac1b)
  • deps: update dependency @babel/core to ^7.18.5 (17ab0d4)

12.2.1

9 months ago
12.2.1 (2022-06-25) What's Changed

Full Changelog: https://github.com/textlint/textlint/compare/v12.1.0...v12.2.1


12.2.0

9 months ago
12.2.0 (2022-06-25) Features

Implement Improve error location RFC #835 It will make the error location more details.

This change is for rule developer.

  • Add loc and range property to TextlintMessage(result)
  • Add padding prorperty to RuleError(message, details).
  • Add locator object to rule's context
    • lcoator.at(index), locator.range([startIndex, endIndex]), and locator.loc({ start: { line, column }, end: { line, column }}).
  • textlint-tester's valid and invalid support range property
  • Deprecate index, line and column property on TextlintMessage and report function
    • Preserve current behavior for backward compatible
  • Update filterMessages to use new range property on TextlintMessage
  • Use readonly [number, number] as range in all packages
  • Fix filterMessages bug https://github.com/textlint/textlint/pull/836/commits/c8a670f9b4fd7ce628a940dc4c8faabd5e62d396
  • Refactor tests
  • Update rule.md documentation
    • Add padding and locator object
    • Add peerDependencies note

textlint v12.2.0 will introduce padding and locator. If your will use it, please add peerDependencies to package.json on your rule package.

  "peerDependencies": {
    "textlint": ">= 12.2.0"
  },
  "peerDependenciesMeta": {
    "textlint": {
      "optional": true
    }
  }
For textlint rule creator

Before:

const { Syntax, report, RuleError } = context;
// .....
report(node, new RuleError(message, {
  index: 1
}));

After:

const { Syntax, report, RuleError, locator } = context;
// .....
report(node, new RuleError(message, {
  padding: locator.at(1)
}));

If you want to get more correct location, please use locator.range or locator.loc

const { Syntax, report, RuleError, locator } = context;
// .....
report(node, new RuleError(message, {
  padding: locator.range([1, 5]) // The error related to 1 - 5 index.
}));

For more details, see https://textlint.github.io/docs/rule.html#ruleerror

  • #835
Changelogs Bug Fixes
  • deps: update babel monorepo (89b2395)
  • deps: update babel monorepo (6a3e841)
  • deps: update babel monorepo (a91e594)
  • deps: update babel monorepo (c9f1957)
  • deps: update babel monorepo to ^7.16.5 (#834) (dcbc196)
  • deps: update babel monorepo to ^7.16.7 (e8c10aa)
  • deps: update babel monorepo to ^7.17.10 (1539f0a)
  • deps: Update chalk (#842) (56ba52c)
  • deps: update dependency @babel/core to ^7.17.12 (add5313)
  • deps: update dependency @babel/core to ^7.17.9 (db74d3a)
  • deps: update dependency @babel/core to ^7.18.2 (73c2047)
  • deps: update dependency table to ^6.7.5 (fdfcce6)
  • deps: update dependency table to ^6.8.0 (5e1aa18)
  • deps: Update packages that depend on ansi-regex (#841) (17c03cd)
  • deps: Update string-width (#844) (675bc93)
  • textlint: remove log-symbols (#845) (000d07a)
Features
  • textlint: add padding property and locator (#836) (f94d5f8)

12.1.1

1 year ago
12.1.1 (2022-02-23) Bug Fixes
  • deps: Update string-width by @massongit
  • deps: Update ansi-regex by @massongit

It will resolve the following audit alert.

ansi-regex 2.1.1 ~ 5.0.0 is vulnerable to Inefficient Regular Expression Complexity: https://github.com/advisories/GHSA-93q8-gq69-wqmw

Thanks to @massongit

Commits
  • deps: update babel monorepo (c9f1957)
  • deps: update babel monorepo to ^7.16.5 (#834) (dcbc196)
  • deps: update babel monorepo to ^7.16.7 (e8c10aa)
  • deps: Update chalk (#842) (56ba52c)
  • deps: update dependency table to ^6.7.5 (fdfcce6)
  • deps: update dependency table to ^6.8.0 (5e1aa18)
  • deps: Update packages that depend on ansi-regex (#841) (17c03cd)
  • deps: Update string-width (#844) (675bc93)
  • textlint: remove log-symbols (#845) (000d07a)

12.1.0

1 year ago
12.1.0 (2021-12-02) Features
  • kernel: allow textlint plugin to return Promise on pre/postProcess (#832) (ae89004)

See also: https://textlint.github.io/docs/plugin.html#preprocesstext-filepath-txtparentnode---text-string-ast-txtparentnode-

  • loadFromDir: load js and ts by default (3a12798)
Bug Fixes
  • deps: update babel monorepo to ^7.14.8 (ea3e897)
  • deps: update babel monorepo to ^7.15.0 (8801bc3)
  • deps: update babel monorepo to ^7.15.4 (1e2ae37)
  • deps: update babel monorepo to ^7.15.8 (d85a9b4)
  • deps: update babel monorepo to ^7.16.0 (ab38637)
  • deps: update dependency @babel/cli to ^7.15.4 (2d20865)
  • deps: update dependency @babel/cli to ^7.15.7 (604de3a)
  • deps: update dependency @babel/core to ^7.15.5 (94376ab)
  • deps: update dependency @babel/preset-env to ^7.14.9 (e362719)
  • deps: update dependency @babel/preset-env to ^7.15.6 (352270a)
  • deps: update dependency @babel/preset-env to ^7.16.4 (d065661)
  • deps: update dependency @babel/register to ^7.15.3 (8709aad)
  • deps: update dependency glob to ^7.2.0 (b4af236)
  • deps: update dependency strip-ansi to ^6.0.1 (129af22)
  • deps: update dependency table to ^6.7.3 (ba82895)
  • deps: update dependency unified to ^9.2.2 (1ca5596)
  • TextLintModuleMapper: broaden types for rules mappers (1f33ae3)

12.0.2

2 years ago
12.0.2 (2021-07-09)

The npm dependency table@3.8.3 depends on ajv@4.11.8 which is vulnerable #801

12.0.2 fixes this dependendies

Bug Fixes
  • deps: update npm dependency table from 3.8.3 to 6.7.1 #801
  • deps: update babel monorepo to ^7.14.5 (360fa5a)
  • deps: update babel monorepo to ^7.14.5 (f51ef8d)
  • deps: update dependency @babel/core to ^7.14.6 (f457b2b)
  • deps: update dependency @babel/preset-env to ^7.14.4 (5e16dbf)
  • deps: update dependency @babel/preset-env to ^7.14.7 (c0054fd)
  • deps: update dependency debug to ^4.3.2 (8cb5498)

12.0.0

2 years ago

Blog: https://textlint.github.io/blog/2021/05/24/textlint-12.html

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";
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. #779 Move https://github.com/textlint/textlint-scripts to https://github.com/textlint/textlint/tree/master/packages/textlint-scripts

@textlint/markdown-to-ast

It is a markdown parser in textlint. We have updated to remark@13.0.0 #717 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

It also updates trim package that is CVE-2020-7753.

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

Discussion: https://github.com/textlint/textlint/discussions/789


12.0.0-beta.3

beta
2 years ago

12.0.0-beta.2

2 years ago

12.0.0-beta.1

2 years ago

textlint user

npm install textlint@beta

textlint rule creator

npm install textlint-scripts@beta

See details in #738


12.0.0-beta.0

2 years ago

12.0.0 beta release

See details in #738.

Please try it and report bugs

npm install textlint@beta

5.2.13

2 years ago

5.2.12

2 years ago

5.2.11

2 years ago

5.2.10

2 years ago

5.2.9

2 years ago

5.2.8

2 years ago

5.2.7

2 years ago

5.2.6

3 years ago

5.2.5

3 years ago

5.2.4

3 years ago

5.2.3

3 years ago

5.2.2

3 years ago

5.2.1

3 years ago
Document Features
  • When not have rules, suggest to what to do #111

Not set rule and Not configure .textlintrc

Before:

$ textlint README.md

After:

$ textlint README.md

== Not have rules, textlint do not anything ==
=> How to set rule?
See https://github.com/textlint/textlint/blob/master/docs/configuring.md
Bug Fixes
  • docs: lint docs by textlint (c5d1a5e)
  • test: fix multiple done called (f51f3c2)
Features
  • textlint: add alexjs for linting docs (541683f)
  • typescript: add typing dir for npm (7816b99), closes #102
  • typescript: add property to d.ts (d0b238c)

5.2.0

3 years ago
Features
  • formatter: -f option resolve from pcakage name (b6b2b5b)

See https://github.com/textlint/textlint/blob/master/docs/formatter.md for details on.


5.1.16

3 years ago

5.1.15

3 years ago

5.1.14

3 years ago

5.1.13

3 years ago

5.1.12

3 years ago

5.1.11

3 years ago

5.1.10

4 years ago

5.1.9

4 years ago

5.1.8

4 years ago

5.1.7

4 years ago

5.1.6

4 years ago

5.1.5

4 years ago

5.1.4

4 years ago

5.1.3

4 years ago

5.1.2

4 years ago

5.1.1

4 years ago

5.1.0

4 years ago
Features rule-preset support

textlint-rule-preset-XXX support

e.g.)

Rule-preset is a collection of rules.

  • rule
    • rule is a rule for linting.
  • rule-preset
    • rule-preset contains rules.
  • plugin
    • plugin contains rules and a processor.


  • cli: add --preset option to cli (ac7b477)
  • config: add "disabledRules" to config (a7a0665)
  • rule: support "preset" of rules (c16a475), closes #96
  • rule: support scoped module (545b763) #99

5.0.13

4 years ago

5.0.12

4 years ago

5.0.11

5 years ago

5.1.0-alpha.0f2fd6f9

canary
5 years ago

5.1.0-alpha.bbfc8f6d

5 years ago

5.0.10

5 years ago

5.0.9

5 years ago

5.0.8

5 years ago

5.0.7

5 years ago

5.0.6

5 years ago

5.0.5

5 years ago

5.0.4

5 years ago

5.0.3

5 years ago

5.0.2

5 years ago
Bug Fixes
  • rule-context: correct padding column number (bbd5793) #90

5.0.1

5 years ago

5.0.0

5 years ago
Breaking Change

Make Lint API asynchronous!

Lint API always return Promise.

  • TextLintCore#LintFile
  • TextLintCore#LintText
  • TextLintEngine#executeOnFiles
  • TextLintEngine#executeOnText
  • cli#execute
var textlint = new TextLintCore();
textlint.lintMarkdown("text").then(result => {
      // 
});
Festures
  • Rule: async support #74
How to write async rule?
export default function (context) {
    return {
        [Syntax.Str](node){
            // textlint wait for resolved the promise.
            return new Promise((resolve, reject) => {
                // async task
            });
        }
    }
}

Bug Fixes
  • async: fix race condition on async (07dd51c)
  • use interop-require instead of require for dynamic loading (86e3004), closes #81
    • could use code generated by Babel 6
  • docs: remove value (c00646c)
  • example: add pretest (f1c7a57)
  • test: fix test that are broken at timing (1ea0def)
  • test: fix throws test (64ee56b)
  • test: install textlint-plugin-html with devDependencies (7d3eaf0)
  • test: fix all test for async (f19a64b)
Features
  • example: add use-as-module example (bc41157)
Performance Improvements
  • test: use production env for test (ba2b501)
Related Modules

5.0.0-next.2

next
5 years ago

5.0.0-next.1

5 years ago

5.0.0-next.0

5 years ago

4.0.3

5 years ago

4.0.2

5 years ago

4.0.1

5 years ago

4.0.0

5 years ago

Breaking Change

  • Switch to 1-based columns on TextLintMessage #38 #40

The Breaking Change related to textlint module user(use-as-modules.md).

Features

  • TextLintEngine#executeOnText and textlint#lintText support ext arguments. #36
    • use like executeOnText(text, ".md")
  • expose TextLintCore #41
  • Add "json" formatter #5

Fixed


3.7.1...4.0.0

  • jscs: format code for jscs (9556ea1)
  • engine: support extenstion (933492a)
  • index: expose TextLintCore to index (fccee7c)
  • plugin: introduce plugin Processor (d3d6e70)

4.0.0-beta.0

5 years ago

3.0.0

6 years ago
Update
  • update markdown-to-ast to 3.0

use mdast instead of CommonMark by azu · Pull Request #3 · azu/markdown-to-ast

Breaking Changes

markdown-to-ast 3.0.0 has some breaking changes.

use mdast instead of CommonMark

Break CommonMark dependent. If you have used CommonMark-dependent code, it may be broken.

CodeBlock Node

before:

CodeBlock.raw have not contain CodeBlock mark like ```

var code = 1;

after:

CodeBlock.raw have contain CodeBlock mark like ```

The raw value of CodeBlock node is following:

```
var code = 1;
```

if you want to get only code value, can get from node.vaule.

Alt text of Image Node

before(CommonMark):

Alt text of Image node is Str node.

after(mdast):

Alt text of Image node is not Str node. It is true that Alt text is a attribute of Image Node.


2.0.1

7 years ago

2.0.0

7 years ago
2.0.0 (2015-01-12) Breaking Change!

Rename CLIEngine to TextLintEngine

  • Difference between CLIEngine and TextLintEngine is arguments of constructor.

Update document and please see docs/use-as-modules.md.

Usage:

"use strict";
var TextLintEngine = require("textlint").TextLintEngine;
var path = require("path");
function lintFile(filePath) {
    /**
     * @type {TextLintConfig}
     * See lib/_typing/textlint.d.ts
     */
    var options = {
        // load rules from [../rules]
        rulePaths: [path.join(__dirname, "..", "rules/")],
        formatterName: "pretty-error"
    };
    var engine = new TextLintEngine(options);
    var filePathList = [path.resolve(process.cwd(), filePath)];
    var results = engine.executeOnFiles(filePathList);
    if (engine.isErrorResults(results)) {
        var output = engine.formatResults(results);
        console.log(output);
    }
}
Bug Fixes Features
  • cli-engine: cli-engine accept config object. (e9e914ae)

1.3.0

7 years ago
1.3.0 (2015-01-02) Bug Fixes
  • rule-context: use union-syntax instead of markdown-syntax (385ed4d0)
Features
  • markdown: Carve out parse/markdown to module (6b310fae) #4

We use azu/markdown-to-ast as markdown parser module, now! (It's based on CommonMarkdown)

It make context.getSource() more correct!


1.2.0

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

98 Versions

TagPublished
13.3.1latest24d ago
13.3.01mo ago
13.2.01mo ago
13.1.41mo ago
13.1.32mos ago
13.1.22mos ago
13.1.12mos ago
13.1.02mos ago
13.0.52mos ago
13.0.42mos ago
13.0.32mos ago
13.0.22mos ago
13.0.12mos ago
13.0.02mos ago
12.6.12mos ago
12.6.02mos ago
12.5.22mos ago
12.5.13mos ago
12.5.03mos ago
12.4.03mos ago
12.3.13mos ago
12.3.03mos ago
12.2.44mos ago
12.2.34mos ago
12.2.26mos ago
12.2.19mos ago
12.2.09mos ago
12.1.11yr ago
12.1.01yr ago
12.0.22yrs ago
12.0.02yrs ago
12.0.0-beta.3beta2yrs ago
12.0.0-beta.22yrs ago
12.0.0-beta.12yrs ago
12.0.0-beta.02yrs ago
5.2.132yrs ago
5.2.122yrs ago
5.2.112yrs ago
5.2.102yrs ago
5.2.92yrs ago
5.2.82yrs ago
5.2.72yrs ago
5.2.63yrs ago
5.2.53yrs ago
5.2.43yrs ago
5.2.33yrs ago
5.2.23yrs ago
5.2.13yrs ago
5.2.03yrs ago
5.1.163yrs ago
5.1.153yrs ago
5.1.143yrs ago
5.1.133yrs ago
5.1.123yrs ago
5.1.113yrs ago
5.1.104yrs ago
5.1.94yrs ago
5.1.84yrs ago
5.1.74yrs ago
5.1.64yrs ago
5.1.54yrs ago
5.1.44yrs ago
5.1.34yrs ago
5.1.24yrs ago
5.1.14yrs ago
5.1.04yrs ago
5.0.134yrs ago
5.0.124yrs ago
5.0.115yrs ago
5.1.0-alpha.0f2fd6f9canary5yrs ago
5.1.0-alpha.bbfc8f6d5yrs ago
5.0.105yrs ago
5.0.95yrs ago
5.0.85yrs ago
5.0.75yrs ago
5.0.65yrs ago
5.0.55yrs ago
5.0.45yrs ago
5.0.35yrs ago
5.0.25yrs ago
5.0.15yrs ago
5.0.05yrs ago
5.0.0-next.2next5yrs ago
5.0.0-next.15yrs ago
5.0.0-next.05yrs ago
4.0.35yrs ago
4.0.25yrs ago
4.0.15yrs ago
4.0.05yrs ago
4.0.0-beta.05yrs ago
3.0.06yrs ago
2.0.17yrs ago
2.0.07yrs ago
1.3.07yrs ago
1.2.07yrs ago
1.1.07yrs ago
1.0.17yrs ago
1.0.07yrs ago