textlint

The pluggable natural language linter for text and markdown.

MIT License

Downloads
7.4M
Stars
2.8K
Committers
83

Bot releases are hidden (Show)

textlint - https://github.com/textlint/textlint/releases/tag/7.1.4

Published by azu almost 8 years ago

textlint - https://github.com/textlint/textlint/releases/tag/7.1.3

Published by azu almost 8 years ago

Bug Fixes

  • bin: not use Arrow Function (f69ae96)

Performance Improvements

textlint -

Published by azu about 8 years ago

Bug Fixes

  • use is-file insteadof exists-sync (d15ff60)
textlint - https://github.com/textlint/textlint/releases/tag/7.1.1

Published by azu about 8 years ago

Bug Fixes

  • d.ts: export as a class (f757b4b)
  • fixer: fix to work commands that accept Node (ed1d52b), closes #229
  • jsdoc: fix invalid JSDoc (aca3148)
textlint -

Published by azu about 8 years ago

Features

  • cli: --init fill with installed rules (3948147), closes #129
textlint -

Published by azu over 8 years ago

Bug Fixes

textlint - https://github.com/textlint/textlint/releases/tag/7.0.1

Published by azu over 8 years ago

Bug Fixes

  • core: remove --experimental flag of shouldIgnore() (b1e2a17)
textlint -

Published by azu over 8 years ago

Features

Filter rule 🆕

  • "filter rule" support #216 #207

Filter rule provide filtering error that is reported by linting rule.

For example, textlint-filter-rule-comments provide filtering function by using comments.

<!-- textlint-disable -->

Disables all rules between comments

<!-- textlint-enable -->`

Allow to short textlint-filter-rule-comments to comments.

Add filter rule name to filters field.

{
  "filters": {
    "comments": true
  }
}

One more example, very-nice-rule is useful, but you want to ignore some reported error in your text.
very-nice-rule also check the BlockQuote text, but you want to ignore the BlockQuote text.
textlint-filter-rule-node-types rule resolve the issue.

{
  "filters": {
    "node-types": {
      "nodeTypes": ["BlockQuote"]
    }
  },
  "rules": {
    "very-nice-rule": true
  }
}

Sharable Config 🆕

  • config: --config @textlint/textlint-config support (a059df7)

See Sharable Configuration for details.

Example : azu/textlint-config-readme: Sharable config for textlint

You can use the config via two step.

npm i -D @azu/textlint-config-readme textlint
$(npm bin)/textlint --config @azu/textlint-config-readme README.md

Breaking Change ⚠️

textlint 7.0 has some breaking change.
It will not affect textlint user, but affect to textlint rule developer.

Ignore duplicated messages by default #209

Duplicated messages is ignored by default.

Duplicated messages is that have same range and same message.
(Not depended on ruleId. ruleId is flexible property)

Sort messages by line and column #218

textlint 7.0 sort message by line and column.
The rule that depended on the order of messages may fail test.

Drop Node.js 0.12 support #215

textlint 7.0 not support Node.js 0.12. (But still it work)
Requirement: Node.js 4.0.0 >=

textlint - 7.0.0 beta release

Published by azu over 8 years ago

This is beta release

Please try it :)

npm install textlint@beta

Features

Filter rule

  • "filter rule" support #216 #207

Filter rule provide filtering error that is reported by linting rule.

For example, textlint-filter-rule-comments provide filtering function by using comments.

<!-- textlint-disable -->

Disables all rules between comments

<!-- textlint-enable -->`

Allow to short textlint-filter-rule-comments to comments.

Add filter rule name to filters field.

{
  "filters": {
    "comments": true
  }
}

One more example, very-nice-rule is useful, but you want to ignore some reported error in your text.
very-nice-rule also check the BlockQuote text, but you want to ignore the BlockQuote text.
textlint-filter-rule-node-types rule resolve the issue.

{
  "filters": {
    "node-types": {
      "nodeTypes": ["BlockQuote"]
    }
  },
  "rules": {
    "very-nice-rule": true
  }
}

Sharable Config

  • config: --config @textlint/textlint-config support (a059df7)

See Sharable Configuration for details.

Example : azu/textlint-config-readme: Sharable config for textlint

You can use the config via two step.

npm i -D @azu/textlint-config-readme textlint
$(npm bin)/textlint --config @azu/textlint-config-readme README.md

Breaking Change

textlint 7.0 has some breaking change.
It will not affect textlint user, but affect to textlint rule developer.

Ignore duplicated messages by default #209

Duplicated messages is ignored by default.

