当模板作者向修饰器提供与另一 @metadata()
个修饰器冲突的属性时,此 linter 规则将发出警告。
请在 Bicep 配置文件中使用以下值自定义规则设置:
no-conflicting-metadata
以下示例失败此测试, description
因为修饰器的属性 @metadata()
与 @description()
修饰器冲突。
@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
@description()
修饰器始终优先于修饰器中的任何@metadata()
内容。 因此,linter 规则会通知 description
值内的 @metadata() 属性是冗余的,将被替换。
有关 Linter 的详细信息,请参阅使用 Bicep Linter。