見出し画像

【クイズ】eslint-config-prettierとeslint-plugin-prettierのうち非推奨なのはどっちか


どっちどっちどっち~~~~~






非推奨なのはeslint-plugin-prettier

When searching for both Prettier and your linter on the Internet you’ll probably find more related projects. These are generally not recommended, but can be useful in certain circumstances.

First, we have plugins that let you run Prettier as if it was a linter rule:
eslint-plugin-prettier
stylelint-prettier

These plugins were especially useful when Prettier was new. By running Prettier inside your linters, you didn’t have to set up any new infrastructure and you could re-use your editor integrations for the linters. But these days you can run prettier --check . and most editors have Prettier support.

The downsides of those plugins are:
You end up with a lot of red squiggly lines in your editor, which gets annoying. Prettier is supposed to make you forget about formatting – and not be in your face about it!
They are slower than running Prettier directly.
They’re yet one layer of indirection where things may break.

訳すると、

これら(eslint-plugin-prettierとstylelint-prettier)のプラグインのデメリットは、
・エディタにはたくさんの赤い波線が表示されて、イライラする。
 Prettierを使えばフォーマットすることを気にしなくていいので、目障りになるべきではありません!
・Prettierを直接実行するよりも遅い。
・余計な1レイヤーを挟んでるので、何かが壊れるかもしれない。
(なに?)

別にeslint-config-prettierは非推奨になってはいない。

eslint-config-prettier

ESLintとPrettierを一緒に使う場合にPrettierとconflictするeslintの設定をOFFにする。

eslint-plugin-prettier

ESLintとPrettierを一緒に使う場合に、PrettierをESLintとして使えるようにするプラグインだったが、非推奨になったらしい。

stylelint-prettier

このプラグインは、StylelintとPrettierを一緒に使う場合に、PrettierをStylelintとして使えるようにするプラグインだったが、非推奨になったらしい。
(使ったことはない)


感想

eslintの設定を調べていくうちに、Prettierのプラグインが非推奨になった~~という記事がちらほら出ていたので、調べてみました。




それでは、さようなら。





どっちの料理ショー





この記事が気に入ったらサポートをしてみませんか?