Skip to content

Replace ESLint with oxlint#4642

Draft
timotheeguerin wants to merge 2 commits into
Azure:mainfrom
timotheeguerin:oxlint
Draft

Replace ESLint with oxlint#4642
timotheeguerin wants to merge 2 commits into
Azure:mainfrom
timotheeguerin:oxlint

Conversation

@timotheeguerin

Copy link
Copy Markdown
Member

Summary

Migrate the typespec-azure repo's linting from ESLint to oxlint, mirroring the upstream core migration (microsoft/typespec#10970) and reusing the shared TypeSpecCommonOxlintConfigs exported from the core submodule.

Depends on the core submodule being bumped to the oxlint branch (included here).

Changes

Removed

  • eslint.config.js
  • All ESLint devDependencies / catalog entries (eslint, @eslint/js, @vitest/eslint-plugin, eslint-plugin-import, eslint-plugin-unicorn, eslint-plugin-react-hooks, typescript-eslint, @typescript-eslint/*)
  • CI step that pre-built the eslint plugin (.github/workflows/consistency.yml)

Added

  • oxlint.config.ts — reuses TypeSpecCommonOxlintConfigs (allFilesRules, typescriptFileOverride, jsxFilesOverride, testFilesOverride, typeAwareOverride) plus azure-specific ignores and overrides
  • oxlint + oxlint-tsgolint devDependencies (catalog)

Updated

  • Root lint runs two passes: oxlint . --deny-warnings then oxlint packages --type-aware --deny-warnings --ignore-pattern "packages/typespec-ts/**"
  • All per-package lint/lint:fix scripts → oxlint . --deny-warnings / oxlint . --fix
  • pnpm-workspace.yaml catalog, turbo.json lint inputs, .vscode/extensions.json (recommend the oxc extension)

Type-aware linting

no-floating-promises (error) and no-deprecated (warn) are preserved via oxlint's --type-aware mode (backed by oxlint-tsgolint), reusing core's shared typeAwareOverride.

A two-pass lint is used (rather than core's single oxlint . --type-aware) because two azure-only tsconfigs are not tsgo-compatible and typespec-ts has known OOM issues under project-aware linting:

  • website/tsconfig.json is outside packages, so the type-aware pass (scoped to packages) skips it.
  • packages/typespec-ts/** is excluded from the type-aware pass (moduleResolution: node10 is intentional for the generated-SDK integration tests, and type-checking the whole package OOMs).

Notes

  • Two oxlint-vs-eslint deltas required small azure-specific overrides: website astro route filenames (unicorn/filename-case) and typespec-ts chai-style assertions (vitest/valid-expect).
  • Existing inline // eslint-disable-next-line @typescript-eslint/no-deprecated comments are honored by oxlint (verified).

Validation

  • pnpm install
  • pnpm lint ✓ (both passes green)
  • type-aware no-floating-promises enforcement verified via a planted violation

Replace ESLint with oxlint, reusing the shared TypeSpecCommonOxlintConfigs
exported from the core submodule. Type-aware rules (no-floating-promises,
no-deprecated) run via --type-aware/oxlint-tsgolint, scoped away from
typespec-ts. Removes all eslint dependencies and the eslint plugin build
step in CI.
@microsoft-github-policy-service microsoft-github-policy-service Bot added eng lib:azure-core Issues for @azure-tools/typespec-azure-core library lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library emitter:autorest Issues for @azure-tools/typespec-autorest emitter emitter:typescript Issues for @azure-tools/typespec-ts emitter lib:tcgc Issues for @azure-tools/typespec-client-generator-core library labels Jun 16, 2026
@azure-sdk

azure-sdk commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

All changed packages have been documented.

  • @azure-tools/typespec-autorest-canonical
  • @azure-tools/typespec-autorest
  • @azure-tools/typespec-azure-core
  • @azure-tools/typespec-azure-portal-core
  • @azure-tools/typespec-azure-resource-manager
  • @azure-tools/typespec-azure-rulesets
  • @azure-tools/typespec-client-generator-core
  • @azure-tools/typespec-metadata
  • @azure-tools/typespec-ts
Show changes

@azure-tools/typespec-autorest - internal ✏️

Migrate linting from ESLint to oxlint.

@azure-tools/typespec-autorest-canonical - internal ✏️

Migrate linting from ESLint to oxlint.

@azure-tools/typespec-azure-core - internal ✏️

Migrate linting from ESLint to oxlint.

@azure-tools/typespec-azure-portal-core - internal ✏️

Migrate linting from ESLint to oxlint.

@azure-tools/typespec-azure-resource-manager - internal ✏️

Migrate linting from ESLint to oxlint.

@azure-tools/typespec-azure-rulesets - internal ✏️

Migrate linting from ESLint to oxlint.

@azure-tools/typespec-client-generator-core - internal ✏️

Migrate linting from ESLint to oxlint.

@azure-tools/typespec-metadata - internal ✏️

Migrate linting from ESLint to oxlint.

@azure-tools/typespec-ts - internal ✏️

Migrate linting from ESLint to oxlint.

@github-actions

github-actions Bot commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

⚡ Benchmark Results

⚠️ 2 metric(s) regressed above the +5% threshold:

Metric Baseline Current Change
resolver 🟢 19.7ms 🟢 22.9ms +16.3% 🔴
 ↳ emit/@typespec/openapi3/write 🟢 19.3ms 🟢 21.5ms +11.2% 🔴
Full details – comparing 9432634 vs baseline 757a981
Metric Baseline Current Change
total 🔴 642.3ms 🔴 615.7ms -4.1%
loader 🟢 191.7ms 🟢 165.0ms -13.9% 🟢
resolver 🟢 19.7ms 🟢 22.9ms +16.3% 🔴
checker 🟡 206.5ms 🟡 202.9ms -1.7%
validation 🟢 43.8ms 🟢 45.6ms +3.9%
 ↳ validation/@azure-tools/typespec-azure-core 🟢 6.9ms 🟢 6.9ms -0.1%
 ↳ validation/@typespec/http 🟢 6.0ms 🟢 6.2ms +3.0%
 ↳ validation/@typespec/rest 🟢 0.6ms 🟢 0.9ms +46.1%
 ↳ validation/@typespec/versioning 🔴 28.7ms 🔴 29.3ms +1.8%
 ↳ validation/compiler 🟢 1.4ms 🟢 1.8ms +29.5%
linter 🟢 142.9ms 🟢 137.8ms -3.6%
 ↳ linter/@azure-tools/typespec-azure-core/auth-required 🟢 0.0ms 🟢 0.0ms +16.4%
 ↳ linter/@azure-tools/typespec-azure-core/bad-record-type 🟢 0.2ms 🟢 0.2ms +9.0%
 ↳ linter/@azure-tools/typespec-azure-core/byos 🟢 5.9ms 🟢 6.0ms +0.4%
 ↳ linter/@azure-tools/typespec-azure-core/casing-style 🟢 0.7ms 🟢 0.7ms +0.7%
 ↳ linter/@azure-tools/typespec-azure-core/composition-over-inheritance 🟢 0.1ms 🟢 0.1ms +17.5%
 ↳ linter/@azure-tools/typespec-azure-core/documentation-required 🟢 0.8ms 🟢 1.0ms +17.8%
 ↳ linter/@azure-tools/typespec-azure-core/friendly-name 🟢 0.6ms 🟢 0.7ms +10.0%
 ↳ linter/@azure-tools/typespec-azure-core/key-visibility-required 🟢 0.2ms 🟢 0.2ms +9.1%
 ↳ linter/@azure-tools/typespec-azure-core/known-encoding 🟢 0.3ms 🟢 0.3ms -3.3%
 ↳ linter/@azure-tools/typespec-azure-core/long-running-polling-operation-required 🟢 0.3ms 🟢 0.3ms +2.0%
 ↳ linter/@azure-tools/typespec-azure-core/no-case-mismatch 🟢 0.3ms 🟢 0.3ms +8.2%
 ↳ linter/@azure-tools/typespec-azure-core/no-closed-literal-union 🟢 0.3ms 🟢 0.3ms +34.3%
 ↳ linter/@azure-tools/typespec-azure-core/no-enum 🟢 0.0ms 🟢 0.0ms +15.8%
 ↳ linter/@azure-tools/typespec-azure-core/no-error-status-codes 🟢 0.1ms 🟢 0.1ms +7.7%
 ↳ linter/@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops 🟢 0.1ms 🟢 0.1ms +12.0%
 ↳ linter/@azure-tools/typespec-azure-core/no-format 🟢 0.6ms 🟢 0.6ms +9.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-generic-numeric 🟢 0.4ms 🟢 0.5ms +25.3%
 ↳ linter/@azure-tools/typespec-azure-core/no-header-explode 🔴 20.4ms 🟡 18.8ms -7.8% 🟢
 ↳ linter/@azure-tools/typespec-azure-core/no-legacy-usage 🟢 1.1ms 🟢 1.1ms +2.8%
 ↳ linter/@azure-tools/typespec-azure-core/no-multiple-discriminator 🟢 0.1ms 🟢 0.1ms +6.8%
 ↳ linter/@azure-tools/typespec-azure-core/no-nullable 🟢 0.3ms 🟢 0.3ms +9.1%
 ↳ linter/@azure-tools/typespec-azure-core/no-offsetdatetime 🟢 1.2ms 🟢 1.2ms +2.2%
 ↳ linter/@azure-tools/typespec-azure-core/no-openapi 🟢 2.0ms 🟢 2.2ms +10.9%
 ↳ linter/@azure-tools/typespec-azure-core/no-private-usage 🟢 1.9ms 🟢 2.2ms +15.3%
 ↳ linter/@azure-tools/typespec-azure-core/no-query-explode 🔴 21.1ms 🟡 19.9ms -5.9% 🟢
 ↳ linter/@azure-tools/typespec-azure-core/no-response-body 🔴 25.2ms 🔴 24.8ms -1.6%
 ↳ linter/@azure-tools/typespec-azure-core/no-rest-library-interfaces 🟢 0.0ms 🟢 0.0ms +48.3%
 ↳ linter/@azure-tools/typespec-azure-core/no-route-parameter-name-mismatch 🟢 5.4ms 🟢 5.1ms -6.7%
 ↳ linter/@azure-tools/typespec-azure-core/no-rpc-path-params 🟢 0.2ms 🟢 0.2ms -7.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-string-discriminator 🟢 0.0ms 🟢 0.1ms +22.1%
 ↳ linter/@azure-tools/typespec-azure-core/no-unknown 🟢 0.2ms 🟢 0.2ms -2.5%
 ↳ linter/@azure-tools/typespec-azure-core/no-unnamed-union 🟢 0.3ms 🟢 0.4ms +17.2%
 ↳ linter/@azure-tools/typespec-azure-core/operation-missing-api-version 🟢 0.2ms 🟢 0.2ms +29.5%
 ↳ linter/@azure-tools/typespec-azure-core/request-body-problem 🟢 0.3ms 🟢 0.3ms +17.4%
 ↳ linter/@azure-tools/typespec-azure-core/require-versioned 🟢 0.0ms 🟢 0.0ms +64.2%
 ↳ linter/@azure-tools/typespec-azure-core/response-schema-problem 🔴 25.1ms 🔴 23.1ms -7.9% 🟢
 ↳ linter/@azure-tools/typespec-azure-core/rpc-operation-request-body 🟢 0.3ms 🟢 0.3ms -8.9%
 ↳ linter/@azure-tools/typespec-azure-core/spread-discriminated-model 🟢 0.3ms 🟢 0.3ms +8.9%
 ↳ linter/@azure-tools/typespec-azure-core/use-standard-names 🟢 5.7ms 🟢 4.9ms -14.4%
 ↳ linter/@azure-tools/typespec-azure-core/use-standard-operations 🟢 0.1ms 🟢 0.1ms +5.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-common-types-version 🟢 4.1ms 🟢 3.9ms -6.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key 🟢 0.1ms 🟢 0.1ms -4.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage 🟢 0.1ms 🟢 0.1ms +9.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes 🟢 5.5ms 🟢 5.3ms -3.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-no-path-casing-conflicts 🟢 4.4ms 🟢 4.4ms -1.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-no-record 🟢 0.4ms 🟢 0.4ms +0.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-post-operation-response-codes 🟢 0.5ms 🟢 0.4ms -10.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes 🟢 0.0ms 🟢 0.0ms +54.5%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-action-no-segment 🟢 0.2ms 🟢 0.2ms +2.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-property 🟢 0.1ms 🟢 0.1ms -3.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator 🟢 0.0ms 🟢 0.0ms +17.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-action-verb 🟢 0.1ms 🟢 0.1ms +11.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property 🟢 0.1ms 🟢 0.1ms +1.5%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-version-format 🟢 0.0ms 🟢 0.0ms +16.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-key-invalid-chars 🟢 0.2ms 🟢 0.2ms -1.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-name-pattern 🟢 0.0ms 🟢 0.0ms +51.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-operation 🟢 0.2ms 🟢 0.2ms +12.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-operation-response 🟢 4.7ms 🟢 4.6ms -3.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-patch 🟢 0.3ms 🟢 0.3ms -2.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-path-segment-invalid-chars 🟢 0.2ms 🟢 0.2ms -3.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state 🟢 0.1ms 🟢 0.1ms +5.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/beyond-nesting-levels 🟢 0.1ms 🟢 0.1ms -1.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/empty-updateable-properties 🟢 0.1ms 🟢 0.2ms +7.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/improper-subscription-list-operation 🟢 0.0ms 🟢 0.0ms +43.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/lro-location-header 🟡 14.7ms 🟡 14.0ms -4.5%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint 🟢 0.0ms 🟢 0.0ms +25.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers 🟢 0.3ms 🟢 0.3ms +15.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-empty-model 🟢 0.1ms 🟢 0.1ms +6.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-override-props 🟢 0.1ms 🟢 0.1ms +7.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation 🟢 0.2ms 🟢 0.2ms -3.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-response-body 🔴 23.7ms 🟡 19.8ms -16.3% 🟢
 ↳ linter/@azure-tools/typespec-azure-resource-manager/patch-envelope 🟢 0.1ms 🟢 0.2ms +6.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/resource-name 🟢 0.1ms 🟢 0.1ms -2.5%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/secret-prop 🟢 2.3ms 🟢 3.0ms +32.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/unsupported-type 🟢 0.4ms 🟢 0.4ms +3.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/version-progression 🟢 0.0ms 🟢 0.0ms +26.5%
 ↳ linter/@azure-tools/typespec-client-generator-core/property-name-conflict 🟢 1.1ms 🟢 1.1ms +3.4%
 ↳ linter/@azure-tools/typespec-client-generator-core/require-client-suffix 🟢 0.2ms 🟢 0.3ms +47.7%
emit 🔴 6.17s 🔴 6.14s -0.5%
 ↳ emit/@azure-tools/typespec-autorest 🟡 204.9ms 🟡 214.5ms +4.7%
 ↳ emit/@azure-tools/typespec-python 🔴 4.51s 🔴 4.42s -2.1%
 ↳ emit/@typespec/http-client-js 🔴 1.19s 🔴 1.23s +3.1%
 ↳ emit/@typespec/openapi3 🟢 156.1ms 🟢 161.4ms +3.4%
 ↳ emit/@typespec/openapi3/compute 🟢 137.0ms 🟢 140.5ms +2.6%
 ↳ emit/@typespec/openapi3/write 🟢 19.3ms 🟢 21.5ms +11.2% 🔴

Averaged across 3 specs (azure-arm-resource-manager, azure-core-dataplane, azure-full).
Threshold: changes > ±5% are highlighted.
🟢 Fast · 🟡 Moderate (stages >200ms, rules >10ms) · 🔴 Slow (stages >400ms, rules >20ms)

@pkg-pr-new

pkg-pr-new Bot commented Jun 16, 2026

Copy link
Copy Markdown

Open in StackBlitz

@azure-tools/typespec-autorest

npm i https://pkg.pr.new/Azure/typespec-azure/@azure-tools/typespec-autorest@4642

@azure-tools/typespec-autorest-canonical

npm i https://pkg.pr.new/Azure/typespec-azure/@azure-tools/typespec-autorest-canonical@4642

@azure-tools/typespec-azure-core

npm i https://pkg.pr.new/Azure/typespec-azure/@azure-tools/typespec-azure-core@4642

@azure-tools/typespec-azure-portal-core

npm i https://pkg.pr.new/Azure/typespec-azure/@azure-tools/typespec-azure-portal-core@4642

@azure-tools/typespec-azure-resource-manager

npm i https://pkg.pr.new/Azure/typespec-azure/@azure-tools/typespec-azure-resource-manager@4642

@azure-tools/typespec-azure-rulesets

npm i https://pkg.pr.new/Azure/typespec-azure/@azure-tools/typespec-azure-rulesets@4642

@azure-tools/typespec-client-generator-core

npm i https://pkg.pr.new/Azure/typespec-azure/@azure-tools/typespec-client-generator-core@4642

@azure-tools/typespec-metadata

npm i https://pkg.pr.new/Azure/typespec-azure/@azure-tools/typespec-metadata@4642

@azure-tools/typespec-ts

npm i https://pkg.pr.new/Azure/typespec-azure/@azure-tools/typespec-ts@4642

commit: d0a0dcd

@azure-sdk

azure-sdk commented Jun 16, 2026

Copy link
Copy Markdown
Collaborator

You can try these changes here

🛝 Playground 🌐 Website

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:autorest Issues for @azure-tools/typespec-autorest emitter emitter:typescript Issues for @azure-tools/typespec-ts emitter eng lib:azure-core Issues for @azure-tools/typespec-azure-core library lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library lib:tcgc Issues for @azure-tools/typespec-client-generator-core library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants