14.0.4 • Published 2 months ago

@textlint/kernel v14.0.4

Weekly downloads
14,987
License
MIT
Repository
github
Last release
2 months ago

@textlint/kernel

textlint kernel is core logic by pure JavaScript.

This module is a low layer of textlint.

No plugin, No rule, No filter rule by default.

Install

Install with npm:

npm install @textlint/kernel

Usage

import { TextlintKernel } from "@textlint/kernel";
const kernel = new TextlintKernel();
const options = {
    filePath: "/path/to/file.md",
    ext: ".md",
    plugins: [
        {
            pluginId: "markdown",
            plugin: require("@textlint/textlint-plugin-markdown")
        }
    ],
    rules: [
        {
            ruleId: "no-todo",
            rule: require("textlint-rule-no-todo").default
        }
    ]
};
kernel.lintText("TODO: text", options).then(result => {
    assert.ok(typeof result.filePath === "string");
    assert.ok(result.messages.length === 1);
});

Notes: Preset is a collection of Rules. Currently, presets option does not exist.

Type Interface

@textlint/kernel export core types of textlint.

If you use TypeScript, this types help you.

// Types
import {
    TextlintResult,
    TextlintFixResult,
    TextlintFixCommand,
    TextlintMessage,
    // Kernel rule/filter/plugin format
    TextlintKernelRule,
    TextlintKernelFilterRule,
    TextlintKernelPlugin,
    // textlint rule interface
    TextlintRuleCreator,
    TextlintRuleOptions,
    // textlint filter rule interface
    TextlintFilterRuleCreator,
    TextlintFilterRuleOptions,
    // textlint plugin interface
    TextlintPluginCreator,
    TextlintPluginOptions,
    TextlintPluginProcessor,
    TextlintPluginProcessorConstructor
} from "@textlint/kernel";

Changelog

See Releases page.

Running tests

Install devDependencies and Run npm test:

npm i -d && npm test

Contributing

Pull requests and stars are always welcome.

For bugs and feature requests, please create an issue.

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

Author

License

MIT © azu

14.0.4

2 months ago

14.0.3

2 months ago

14.0.2

3 months ago

14.0.1

3 months ago

14.0.0

3 months ago

13.4.2-next.0

3 months ago

13.4.1

5 months ago

13.3.3

10 months ago

13.4.0

6 months ago

13.3.2

1 year ago

13.3.1

1 year ago

13.1.3

1 year ago

13.1.4

1 year ago

13.1.1

1 year ago

13.3.0

1 year ago

13.1.2

1 year ago

13.1.0

1 year ago

13.0.5

1 year ago

13.2.0

1 year ago

12.6.1

1 year ago

12.6.0

1 year ago

13.0.4

1 year ago

13.0.2

1 year ago

13.0.3

1 year ago

13.0.0

1 year ago

13.0.1

1 year ago

12.5.2

1 year ago

12.3.0

1 year ago

12.5.0

1 year ago

12.2.3

1 year ago

12.2.2

2 years ago

12.2.1

2 years ago

12.2.0

2 years ago

12.1.1

2 years ago

12.1.0

2 years ago

12.0.2

3 years ago

12.0.0-beta.2

3 years ago

12.0.0-beta.3

3 years ago

12.0.0-beta.0

3 years ago

12.0.0-beta.1

3 years ago

12.0.0

3 years ago

3.4.5

3 years ago

3.4.4

3 years ago

3.4.3

3 years ago

3.4.2

3 years ago

3.4.1

3 years ago

3.4.0

3 years ago

3.3.7

3 years ago

3.3.6

4 years ago

3.3.5

4 years ago

3.3.4

4 years ago

3.3.1

4 years ago

3.3.0

4 years ago

3.3.3

4 years ago

3.3.2

4 years ago

3.2.1

4 years ago

3.2.0

4 years ago

3.1.10

4 years ago

3.1.9

5 years ago

3.1.8

5 years ago

3.1.7

5 years ago

3.1.6

5 years ago

3.1.5

5 years ago

3.1.4

5 years ago

3.1.3

5 years ago

3.1.2

5 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.1

5 years ago

3.0.0

6 years ago

2.0.9

6 years ago

2.0.8

6 years ago

2.0.7

6 years ago

2.0.6

6 years ago

2.0.5

6 years ago

2.0.4

6 years ago

2.0.3

6 years ago

2.0.2

6 years ago

2.0.1

6 years ago

2.0.0

6 years ago

2.0.0-next.2

6 years ago

2.0.0-next.1

6 years ago

2.0.0-next.0

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago

1.0.0-beta.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago

0.0.0

7 years ago