Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

特定のファイルにフォーマッタをかける設定を試した #80

Merged
merged 4 commits into from Nov 16, 2023

Conversation

MofuMofu2
Copy link
Owner

ポイント

  • overridesを使う
  • filesで対象パスを指定
  • optionsにPrettierの設定を書く。なので特定のプラグインだけ設定したかったらpluginsを続けて書く。

ドキュメントの通りだけど、これがあることに辿り着けなかった。まとめておこう。
https://prettier.io/docs/en/configuration.html#configuration-overrides

https://github.com/MofuMofu2/rimarimadan-blog/issues/18

@MofuMofu2 MofuMofu2 merged commit dbbe99d into main Nov 16, 2023
1 check passed
@MofuMofu2 MofuMofu2 deleted the choose-prettier-plugin branch November 16, 2023 10:57
@MofuMofu2
Copy link
Owner Author

JSONはダブルクオートで囲む必要があるからルールをつけても適用されないんだって。なるほどね〜。

singleQuote: trueの設定は、JSONファイルでは適用されません。JSONの標準では、文字列はダブルクォートで囲む必要があります。そのため、Prettierはこの設定を無視します。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant