diff --git a/blog/atom.xml b/blog/atom.xml
index d6267e43..bad634c8 100644
--- a/blog/atom.xml
+++ b/blog/atom.xml
@@ -13,7 +13,7 @@
textlint v14 requires Node.js v18.14.0;.
Node.js 16 is already EOL, so we drop support for Node.js 16. If you use old...
]]> +textlint v14 requires Node.js v18.14.0;.
Node.js 16 is already EOL, so we drop support for Node.js 16. If you use old...
]]>This release adds some new features and fixes several bugs found in the previous release. This release also has some breaking changes.
For textlint user
textlint ...
]]>This release adds some new features and fixes several bugs found in the previous release. This release also has some breaking changes.
For textlint user
textlint ...
]]>This release adds some new features and fixes several bugs found in the previous release. This release also has some breaking changes.
This release adds some new features and fixes several bugs found in the previous release. This release also has some breaking changes.
textlint v14 requires Node.js v18.14.0;.
Node.js 16 is already EOL, so we drop support for Node.js 16. If you use old...
]]>textlint v14 requires Node.js v18.14.0;.
Node.js 16 is already EOL, so we drop support for Node.js 16. If you use old...
]]>This release adds some new features and fixes several bugs found in the previous release. This release also has some breaking changes.
For textlint user
textlint ...
]]>This release adds some new features and fixes several bugs found in the previous release. This release also has some breaking changes.
For textlint user
textlint ...
]]>This release adds some new features and fixes several bugs found in the previous release. This release also has some breaking changes.
This release adds some new features and fixes several bugs found in the previous release. This release also has some breaking changes.
fixFiles
and fixText
does not modify filesscanFilePath(filePath): Promise<ScanFilePathResult>
check the the file path is lintable or notloadTextlintrc
: load .textlintrc
config file and return a descriptor objectloadLinerFormatter
and loadFixerFormatter
: load formatterLint files and output to console.
+import { createLinter, loadTextlintrc, loadLinterFormatter } from "textlint";
// descriptor is a structure object for linter
// It includes rules, plugins, and options
@@ -99,7 +101,7 @@ const output = formatter.format(results);
console.log(output);
-Fix text and get the fixed text.
+import { createLinter, loadTextlintrc } from "textlint";
// descriptor is a structure object for linter
// It includes rules, plugins, and options
@@ -110,7 +112,7 @@ const result = await linter.fixText("TODO: fix me", "DUMMY.md");
console.log(result.output); // fixed result
-Add custom rules and plugins.
+import { createLinter, loadTextlintrc } from "textlint";
import { TextlintKernelDescriptor } from "@textlint/kernel";
import { moduleInterop } from "@textlint/module-interop";
@@ -135,16 +137,29 @@ // if same ruleId or pluginId, customDescriptor is used.
descriptor: customDescriptor.concat(textlintrcDescriptor)
});
-const result = await linter.lintText("TODO: fix me");
+const result = await linter.lintText("TODO: fix me", "README.md");
console.log(result);
-Get lintable file extensions.
-textlintrcDescriptor.availableExtensions
provide list of supported file extensions.
textlintrcDescriptor.availableExtensions
provide list of supported file extensions.
import { createLinter, loadTextlintrc } from "textlint";
const textlintrcDescriptor = await loadTextlintrc();
const availableExtensions = textlintrcDescriptor.availableExtensions;
console.log(availableExtensions); // => [".md", ".txt"]
+import { createLinter, loadTextlintrc } from "textlint";
+const textlintrcDescriptor = await loadTextlintrc();
+const linter = createLinter({
+ descriptor: textlintrcDescriptor
+});
+const result = await linter.scanFilePath("README.md");
+// result.status is "ok" or "ignored" or "error"
+if (result.status === "ok") {
+ const lintResult = await linter.lintText("README content", "README.md");
+ console.log(lintResult);
+}
+
textlint has two engines TextLintEngine
and TextFixEngine
.