2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

VScodeのDartFormatがコードを汚す件

Last updated at Posted at 2022-04-25

概要

VScodeでのFlutter開発中にDartプラグインを使ってファーマット整形

滅茶苦茶な改行コードの完成

解説

Dart Formatが悪いのか?

何も考えずに「Dartプラグインをインストール」して、「.vscode/settings.jsonにDart設定を記述」したら、以下キャプチャのようなコードが目の前に現れて「えっ?」ってなりました。特に三項条件演算子周りの記述が読み辛くなっています。

image.png

原因

各所にカンマがついていないのでフォーマット結果が汚くなる様です。

まとめ

フォーマットを整形したい気持ちが先行して、公式ドキュメント参照を忘れていたことが原因でした。
可読性を大切にするエンジニアでありたいです。

2
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?