Linter 規則 - 沒有未使用的變數

此規則會在 Bicep 檔案中尋找任何位置皆未參考的參數。

Linter 規則程式碼

使用 Bicep 設定檔中的下列值來自訂規則設定:

no-unused-vars

解決方案

若要減少範本中的混淆,請刪除已定義但未使用的變數。 這項測試會在範本中尋找任何位置皆未使用的參數。

您可以使用快速修正移除未使用的變數:

The screenshot of No unused variables linter rule quick fix.

下一步

如需 Linter 的詳細資訊,請參閱使用 Bicep Linter