Skip to content

slack development 2019 10 09

akabeko edited this page Nov 16, 2019 · 1 revision

2019-10-09

Time Icon Name Message
02:44 shinyu 先週の開発会議のあとで何人かと話し合い、VivliostyleのソースコードのスタイルとしてPrettierのデフォルト設定を使うことを決めました。つまりインデントは2スペースで、1行は80文字まで、文字列の引用符はダブルクォート、セミコロンを省略しない、などです。

これにより、コードスタイルの議論にエネルギーを費やすのを避けたいと思います。

Prettier: https://prettier.io/
Opinionated Code Formatter
02:44 Kiara Translation 🇬🇧: After last week's development meeting, we talked with several people and decided to use Prettier's default settings as the source code style for Vivliostyle. That is, the indentation is 2 spaces, the line can be up to 80 characters, the quotes in the string are double quotes, the semicolon is not omitted, etc.

This way, we want to avoid spending energy on code style discussions.

Prettier: https://prettier.io/
03:00 akabeko 質問です。

1. vivliostyle-XXX 系の他プロジェクトもそうするということでよいでしょうか?
2. 設定としては vivliostyle.js の package.json (Prettier や ESLint 系 npm 参照) と .eslintrc.js を踏襲すれば今回のルールを満たしているという認識でよいでしょうか?
3. .eslintrc.js 側は細かくルール設定されていますが、こちらは今後も airbnb や standard などではなく自主運用でゆくのでしょうか?

3 について、私は以前 eslint-config-standard を利用していたのですが TypeScript 移行を期にやめました。TypeScript + VS Code 環境が構文エラーや警告を細かく指定してくれるのがその理由です。なので今のところ Prettier のみにしています。

VSCodeでESLint+@typescript-eslint+Prettierを導入する(v2.0.0修正版) - Qiita
https://qiita.com/madono/items/a134e904e891c5cb1d20#%E5%8F%82%E8%80%83

のように標準の recommended 系だけ利用する手もありますね。vivliostyle.js の方でも eslint:recommended は利用しているようですので。

ESLint 部分についてもルールの明示をお願いしたいです。
##前置き TypeScriptチームがESLintのTypeScript対応を強化するとの発表がありました。 ...
03:00 Kiara Translation 🇬🇧: This is a question.

1. Is it okay to do other projects in vivliostyle-XXX series?
2. If you follow vivliostyle.js's package.json (see Prettier and ESLint npm) and .eslintrc.js as a setting, should you recognize that this rule is satisfied?
3. The .eslintrc.js side has detailed rules, but will this continue to operate independently rather than airbnb or standard?

For 3 I used to use eslint-config-standard before but moved to TypeScript. That's why the TypeScript + VS Code environment gives you detailed syntax errors and warnings. So for now only Prettier.

Introducing ESLint + @ typescript-eslint + Prettier with VSCode (v2.0.0 modified version)-Qiita
https://qiita.com/madono/items/a134e904e891c5cb1d20#%E5%8F%82%E8%80%83

There is also a hand that uses only the standard recommended system like this. Because vivliostyle.js seems to use eslint: recommended.

I would like to ask you to clarify the rules for the ESLint part.
19:19 shinyu 1. はい、できれば vivliostyle-XXX 系の他プロジェクトも、そうするのがよいと思います。

2. vivliostyle.jsのpackage.jsonの “lint” および “lint-fix” スクリプトでは、.tsコードだけを対象にしてますが、今後、それ以外のコードも対象にしたいです。ほかの vivliostyle-XXX もこれを踏襲するとよいと思います。

3. vivliostyle.jsのeslintの設定はTSへの移行の前から使われていて、それをTSに移行したときに、Prettierの設定を優先して、コード修正の手間が少ないように直しました。 @typescript-eslint/recommendedprettier/recommended を使って、もっとシンプルな設定にするとよさそうですね。
19:19 Kiara Translation 🇬🇧: 1. Yes, if possible, I think it is better to do other projects in vivliostyle-XXX series.

2. The “lint” and “lint-fix” scripts in package.json of vivliostyle.js target only the .ts code, but in the future I would like to include other codes as well. I think other vivliostyle-XXX should follow this.

3. The setting of eslint in vivliostyle.js has been used before migration to TS, and when it was migrated to TS, the setting of Prettier was prioritized and the effort to fix the code was reduced. . It seems better to use @ typescript-eslint / recommended or prettier / recommended to make it simpler.
Clone this wiki locally