| Title: | Natural Language Linter Tools for 'R Markdown' and R Code |
|---|---|
| Description: | What the package does (one paragraph). |
| Authors: | Shinya Uryu [aut, cre] (ORCID: <https://orcid.org/0000-0002-0493-6186>), azu [cph] (textlint JavaScript library) |
| Maintainer: | Shinya Uryu <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.0.0.9000 |
| Built: | 2026-05-08 08:20:54 UTC |
| Source: | https://github.com/uribo/textlintr |
Install textlint rule modules
add_rules(rules = NULL, scope = "dev")add_rules(rules = NULL, scope = "dev")
rules |
the name of rule; see |
scope |
'dev' or 'global'. |
## Not run: add_rules("first-sentence-length", "dev") # Skip already exist are ignored add_rules(c("no-todo", "first-sentence-length"), scope = "dev") # Global install add_rules("first-sentence-length", "global") ## End(Not run)## Not run: add_rules("first-sentence-length", "dev") # Skip already exist are ignored add_rules(c("no-todo", "first-sentence-length"), scope = "dev") # Global install add_rules("first-sentence-length", "global") ## End(Not run)
Check textlint running environment
check_dependencies_available(.node_module_path = NULL)check_dependencies_available(.node_module_path = NULL)
.node_module_path |
By default, it refers to the global path and local directory. If an arbitrary path is given, it refers to that path. |
## Not run: is_available_textlint() ## End(Not run)## Not run: is_available_textlint() ## End(Not run)
Config textlint rule file
configure_lint_rules(lintrc = ".textlintrc", open = FALSE)configure_lint_rules(lintrc = ".textlintrc", open = FALSE)
lintrc |
file path to .textlintrc. Default, searcing from current directory. |
open |
If you want to modify a |
list
## Not run: configure_lint_rules() ## End(Not run)## Not run: configure_lint_rules() ## End(Not run)
Initialise a textlint
init_textlintr(rules = "common-misspellings", scope = "dev")init_textlintr(rules = "common-misspellings", scope = "dev")
rules |
the name of rule; see |
scope |
'dev' or 'global'. |
## Not run: init_textlintr() ## End(Not run)## Not run: init_textlintr() ## End(Not run)
Test for the existence of textlint as a prerequisite
is_available_textlint(.node_module_path = NULL)is_available_textlint(.node_module_path = NULL)
.node_module_path |
By default, it refers to the global path and local directory. If an arbitrary path is given, it refers to that path. |
## Not run: is_available_textlint() ## End(Not run)## Not run: is_available_textlint() ## End(Not run)
Check if rule is installed
is_rule_exist(rules)is_rule_exist(rules)
rules |
the name of rule; see |
## Not run: is_rule_exist("no-todo") is_rule_exist("first-sentence-length") ## End(Not run)## Not run: is_rule_exist("no-todo") is_rule_exist("first-sentence-length") ## End(Not run)
Available rule names
rule_sets(rules = NULL)rule_sets(rules = NULL)
rules |
the name of rule; see |
rule_sets(rules = c("common-misspellings", "preset-jtf-style"))rule_sets(rules = c("common-misspellings", "preset-jtf-style"))
Textlint a given file
textlint(file = NULL, lintrc = ".textlintrc", markers = TRUE, ...)textlint(file = NULL, lintrc = ".textlintrc", markers = TRUE, ...)
file |
filename whose target to textlint |
lintrc |
file path to .textlintrc. Default, searcing from current directory. |
markers |
modified output format. If |
... |
path to other function |
## Not run: lint_target <- system.file("sample.md", package = "textlintr") textlint(lint_target) ## End(Not run)## Not run: lint_target <- system.file("sample.md", package = "textlintr") textlint(lint_target) ## End(Not run)
Update the rule file (.texlintrc) which textlint checks.
To adopt the rule of the character string specified as argument. When
NULL is given, all installed rules are applied.
update_lint_rules( rules = NULL, lintrc = ".textlintrc", overwrite = FALSE, .node_module_path = NULL )update_lint_rules( rules = NULL, lintrc = ".textlintrc", overwrite = FALSE, .node_module_path = NULL )
rules |
the name of rule; see |
lintrc |
file path to .textlintrc. Default, searcing from current directory. |
overwrite |
logical. If set |
.node_module_path |
By default, it refers to the global path and local directory. If an arbitrary path is given, it refers to that path. |
## Not run: # Register all installed rules update_lint_rules() # Added a rule update_lint_rules(rules = "common-misspellings", overwrite = FALSE) # Overwrite rules update_lint_rules(rules = "common-misspellings", overwrite = TRUE) ## End(Not run)## Not run: # Register all installed rules update_lint_rules() # Added a rule update_lint_rules(rules = "common-misspellings", overwrite = FALSE) # Overwrite rules update_lint_rules(rules = "common-misspellings", overwrite = TRUE) ## End(Not run)