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 -

Published by azu over 8 years ago

Features

  • 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
textlint - https://github.com/textlint/textlint/releases/tag/6.1.1

Published by azu over 8 years ago

textlint - reverted

Published by azu over 8 years ago

Features

  • core: sort messages by line and column (9b2b400), closes #126

EDIT It is reverted and released 6.1.1.

https://github.com/textlint/textlint/commit/3651f9df61738d1ab49752885138cf436d8675e5
https://github.com/textlint/textlint/commit/106da2f7fa8ae927266df346cbbc89759417c6f7

This change break some test case that has a implementation dependent.

Bug Fixes

  • JSDoc: fix jSDoc using jsdoc-to-assert (3082435)
  • plugin: fix 3rd party plugin is not working (0fae5bc), closes #180
  • config: Config's extensions can include plugin's availableExtensions. (98fb11d)
textlint - 6.0.4: 3rd party plugins doesn't work

Published by azu over 8 years ago

Fixes

  • 3rd party plugins doesn't work #180 #181

e.g.) https://github.com/textlint/textlint-plugin-html

When load a plugin, then textlint take cognizance available extensions like ".html".
But, textlint v6.0.3 could not add the additional extension to engine.availableExtensions.
As as result, alway passed! It is wrong.

textlint - 6.0.3: Fix problems installing

Published by azu over 8 years ago

Summary of Breaking

@azer has unpublished all his npm module.

textlint-formatter depened on his modules.

We have fixed ths issue and patch release.

Bug Fixes

  • npm: fix installing of textlint (81cb2c4)
textlint -

Published by azu over 8 years ago

Features

  • d.t.s: Add TextLintRuleContext to textlint.d.ts (df2cb9d), closes #171
  • source-location: improve error message (0b1a792)

Docs

TxtNode/TxtAST #170

textlint - 6.0: --fix to be stable

Published by azu over 8 years ago

Breaking Change

These changes won't affect user.

  • Remove TextLintEngine#setRulesBaseDirectory

Please use

new TextLintEngine({
 rulesBaseDirectory: directory
});
  • Remove --experimental flag from --fix

TextLintEngine#fixFiles(files) and TextLintEngine# fixText(text, ext = ".txt") have been removed at 6.0.
It was introduced at 5.5.3: --fix & --experimental support.

After hard refactoring, TextLintEngine was split to TextFixEngine and TextLintEngine.

Please use TextFixEngine instead of above method.

  • TextFixEngine#executeOnFiles(files): TextLintFixResult[]
  • TextFixEngine#executeOnText(text, evt): TextLintFixResult[]

Features

--fix

textlint 5.5~ introduces the --fix command line argument to automatically fix some rules.

$ textlint --fix README.md
# fixed by each rule

Lint: textlint README.md

javascript-plugin-architecture zsh 2016-03-18 12-08-18

Fix: textlint --fix --dry-run -f diff README.md with dry-run mode

javascript-plugin-architecture zsh 2016-03-18 12-07-19

Actually Fix: textlint --fix README.md

📝

Not all rules is fixable.
So, it is difficult that make all rules fixable.

What are rules fixable?

textlint rule

You check textlint/textlint Wiki also.

How to create fixable rule?

ℹ️ Please See Creating fixable rule for detail.

How to test the rule

Please use textlint-tester.

textlint -

Published by azu over 8 years ago

Breaking Change(near internal)

  • #161
textlint - 6.0.0 beta-0

Published by azu over 8 years ago

This is beta release of 6.0

Please test it!

npm i -D textlint@beta

Please see textlint 6.0 · Issue #145 · textlint/textlint

Bug Fixes

  • config: fix config-initializer test (9935b90)
  • fixer: fix lint error (884f502)
  • rule-context: the default severity should always be error (02425ea), closes #144

Features

  • cli: add --dry-run (9aef49f)
  • core: add Core#setupProcessors (76ad42e)
  • fixer: --fix to be stable (5134c22)
  • fixer: add -f diff formatter (77ddf06)
  • fixer: add fixable stylish formatter (bcce3d8)
  • fixer: add formatter creator (52edc5f)
  • fixer: add textfix-engine ! (ae6aacc)

Reverts

textlint -

Published by azu over 8 years ago

Bug Fixes

Features

--format stylish and --format pretty-error show _fixable problem_s.

fix zsh 2016-03-09 22-52-47

textlint -

Published by azu over 8 years ago

Features

  • rule: context.report support index-based postion (7a0c80b), closes #134

If you want to know for detail, please see the documents: https://github.com/textlint/textlint/blob/master/docs/rule.md#ruleerror

Motivation

Previously, textlint's RuleError support line and column.

