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

index baseに変更する #21

Closed
azu opened this issue Jul 3, 2019 · 4 comments
Closed

index baseに変更する #21

azu opened this issue Jul 3, 2019 · 4 comments
Labels
Type: Bug Bug or Bug fixes

Comments

@azu
Copy link
Member

azu commented Jul 3, 2019

const originalIndex = source.originalIndexFromPosition({
line: sentence.loc.start.line,
column: sentence.loc.start.column + (current.word_position - 1)
});

もしかしたら column + word_position で位置がずれているのかもしれない。
originalIndexFromIndex を使うようにすれば、columnずれは起きなくなるはず。

@azu azu added the Type: Bug Bug or Bug fixes label Jul 3, 2019
@attakei
Copy link

attakei commented Jul 4, 2019

  • textlint-plugin-rst
  • textlint-rule-preset-japanese

を利用している状況下で、以下の用なreSTファイルに対して、textlintコマンドを実行しています。

今まで「サイトはNetlify」「スライドはGitLab Pages」といった配信分けをしていたのですが、
「 ``/slides`` にビルドしたスライドを置きたい」という動機のものと、こんな構成を検討しています。

* 最初にtextlintで文法チェック
* ドキュメントを別にビルドしてarticle化
* 複数articleを束ねてFirebaseへデプロイ

結果として以下のエラーが出力されています。

 7:0  error  一文に二回以上利用されている助詞 "は" がみつかりました。  japanese/no-doubled-joshi

✖ 1 problem (1 error, 0 warnings)

状況再現等に使ったファイル・環境等は、 https://gitlab.com/attakei-sandbox/textlint-rst-demo/ に保存しています。 https://gitlab.com/attakei-sandbox/textlint-rst-demo/-/jobs よりエラーの様子が確認できます

@azu
Copy link
Member Author

azu commented Jul 4, 2019

詳細ありがとうございます!

@azu
Copy link
Member Author

azu commented Jul 4, 2019

@attakei https://github.com/textlint-ja/textlint-rule-no-doubled-joshi/releases/tag/3.5.2 で修正してみました。 #23

npm i textlint-rule-preset-japanese

で中に入ってるtextlint-rule-no-doubled-joshiもアップデートできると思います。

npm ls textlint-rule-no-doubled-joshi
textlint-rst-demo@1.0.0 /Users/azu/.ghq/gitlab.com/attakei-sandbox/textlint-rst-demo
└─┬ textlint-rule-preset-japanese@4.0.3
  └── textlint-rule-no-doubled-joshi@3.5.2

で確認できます。

頂いた再現リポジトリは次のようになりました。

❯ npx textlint demo-*.rst

/Users/azu/.ghq/gitlab.com/attakei-sandbox/textlint-rst-demo/demo-1.rst
  1:22  error  一文に二回以上利用されている助詞 "は" がみつかりました。  japanese/no-doubled-joshi

✖ 1 problem (1 error, 0 warnings)

@azu azu closed this as completed Jul 4, 2019
@attakei
Copy link

attakei commented Jul 5, 2019

こちらのリポジトリでもpackage-lock.json更新後に再実行で確認できました。
ありがとうございました。

↓エビデンス兼ねて、こちらにGitLab-CIでの実行パイプラインを置かせていただきます
https://gitlab.com/attakei-sandbox/textlint-rst-demo/pipelines/69597801

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

No branches or pull requests

2 participants