Replace ESLint with oxlint#4642
Draft
timotheeguerin wants to merge 2 commits into
Draft
Conversation
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.
Collaborator
|
All changed packages have been documented.
Show changes
|
Contributor
⚡ Benchmark Results
Full details – comparing
|
| 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)
@azure-tools/typespec-autorest
@azure-tools/typespec-autorest-canonical
@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
commit: |
Collaborator
|
You can try these changes here
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Migrate the typespec-azure repo's linting from ESLint to oxlint, mirroring the upstream core migration (microsoft/typespec#10970) and reusing the shared
TypeSpecCommonOxlintConfigsexported from thecoresubmodule.Depends on the core submodule being bumped to the oxlint branch (included here).
Changes
Removed
eslint.config.jseslint,@eslint/js,@vitest/eslint-plugin,eslint-plugin-import,eslint-plugin-unicorn,eslint-plugin-react-hooks,typescript-eslint,@typescript-eslint/*).github/workflows/consistency.yml)Added
oxlint.config.ts— reusesTypeSpecCommonOxlintConfigs(allFilesRules,typescriptFileOverride,jsxFilesOverride,testFilesOverride,typeAwareOverride) plus azure-specific ignores and overridesoxlint+oxlint-tsgolintdevDependencies (catalog)Updated
lintruns two passes:oxlint . --deny-warningsthenoxlint packages --type-aware --deny-warnings --ignore-pattern "packages/typespec-ts/**"lint/lint:fixscripts →oxlint . --deny-warnings/oxlint . --fixpnpm-workspace.yamlcatalog,turbo.jsonlint inputs,.vscode/extensions.json(recommend the oxc extension)Type-aware linting
no-floating-promises(error) andno-deprecated(warn) are preserved via oxlint's--type-awaremode (backed byoxlint-tsgolint), reusing core's sharedtypeAwareOverride.A two-pass lint is used (rather than core's single
oxlint . --type-aware) because two azure-only tsconfigs are not tsgo-compatible andtypespec-tshas known OOM issues under project-aware linting:website/tsconfig.jsonis outsidepackages, so the type-aware pass (scoped topackages) skips it.packages/typespec-ts/**is excluded from the type-aware pass (moduleResolution: node10is intentional for the generated-SDK integration tests, and type-checking the whole package OOMs).Notes
unicorn/filename-case) and typespec-ts chai-style assertions (vitest/valid-expect).// eslint-disable-next-line @typescript-eslint/no-deprecatedcomments are honored by oxlint (verified).Validation
pnpm install✓pnpm lint✓ (both passes green)no-floating-promisesenforcement verified via a planted violation