Azure / Azure/bicep

Code fix or linter rule to allow extracting of inline type into declared type

Open
#12,071 1 comment 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

To teach users how to use the `type` keyword

For the following:
```bicep
param raProps {
foo: ('abc' | 'def')
principalId: string
}
```
The following 2 code fixes could be suggested (tbd the feasibility on generating a name or taking user input for it):
```bicep
type raPropsType {
foo: ('abc' | 'def')
principalId: string
}

param raProps raPropsType
```
Or:
```bicep
type fooType = 'abc' | 'def'

param raProps {
foo: fooType
principalId: string
}
```

This would also go nicely with #12069

Contributor guide

Open the contributing guide

Research direction

Compare the two proposed code-fix forms and the related #12069. Resolve the open feasibility and type-naming questions, then define the linter or code-fix behavior and acceptance criteria for extracting inline types; the issue names no implementation files or tests.

Written by the indexing model from the issue text.

Assessment

Domain
compilers, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.