![](/img/trans.png)
[英]Visual Studio isn't showing warnings for rules added in editorconfig
[英]Is there a way to apply the rules in .editorconfig in Visual Studio 2022 on the entrie solution?
我正在嘗試將 Visual Studio 2022 用於我正在處理的C#
項目。 我在解決方案的根目錄下創建了一個.editorconfig
文件,其中定義了我想在解決方案中遵循的所有規則。 現在,我希望有一種方法可以將所有這些規則應用於整個解決方案。
使用代碼清理配置文件,我可以包含將在整個項目上執行的修復程序/規則。 但是,就我而言,所有規則都在.editorconfig
中。 我不知道是否有辦法將.editorconfig
中的規則轉換為修復程序。
如何強制 VS2022 將所有規則.editorconfig
應用於我的整個解決方案?
解決方案是dotnet format./SolutionName.sln --no-restore
。
這是有關 dotnet 格式的官方文檔。
Dotnet 格式是一種代碼格式化程序,可將樣式首選項應用於項目或解決方案。 首選項將從 .editorconfig 文件中讀取(如果存在),否則將使用一組默認首選項。 有關詳細信息,請參閱EditorConfig 文檔。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.