mirror of
https://github.com/goldbergyoni/nodebestpractices.git
synced 2025-10-30 00:57:04 +08:00
translate 3-1 to japanese
This commit is contained in:
@ -230,13 +230,13 @@
|
||||
|
||||
# `3. コードスタイルのプラクティス`
|
||||
|
||||
## ![✔] 3.1 Use ESLint
|
||||
## ![✔] 3.1 ESLint を使う
|
||||
|
||||
**TL;DR:** [ESLint](https://eslint.org) is the de-facto standard for checking possible code errors and fixing code style, not only to identify nitty-gritty spacing issues but also to detect serious code anti-patterns like developers throwing errors without classification. Though ESLint can automatically fix code styles, other tools like [prettier](https://www.npmjs.com/package/prettier) and [beautify](https://www.npmjs.com/package/js-beautify) are more powerful in formatting the fix and work in conjunction with ESLint
|
||||
**TL;DR:** [ESLint](https://eslint.org) は、コードエラーの可能性をチェックし、コードスタイルを修正するためのデファクトスタンダードで、細かい間隔の問題を特定するだけでなく、開発者が分類せずにエラーを投げるような深刻なコードアンチパターンを検出することもできます。ESLint はコードスタイルを自動的に修正することができますが、[prettier](https://www.npmjs.com/package/prettier) や [beautify](https://www.npmjs.com/package/js-beautify) のような他のツールは、フィックスの書式設定をより強力にし、ESLint と連携して動作します。
|
||||
|
||||
**Otherwise:** Developers will focus on tedious spacing and line-width concerns and time might be wasted overthinking the project's code style
|
||||
**さもないと:** 開発者は退屈な間隔や線幅の問題に集中し、プロジェクトのコードスタイルを考えすぎて時間を無駄にしてしまうかもしれません。
|
||||
|
||||
🔗 [**Read More: Using ESLint and Prettier**](/sections/codestylepractices/eslint_prettier.md)
|
||||
🔗 [**さらに読む: ESLint と Prettier を使う**](/sections/codestylepractices/eslint_prettier.japanese.md)
|
||||
|
||||
<br/><br/>
|
||||
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
# Using ESLint and Prettier
|
||||
# ESLint と Prettier を使う
|
||||
|
||||
|
||||
### Comparing ESLint and Prettier
|
||||
### ESLint と Prettier の比較
|
||||
|
||||
If you format this code using ESLint, it will just give you a warning that it's too wide (depends on your `max-len` setting). Prettier will automatically format it for you.
|
||||
このコードを ESLint でフォーマットすると、幅が広すぎるという警告が表示されます( `max-len` の設定によります) 。Prettier はそれを自動的にフォーマットしてくれます。
|
||||
|
||||
```javascript
|
||||
foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne(), noWayYouGottaBeKiddingMe());
|
||||
@ -19,8 +19,8 @@ foo(
|
||||
);
|
||||
```
|
||||
|
||||
Source: [https://github.com/prettier/prettier-eslint/issues/101](https://github.com/prettier/prettier-eslint/issues/101)
|
||||
ソース: [https://github.com/prettier/prettier-eslint/issues/101](https://github.com/prettier/prettier-eslint/issues/101)
|
||||
|
||||
### Integrating ESLint and Prettier
|
||||
### ESLint と Prettier の統合
|
||||
|
||||
ESLint and Prettier overlap in the code formatting feature but can be easily combined by using other packages like [prettier-eslint](https://github.com/prettier/prettier-eslint), [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier), and [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier). For more information about their differences, you can view the link [here](https://stackoverflow.com/questions/44690308/whats-the-difference-between-prettier-eslint-eslint-plugin-prettier-and-eslint).
|
||||
ESLint と Prettierはコードフォーマット機能で重複していますが、[prettier-eslint](https://github.com/prettier/prettier-eslint) や [eslint-plugin-prettier](https://github.com/prettier/eslint-plugin-prettier)、[eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) のような他のパッケージを使うことで簡単に組み合わせることができます。それぞれの違いについての詳細は、リンク先の[こちら](https://stackoverflow.com/questions/44690308/whats-the-difference-between-prettier-eslint-eslint-plugin-prettier-and-eslint)をご覧ください。
|
||||
|
||||
Reference in New Issue
Block a user