Duplicated messages is that have same range and same message.
(Not depended on ruleId. ruleId is flexible property)

Sort messages by line and column #218

textlint 7.0 sort message by line and column.
The rule that depended on the order of messages may fail test.

Drop Node.js 0.12 support #215

textlint 7.0 not support Node.js 0.12. (But still it work)
Requirement: Node.js 4.0.0 >=

textlint -

Published by azu over 8 years ago

Documents

ast-explorer for textlint

AST explorer for textlint is useful for understanding AST.

  • Add filter rules document #221

Features

  • debug: add debug log to task (c05a7b3)

Try to run DEBUG=textlint* textlint README

textlint -

Published by azu over 8 years ago

Features

  • Don't load duplicated rule with ruleConfig Issue #219

See https://github.com/textlint/textlint/blob/master/docs/rule.md#implementation-node-memo for details.

  • RuleCreatorSet: add #withoutDuplicated()(812b13e)
  • task: use ruleCreatorSet#withoutDuplicated() for filtering duplicated rule(261d90f)
textlint -

Published by azu over 8 years ago

--experimental Features

These features are experimental

You can use it with --experimental flag

$ textlint --experimental
  • filter: add filter-duplicated-process (#217)(bb87855)

Duplicated messages is ignored by default.
Duplicated messages is that have same position information(index) and same message.

  • filter: re-enable sort messages by line and column (#218)(385a82c)
textlint -

Published by azu over 8 years ago

semi-Breaking change

Proposal #212 and implement #214

Support "filters" field and Drop support "ignoring-rule"
These are experimental feature. 🚧

See filter rule document for details.

{
   "filters": {
      "node-types": {
        "nodeTypes": ["BlockQuote"]
      }
   },
   "rules": {}
}

Features

internal

  • Added MessageProcessManager.
  • This manager process TextLintMessages.
  • Main usecase filter messages.
textlint -

Published by azu over 8 years ago

Features

  • ignore: add { ruleId } option object to shouldIgnore (#208) (de0ff6f)

When the ruleId of option object is matched ruleId of error message, filter only the message,
Default is filter all message in the ignoring range.

UseCase

https://github.com/textlint/textlint-rule-ignore-comment

<!-- textlint-disable ruleA -->

this is wrong

<!-- textlint-enable -->

Disable specific rule on the fly.

Breaking Change(experimental)

shouldIgnore(range) only ignore messages of the ruleId.

It means that shouldIgnore(range) === shouldIgnore(range, { ruleId : this.id }).
It attempt to make safe by default.

"*" is danger because "*" affect to other rules.

textlint - https://github.com/textlint/textlint/releases/tag/6.7.0

Published by azu over 8 years ago

Features

  • node: add "Comment" type (#205) (640f84d), closes #204

Performance Improvements

  • test: run example tests by foreman (#206) (cc9e489)
textlint -

Published by azu over 8 years ago

Features

  • change shouldIgnore(range) API #203

Previously, ignoring api is shouldIgnore(<node>). #194

But, I think that shouldIgnore([start, end]) is better.
Because, ignoring rule is not always depended on .
It always depended on <range> which is like [number, number].

This change is breaking change, but ignoring feature is experimental support.
As as result, we have published as minor version.

Fix: #202
Refs: #193

textlint - https://github.com/textlint/textlint/releases/tag/6.5.1

Published by azu over 8 years ago

Bug Fixes

  • npm: fix "files" fileld (264c867)
textlint -

Published by azu over 8 years ago

Features

  • index: export TextLintNodeType as TextLintNodeType (f6c1e61)

You can use this TextLintNodeType value by the following way:

import {TextLintNodeType} from "textlint";
console.log(TextLintNodeType.Str); // "Str"

Please see https://github.com/textlint/textlint/blob/master/docs/txtnode.md

textlint -

Published by azu over 8 years ago

Features

Ignore rule is experimental. It used with --experimental.

Please see https://github.com/textlint/textlint/blob/master/docs/rule.md

  • context.shouldIgnore(node) 🆕
textlint -

Published by azu over 8 years ago

Features

  • core: add fileName to trailing of error message (bd1f454), closes #165

Show where the error is occurring.

When throw error in the rule.

module.exports = function (context) {
    var exports = {};
    exports[context.Syntax.Str + ":exit"] = function () {
        throw new Error("Error in rule");
    };
    return exports;
};

Before:

Error in rule

After:

Error in rule at ~/textlint/textlint/test/rule-context/fixtures/test.md
  • core: always start asynchronous (3ef2a62), closes #178