Skip to content

Latest commit

 

History

History
35 lines (24 loc) · 1.3 KB

linter-rule-no-conflicting-metadata.md

File metadata and controls

35 lines (24 loc) · 1.3 KB
title description ms.topic ms.custom ms.date
Linter rule - no conflicting metadata
Linter rule - no conflicting metadata
conceptual
devx-track-bicep
03/20/2024

Linter rule - no conflicting metadata

This linter rule issues a warning when a template author provides a @metadata() decorator with a property that conflicts with another decorator.

Linter rule code

Use the following value in the Bicep configuration file to customize rule settings:

no-conflicting-metadata

Solution

The following example fails this test because the description property of the @metadata() decorator conflicts with the @description() decorator.

@metadata({
  description: 'I conflict with the @description() decorator and will be overwritten.' // <-- will trigger a no-conflicting-metadata diagnostic
})
@description('I am more specific than the @metadata() decorator and will overwrite any 'description' property specified within it.')
param foo string

The @description() decorator always takes precedence over anything in the @metadata() decorator. So, the linter rule notifies that the description property within the @metadata() value is redundant and will be replaced.

Next steps

For more information about the linter, see Use Bicep linter.