0
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 5 years have passed since last update.

【Kotlin】KtlintのImportOrderルールの解除

Last updated at Posted at 2019-11-27

概要

Ktlintをcom.github.shyiko:ktlint:0.22.0からcom.pinterest:ktlint:0.35.0に変更しました。
そうしたらデフォルトでimportorderルールがOnになったので解除しました。

解除方法

プロジェクトのrootに.editorconfigというファイルを作ります。
ここにdisabled_rules項目を作り、解除したいルールを追加します。
今回はimport文のアルファベット順ルールを解除したいのでimport-orderingを追加します。

.editorconfig
[*.{kt,kts}]
disabled_rules=import-ordering

まとめ

Ktlintのページの解除方法が分かりづらかったので、メモベースなので書き残しました。
個人的にはimport文の並び順がそこまで可読性に影響があるとは思わないので・・・
他のルールの追記や解除については、Githubのページを参照ください

参照ページ

Ktlint

0
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
0
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?