Skip to content

Commit

Permalink
Update README-ja.md for d901c54 (#1435)
Browse files Browse the repository at this point in the history
Update README-ja.md for d901c54
  • Loading branch information
feross committed Oct 14, 2019
2 parents cfb84fa + be249c3 commit f5d758e
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions docs/README-ja.md
Expand Up @@ -477,21 +477,29 @@ $ standard --parser babel-eslint --plugin flowtype

TypeScriptを使用するには、`@typescript-eslint/parser`をパーサとして、`@typescript-eslint/eslint-plugin`をプラグインとして`standard`を実行し、`**/*.ts`ファイルをリントするようにstandardに伝える必要があります(デフォルトではリントされないため)。

残念ながら、`standard`とTypeScriptには、`standard`が誤って`unused-variable`のエラーを出すという未解決の[イシュー](https://github.com/standard/standard/issues/1283)があります(例:インターフェースをインポートするとき)。その回避策として、かわりに[standardx](https://github.com/standard/standardx)を使う必要があります:sweat_smile:

```bash
npm install @typescript-eslint/parser @typescript-eslint/eslint-plugin --save-dev
npm install standardx @typescript-eslint/parser @typescript-eslint/eslint-plugin --save-dev
```

そして、次のコマンドを実行します。:

```bash
$ standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin **/*.ts
$ standardx --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint-plugin **/*.ts
```

あるいは、次の内容を`package.json`に追加してください。:

```json
{
"standard": {
"eslintConfig": {
"rules": {
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error"
}
},
"standardx": {
"parser": "@typescript-eslint/parser",
"plugins": [ "@typescript-eslint/eslint-plugin" ]
}
Expand All @@ -501,7 +509,13 @@ $ standard --parser @typescript-eslint/parser --plugin @typescript-eslint/eslint
`package.json`にこれを追加すると、次のコマンドが実行できます。:

```bash
standard **/*.ts
standardx **/*.ts
```

また、`standardx`のかわりに誤って使われるのを避けるために、`standard`の削除もすべきでしょう。

```bash
npm uninstall standard
```

<h2 id="what-about-mocha-jest-jasmine-qunit-etc">Mocha、Jest、Jasmine、QUnitなどはどうすれば?</h2>
Expand Down

0 comments on commit f5d758e

Please sign in to comment.