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

prhを内部的に使ってるルールが textlint --fix に対応していない #101

Closed
azu opened this issue Jun 30, 2022 · 0 comments · Fixed by #102
Closed

prhを内部的に使ってるルールが textlint --fix に対応していない #101

azu opened this issue Jun 30, 2022 · 0 comments · Fixed by #102
Labels
Type: Bug Bug or Bug fixes

Comments

@azu
Copy link
Member

azu commented Jun 30, 2022

textlint/textlint#878 (comment)

これだと、linterだけになって textlint --fix に対応する fixerがないルールとして扱われる。
そのため textlint --fix では何もしないルールになってしまってるはず。

module.exports = {function (context) {
    // 辞書ベースのカタカナ末尾の長音のチェックを行う
    return prh.fixer(context, {
        ruleContents: [fs.readFileSync(path.join(__dirname, "..", "dict", "2.1.6.yml"), "utf-8")]
    });
};

おそらく本来は次のように返す必要がある。

const reporter = function (context) {
    // 辞書ベースのカタカナ末尾の長音のチェックを行う
    return prh.fixer(context, {
        ruleContents: [fs.readFileSync(path.join(__dirname, "..", "dict", "2.1.6.yml"), "utf-8")]
    });
};
module.exports = {
  linter: reporter,
  // support fixing
  fixer: reporter
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Bug or Bug fixes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant