Azure / Azure/typespec-azure

Azure Core Linting Rules - Prioritization

Open
#4,291 0 comments 0 reactions 0 assignees View on GitHub
epic lib:azure-core linter
Dominant language
TypeScript
Stars
27
Forks
90
Avg merge
1d 22h
Merged PRs (30d)
156

Description

## New Linting Rules for `typespec-azure-core`

### Duplication / Commonality / Contradiction Analysis

| Relationship | Rules Involved | Analysis |
|---|---|---|
| **Can merge** | #785 + #2128 | Single **"secure-auth-required"** rule. #785 subsumes #2128. |
| **Can merge** | #2740 + #3730 | Single **"lro-invalid-operation-pattern"** rule. |
| **Can merge** | #267 + #848 | Anonymous/spread-only models. Single rule, shared with ARM. |
| **Complying with one ⟹ another** | #785 → #2128 | Requiring managed identity auto-flags ApiKey-only. |
| **No contradictions** | — | All rules are complementary. |

### Proposed Rules

| # | Description | Priority | Feasibility | Link | Notes |
|---|---|---|---|---|---|
| 1 | **Enforce numeric durations** | High | High | #2265 | Check `duration` properties for correct `@encode`. |
| 2 | **Prevent LRO anti-patterns** — LRO on GET, LRO + paging | High | High | #2740, #3730 | Single rule covers both. |
| 3 | **Non-standard array encoding in greenfield** | High | High | #3647 | Check array params for non-standard encoding. |
| 13 | **Paging decorators on non-paging operations** | Medium | Medium | #4210 | Trace model usage across op types. |
| 4 | **Secure auth required** — managed identity + warn ApiKey | High | Medium | #785, #2128 | Single rule. #785 subsumes #2128. Needs guideline change. |
| 5 | **Linter rules for unions** | High | Medium | #468 | Needs definition of problematic patterns. |
| 6 | **Require description in `@service`** | Medium | High | #1337 | Small extension to existing rule. |
| 7 | **Meaningful enum/union member names** | Medium | High | #1653 | Regex check on member names. |
| 8 | **Non-model response types** | Medium | High | #912 | Check return type kind on JSON ops. |
| 9 | **Namespace/model name collision** | Medium | High | #3162 | Compare namespace vs model names. |
| 10 | **Fix `@useFinalStateVia` decorator order bug** | Medium | High | #3365 | Fix existing rule's decorator resolution. |
| 11 | **Explicit `@action` rules** | Medium | Medium | #297 | Track action suffix inheritance. |
| 12 | **Anonymous types / spread-only models** | Medium | Medium | #267, #848 | Single rule. Shared with ARM. |
| 14 | **Warn about `@encode(string)` on non-string types** | Low | High | #1277 | Check `@encode` on numeric/boolean scalars. |
| 15 | **Warn about explicit "accept" header** | Low | High | #2195 | Check for header params named "accept". |
| 16 | **`use-standard-names`/`use-standard-operations` scoping** | Low | High | #1790 | Add namespace scope to existing rules. |
| 17 | **Verify links in documentation** | Low | Low | #3192 | Requires HTTP requests at compile time. |

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the linked issues and the existing linting rules in typespec-azure-core, focusing on the proposed merges, feasibility, and dependencies. Done means producing an agreed priority and scope for the listed rules, including any guideline changes or unresolved definitions needed before implementation.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.