@textlint/kernel
textlint kernel is core logic by pure JavaScript.
This module is 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-plugin-markdown")
}
],
rules: [
{
ruleId: "no-todo",
rule: require("textlint-rule-no-todo")
}
]
};
kernel.lintText("TODO: text", options).then(result => {
assert.ok(typeof result.filePath === "string");
assert.ok(result.messages.length === 1);
});
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.
- Fork it!
- Create your feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request :D
Author
License
MIT © azu