Azure / Azure/bicep

linter should flag unnecessary dependsOn with existing resources

Open
#8,417 0 comments 0 reactions 0 assignees View on GitHub
enhancement story: linter rules
Dominant language
Bicep
Stars
3.6k
Forks
830
Avg merge
1d 4h
Merged PRs (30d)
81

Description

linter should flag a resource that has a manually added dependsOn for an existing resource... during compilation we do the right thing (and don't add the dependency), we should flag the dead code in the editor

```bicep
resource ip 'Microsoft.Network/publicIPAddresses@2022-01-01' existing = {
name: 'foo'
}

resource as 'Microsoft.Compute/availabilitySets@2022-03-01' = {
name: 'bar'
location: location
dependsOn: [ ip ]
}
```

Contributor guide

Open the contributing guide

Research direction

Use the issue's Bicep example as the reproduction case, then locate the linter entry point that analyzes dependsOn and existing resources. Done means the editor reports manually added dependencies on existing resources while compilation continues to avoid adding that dependency.

Written by the indexing model from the issue text.

Assessment

Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.