e.g.) It is wrong that column doen't consider line break.

//  surrogate pair 
function stringToArray(value) {
    return value.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
}

export default function (context) {
    let {Syntax, RuleError, report, getSource} = context;
    return {
        [Syntax.Str](node){
            const text = getSource(node);
            const strArray = stringToArray(text);
            for (let index = 0; index < strArray.length; index++) {
                const item = strArray[index];
                if (//.test(item)) {
                    report(node, new RuleError("Use X insteadof ❌", {
                          column: index
                    }));
                }
            }
        }
    }
}

Input:

string
string

Result of TextLintMessage:

{
   "message": "Use X insteadof ❌",
   "line": 1,
   "column": 7
}

Expected:

{
   "message": "Use X insteadof ❌",
   "line": 2,
   "column": 1
}

5.6.0 allow to write this like

//  surrogate pair 
function stringToArray(value) {
    return value.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g) || [];
}

export default function (context) {
    let {Syntax, RuleError, report, getSource} = context;
    return {
        [Syntax.Str](node){
            const text = getSource(node);
            const strArray = stringToArray(text);
            for (let index = 0; index < strArray.length; index++) {
                const item = strArray[index];
                if (//.test(item)) {
                    report(node, new RuleError("Use X insteadof ❌", {
                          index: index // <= index
                    }));
                }
            }
        }
    }
}

)

Performance Improvements

  • example: use --cache-min 9999999 (d9035b3)
textlint - https://github.com/textlint/textlint/releases/tag/5.5.5

Published by azu over 8 years ago

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

Published by azu over 8 years ago

Bug Fixes

  • cli: fix detection of --experimental flag (fe5b4bf)
  • cli: fix detection of cli (ee69a6f)
textlint - 5.5.3: --fix & --experimental support

Published by azu over 8 years ago

Features(--experimental)

--fix and --experimental support ⚠️

Status: experimental 🚧

You can use automatically fixes feature with experimental flag.

$ textlint --experimental --fix README.md
# fixed by each rule

⚠️ Caution ⚠️

Currently, --fix is unstable(use with --experimental).
It mean that there is a possibility of change in the future.

Not all rules is fixable.
So, it is difficult that make all rules fixable.

🚧 If you found a bug, please file issue 🆘

What are rules fixable?

How to create fixable rule?

ℹ️ Please See Creating fixable rule for detail.

How to testing

Related Issues

If you want to improve fixable feature, please comment above the issue.

We don't think that this feature is complete 💭

Error ⚠️

If you see following error

.../node_modules/textlint/lib/textlint-core.js:80
                    throw new Error('Definition for rule \'' + key + '\' was not found.');
                    ^

Error: Definition for rule 'prh' was not found.

You should update textlint to ^5.5.
Some rules like textlint-rule-prh dependent on textlint >= 5.5.

npm install -D textlint@^5.5

  • cli: --fix options support (ebc058e)
  • cli: add --experimental flag (13b0593)
  • example: add fix example (277c253)
  • typescript: update textlint.d.ts (065751f)

Bug Fixes

textlint - https://github.com/textlint/textlint/releases/tag/5.5.3-0

Published by azu over 8 years ago

Bug Fixes

  • fixer: fix to pass options fixer function of rule (79c7565)
textlint - https://github.com/textlint/textlint/releases/tag/5.5.2-0

Published by azu over 8 years ago

Features

  • rule-error: RuleError support fix options (8fce575)
textlint - https://github.com/textlint/textlint/releases/tag/5.5.1-0

Published by azu over 8 years ago

Bug Fixes

  • task: remove memory leak detected message (52d35b2)
  • test: rename text to output (97d277a)

Features

  • fixer: add SourceCodeFixer#revertFixes (7006219)
  • fixer: initial implementation of fixer (9f5f3a9)
textlint -

Published by azu over 8 years ago

Bug Fixes

  • cli: remove memory leak detected warning. (97c6bdc) #33 #132

If you see this warning, please update textlint to 5.4.1.

(node) warning: possible EventEmitter memory leak detected. 11 Str listeners added. Use emitter.setMaxListeners() to increase limit.

textlint - https://github.com/textlint/textlint/releases/tag/5.5.0-0

Published by azu over 8 years ago

Features

  • fixer: add SourceCodeFixer#revertFixes (96d1fc1)
  • fixer: initial implementation of fixer (d28dfbc)
textlint -

Published by azu over 8 years ago

Features

  • add --init option like eslint. #127 by @takahashim

textlint --init create a .textlintrc file in your directory.

$ textlint --init

If you are instersted in improving this, please see --init options: Create .textlintrc file #129

Bug Fixes