14.5.0 • Published 3 months ago

@textlint/kernel v14.5.0

Weekly downloads
14,987
License
MIT
Repository
github
Last release
3 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.5.0

3 months ago

14.4.1

5 months ago

14.4.2

5 months ago

14.4.0

6 months ago

14.3.0

8 months ago

14.2.1

8 months ago

14.1.0

10 months ago

14.2.0

10 months ago

14.0.5

10 months ago

14.0.4

1 year ago

14.0.3

1 year ago

14.0.2

1 year ago

14.0.1

1 year ago

14.0.0

1 year ago

13.4.2-next.0

1 year ago

13.4.1

2 years ago

13.3.3

2 years ago

13.4.0

2 years ago

13.3.2

2 years ago

13.3.1

2 years ago

13.1.3

2 years ago

13.1.4

2 years ago

13.1.1

2 years ago

13.3.0

2 years ago

13.1.2

2 years ago

13.1.0

2 years ago

13.0.5

2 years ago

13.2.0

2 years ago

12.6.1

2 years ago

12.6.0

2 years ago

13.0.4

2 years ago

13.0.2

2 years ago

13.0.3

2 years ago

13.0.0

2 years ago

13.0.1

2 years ago

12.5.2

2 years ago

12.3.0

2 years ago

12.5.0

2 years ago

12.2.3

3 years ago

12.2.2

3 years ago

12.2.1

3 years ago

12.2.0

3 years ago

12.1.1

3 years ago

12.1.0

4 years ago

12.0.2

4 years ago

12.0.0-beta.2

4 years ago

12.0.0-beta.3

4 years ago

12.0.0-beta.0

4 years ago

12.0.0-beta.1

4 years ago

12.0.0

4 years ago

3.4.5

4 years ago

3.4.4

4 years ago

3.4.3

4 years ago

3.4.2

4 years ago

3.4.1

4 years ago

3.4.0

4 years ago

3.3.7

4 years ago

3.3.6

5 years ago

3.3.5

5 years ago

3.3.4

5 years ago

3.3.1

5 years ago

3.3.0

5 years ago

3.3.3

5 years ago

3.3.2

5 years ago

3.2.1

5 years ago

3.2.0

5 years ago

3.1.10

6 years ago

3.1.9

6 years ago

3.1.8

6 years ago

3.1.7

6 years ago

3.1.6

6 years ago

3.1.5

6 years ago

3.1.4

6 years ago

3.1.3

6 years ago

3.1.2

6 years ago

3.1.1

6 years ago

3.1.0

6 years ago

3.0.1

6 years ago

3.0.0

7 years ago

2.0.9

7 years ago

2.0.8

7 years ago

2.0.7

7 years ago

2.0.6

7 years ago

2.0.5

7 years ago

2.0.4

7 years ago

2.0.3

7 years ago

2.0.2

7 years ago

2.0.1

7 years ago

2.0.0

7 years ago

2.0.0-next.2

7 years ago

2.0.0-next.1

7 years ago

2.0.0-next.0

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago

1.0.0-beta.0

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

0.0.0

8 years ago