Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

textlint: support --rule ./path/to/rule.js #560

Open
2 tasks
azu opened this issue Dec 25, 2018 · 1 comment
Open
2 tasks

textlint: support --rule ./path/to/rule.js #560

azu opened this issue Dec 25, 2018 · 1 comment
Labels
help wanted Extra attention is needed Status: Proposal Request for comments

Comments

@azu
Copy link
Member

azu commented Dec 25, 2018

We want to support file path to rule file for command line flag and textlinrc.

Actual(Current)

--rule support only rule module name.

textlint --rule <rulename>

Expected

textlint --rule <rulename>
textlint --rule ./path/to/rule.js

Purpose

It help to debug developing rule.

UseCase: check the developing rule with actual texts.

cat example.md | xargs ./node_modules/textlint/bin/textlint.js --rule lib/my-rule.js -f pretty-error

In my real usecase: test my rule with some corpus.

technological-book-corpus-ja | xargs ./node_modules/textlint/bin/textlint.js --rule lib/my-rule.js -f pretty-error

Workaround

Install the rule and textlint to global

# install the rule to global
$ npm i -g . textlint technological-book-corpus-ja
$ technological-book-corpus-ja | xargs textlint --rule textlint-rule-ja-no-redundant-expression -f pretty-error

Task

  • support file path in .textlinrc
  • support file path in --rule flag
{
   "rules": {
     "./path/to/rule.js": true
   }
}

I don't know that the above case is safe?

Maybe, Other implementation is suitable for this purpose.

@MartinBonner
Copy link

Sob! I came here, wanting a solution to the statement in https://github.com/textlint/textlint/blob/master/docs/faq/failed-to-load-textlints-module.md :

  • If you have installed textlint as --global(-g), must install each rule as --global.
  • If you have installed textlint as --save-dev(-D), must install each rule as --save-dev.

It sounds like this would be that solution - but it's not nearly implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed Status: Proposal Request for comments
Projects
None yet
Development

No branches or pull requests

2 participants