Skip to content

ドキュメントのルールセットをノーマライズ #1

@naokie

Description

@naokie

Issues

メンテしている日本語訳ドキュメントが複数に渡っている。
比較的最近になって textlint を導入したリポジトリが、Vue 2 で導入した当時のもののコピー。
導入した textlint が古くなっている。
翻訳ガイドラインと .textlintrc にルールの差がある。

Solution proposal

textlint preset を用意して、各リポジトリで利用する。

Ref

vuejs/jp.vuejs.org

guide:
https://github.com/vuejs/jp.vuejs.org/blob/lang-ja/CONTRIBUTING.md

dependencies:

{
  "shelljs": "^0.7.8",
  "textlint": "^5.5.0",
  "textlint-checker-for-vuejs-jp-docs": "git+https://github.com/vuejs-jp/textlint-checker-for-vuejs-jp-docs.git",
  "textlint-rule-detect-bad-chars": "^1.0.2",
  "textlint-rule-no-mix-dearu-desumasu": "^4.0.0",
  "textlint-rule-preset-jtf-style": "^2.3.3"
}

.textlintrc:
https://github.com/vuejs/jp.vuejs.org/blob/lang-ja/.textlintrc

npm scripts:

{
  "test": "npm run lint",
  "lint": "node -e \"var shell=require('shelljs');var files=shell.find(['./src/v2/**/*.md','./src/_posts/*.md']).filter(function(file){return !file.endsWith('/guide/team.md')}).join(' ');if(shell.exec('textlint --rulesdir ./node_modules/textlint-checker-for-vuejs-jp-docs/rules/textlint-rule-vue-jp-docs -f pretty-error '+files).code!==0){shell.exit(1)};\""
}

vuejs-jp/ja.nuxtjs.org

dependencies:

{
  "textlint": "^11.8.2",
  "textlint-filter-rule-allowlist": "^2.0.1",
  "textlint-rule-preset-ja-spacing": "^2.0.2",
  "textlint-rule-preset-jtf-style": "^2.3.8"
}

.textlintrc:
https://github.com/vuejs-jp/ja.nuxtjs.org/blob/main/.textlintrc

npm scripts:

{
  "lint:all:textlint:ja": "yarn lint:textlint:ja --fix",
  "lint:textlint:ja": "textlint \"content/ja/**/*.md\""
}

vuejs-jp/ja.vuejs.org

guide:
https://github.com/vuejs-jp/ja.vuejs.org/blob/lang-ja/.github/CONTRIBUTING.md

dependencies:

{
  "shelljs": "^0.8.4",
  "textlint": "^11.7.6",
  "textlint-checker-for-vuejs-jp-docs": "git+https://github.com/vuejs-jp/textlint-checker-for-vuejs-jp-docs.git",
  "textlint-plugin-jtf-style": "^1.0.1",
  "textlint-rule-detect-bad-chars": "^1.0.2",
  "textlint-rule-no-mix-dearu-desumasu": "^4.0.1"
}

.textlintrc:
https://github.com/vuejs-jp/ja.vuejs.org/blob/lang-ja/src/.textlintrc

npm scripts:

{
  "test": "npm run lint",
  "lint": "node -e \"var shell=require('shelljs');var files=shell.find(['./src/**/*.md']).filter(function(file){return !file.endsWith('/guide/team.md')}).join(' ');if(shell.exec('textlint --rulesdir ./node_modules/textlint-checker-for-vuejs-jp-docs/rules/textlint-rule-vue-jp-docs -f pretty-error '+files).code!==0){shell.exit(1)};\"",
  "lint:single": "textlint --rulesdir ./node_modules/textlint-checker-for-vuejs-jp-docs/rules/textlint-rule-vue-jp-docs -f pretty-error"
}

vuejs-jp/vite-docs-ja

guide:
https://github.com/vuejs-jp/vite-docs-ja/blob/main/CONTRIBUTING.md

dependencies:

{
  "shelljs": "^0.8.4",
  "textlint": "^11.7.6",
  "textlint-checker-for-vuejs-jp-docs": "git+https://github.com/vuejs-jp/textlint-checker-for-vuejs-jp-docs.git",
  "textlint-rule-detect-bad-chars": "^1.0.2",
  "textlint-rule-no-mix-dearu-desumasu": "^4.0.1",
  "textlint-rule-preset-jtf-style": "^2.3.8"
}

.textlintrc:
https://github.com/vuejs-jp/vite-docs-ja/blob/main/.textlintrc

npm scripts:

{
  "test": "npm run lint",
  "lint": "node -e \"var shell=require('shelljs');var files=shell.find(['./blog/**/*.md', './config/**/*.md', './guide/**/*.md', './plugins/**/*.md']).join(' ');if(shell.exec('textlint --rulesdir ./node_modules/textlint-checker-for-vuejs-jp-docs/rules/textlint-rule-vue-jp-docs -f pretty-error '+files).code!==0){shell.exit(1)};\"",
  "lint:single": "textlint --rulesdir ./node_modules/textlint-checker-for-vuejs-jp-docs/rules/textlint-rule-vue-jp-docs -f pretty-error"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions