Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .chronus/changes/migrate-to-oxlint-2026-6-16-11-50-0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
changeKind: internal
packages:
- "@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"
---

Migrate linting from ESLint to oxlint.
19 changes: 19 additions & 0 deletions .github/matchers/oxlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"problemMatcher": [
{
"owner": "oxlint",
"severity": "error",
"pattern": [
{
"regexp": "^(.+?):(\\d+):(\\d+):\\s+(.+?)\\s+\\[(Error|Warning)/(.+)\\]$",
"file": 1,
"line": 2,
"column": 3,
"message": 4,
"severity": 5,
"code": 6
}
]
}
]
}
12 changes: 8 additions & 4 deletions .github/workflows/consistency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,14 @@ jobs:
- run: pnpm install
name: Install dependencies

- run: pnpm --filter="@typespec/eslint-plugin..." run build
name: Build prettier plugin

- run: pnpm run lint
# Force the `unix` reporter (instead of oxlint's default GitHub Actions
# reporter) so the full `file:line:col` location stays visible in the job
# logs, and register a problem matcher so violations still surface as
# inline annotations on the PR.
- name: Add oxlint Problem Matcher
run: echo "::add-matcher::.github/matchers/oxlint.json"

- run: pnpm run lint:ci
name: Lint

- run: pnpm run lint:extra
Expand Down
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"recommendations": [
"dbaeumer.vscode-eslint",
"oxc.oxc-vscode",
"esbenp.prettier-vscode",
"streetsidesoftware.code-spell-checker",
"vitest.explorer",
Expand Down
2 changes: 1 addition & 1 deletion core
Submodule core updated 71 files
+33 −0 .chronus/changes/migrate-to-oxlint-2026-6-11-14-15-0.md
+0 −1 .chronus/config.yaml
+19 −0 .github/matchers/oxlint.json
+8 −4 .github/workflows/consistency.yml
+1 −1 .vscode/extensions.json
+2 −0 cspell.yaml
+0 −176 eslint.config.js
+240 −0 oxlint.config.ts
+6 −9 package.json
+2 −2 packages/asset-emitter/package.json
+1 −2 packages/asset-emitter/src/builders/object-builder.ts
+2 −2 packages/best-practices/package.json
+2 −2 packages/bundle-uploader/package.json
+2 −2 packages/bundler/package.json
+2 −2 packages/compiler/package.json
+2 −2 packages/emitter-framework/package.json
+0 −182 packages/eslint-plugin-typespec/CHANGELOG.json
+0 −298 packages/eslint-plugin-typespec/CHANGELOG.md
+0 −21 packages/eslint-plugin-typespec/LICENSE
+0 −22 packages/eslint-plugin-typespec/README.md
+0 −57 packages/eslint-plugin-typespec/docs/rules/call-decorator.md
+0 −57 packages/eslint-plugin-typespec/package.json
+0 −13 packages/eslint-plugin-typespec/src/index.ts
+0 −84 packages/eslint-plugin-typespec/src/rules/call-decorator.ts
+0 −7 packages/eslint-plugin-typespec/src/utils.ts
+0 −0 packages/eslint-plugin-typespec/test/fixtures/file.ts
+0 −12 packages/eslint-plugin-typespec/test/fixtures/tsconfig.json
+0 −11 packages/eslint-plugin-typespec/test/global-setup.ts
+0 −76 packages/eslint-plugin-typespec/test/rules/call-decorator.test.ts
+0 −5 packages/eslint-plugin-typespec/test/rules/utils.ts
+0 −9 packages/eslint-plugin-typespec/tsconfig.build.json
+0 −14 packages/eslint-plugin-typespec/tsconfig.json
+0 −12 packages/eslint-plugin-typespec/vitest.config.mts
+2 −2 packages/events/package.json
+2 −2 packages/html-program-viewer/package.json
+2 −2 packages/http-canonicalization/package.json
+2 −2 packages/http-client-js/package.json
+2 −2 packages/http-client/package.json
+2 −2 packages/http-server-csharp/package.json
+1 −1 packages/http-server-js/build-helpers.ts
+2 −2 packages/http-server-js/package.json
+2 −2 packages/http/package.json
+2 −2 packages/internal-build-utils/package.json
+2 −2 packages/json-schema/package.json
+2 −2 packages/library-linter/package.json
+2 −2 packages/monarch/package.json
+2 −2 packages/mutator-framework/package.json
+2 −2 packages/openapi/package.json
+2 −2 packages/openapi3/package.json
+2 −2 packages/pack/package.json
+2 −1 packages/pack/tsconfig.json
+2 −2 packages/playground-website/package.json
+2 −2 packages/playground/package.json
+1 −1 packages/playground/tsconfig.json
+2 −2 packages/protobuf/package.json
+2 −2 packages/react-components/package.json
+2 −2 packages/rest/package.json
+2 −2 packages/spec-dashboard/package.json
+2 −2 packages/sse/package.json
+2 −2 packages/standalone/package.json
+2 −2 packages/streams/package.json
+2 −2 packages/tmlanguage-generator/package.json
+2 −1 packages/tsp-integration/tsconfig.json
+2 −2 packages/tspd/package.json
+2 −2 packages/versioning/package.json
+2 −2 packages/xml/package.json
+348 −470 pnpm-lock.yaml
+5 −10 pnpm-workspace.yaml
+0 −1 tsconfig.ws.json
+1 −1 turbo.json
+1 −2 website/tsconfig.json
63 changes: 0 additions & 63 deletions eslint.config.js

This file was deleted.

83 changes: 83 additions & 0 deletions oxlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
import { defineConfig } from "oxlint";
import { TypeSpecCommonOxlintConfigs } from "./core/oxlint.config.ts";

const {
allFilesRules,
typescriptFileOverride,
jsxFilesOverride,
testFilesOverride,
typeAwareOverride,
} = TypeSpecCommonOxlintConfigs;

export default defineConfig({
plugins: ["typescript", "unicorn"],
categories: {
correctness: "off",
},
env: {
builtin: true,
},
ignorePatterns: [
"**/dist/**/*",
"**/.temp/**/*",
"**/temp/**/*",
"**/generated-defs/*",
"**/website/build/**/*",
"**/.astro/**/*",
// The TypeSpec core submodule has its own oxlint config - don't lint it from here.
"core/**/*",
// Ignore python virtual env
"**/venv/**/*",
// Ignore VSCode test web project
"**/.vscode-test-web/**/*",
// TODO: enable
"**/.scripts/**/*",
"eng/scripts/**/*",
"packages/*/scripts/**/*",
"**/typespec-ts/test/*/generated/**/*",
"**/src/modular/static/**/*",
],
rules: allFilesRules,
overrides: [
typescriptFileOverride,
jsxFilesOverride,
testFilesOverride,
{
// typespec-ts has static helper files which are copied verbatim into generated output and
// intentionally keep camelCase names to match the upstream Azure SDK sources.
files: ["**/packages/typespec-ts/static/**/*.ts", "**/packages/typespec-ts/static/**/*.mts"],
rules: {
"unicorn/filename-case": "off",
},
},
{
// Generated by `npm run gen:scenario-suites`. The file names encode the scenario
// directory tree with `__` separators (e.g. `models__nested-enum__not-flatten`), so
// they intentionally don't follow kebab-case.
files: ["**/packages/typespec-ts/test/modular-unit/scenario-suites/**/*.test.ts"],
rules: {
"unicorn/filename-case": "off",
},
},
{
// Astro route files (e.g. `[...path]/[llms_type].txt.ts`) use framework-required naming.
files: ["**/website/src/pages/**/*.ts", "**/website/src/components/**/*.ts"],
rules: {
"unicorn/filename-case": "off",
},
},
{
// typespec-ts tests use chai-style assertions (`expect(x).to.match(...)`), which oxlint's
// vitest plugin misreads as an unknown expect modifier.
files: ["**/packages/typespec-ts/**/*.test.ts"],
plugins: ["vitest"],
rules: {
"vitest/valid-expect": "off",
},
},
// Type-aware rules (no-floating-promises, no-deprecated) shared from core. They only run when
// oxlint is invoked with `--type-aware`. typespec-ts is excluded at the CLI level in the root
// `lint` script (its tsconfig is not tsgo-compatible and type-checking it OOMs).
typeAwareOverride,
],
});
13 changes: 5 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
"format:dir": "prettier --write",
"format:extra": "pnpm run-all format:extra",
"format:extra:check": "pnpm run-all format:extra:check",
"lint": "eslint . --max-warnings=0",
"lint": "oxlint . --deny-warnings && oxlint packages --type-aware --deny-warnings --ignore-pattern \"packages/typespec-ts/**\"",
"lint:ci": "oxlint . --format=unix --deny-warnings && oxlint packages --format=unix --type-aware --deny-warnings --ignore-pattern \"packages/typespec-ts/**\"",
"lint:extra": "pnpm run-all lint:extra",
"lint:fix": "eslint . --fix",
"lint:fix": "oxlint . --fix",
"pack:all": "chronus pack --pack-destination ./temp/artifacts",
"preinstall": "npx only-allow pnpm",
"prepare-publish": "node ./eng/scripts/prepare-publish.js",
Expand All @@ -47,15 +48,12 @@
"devDependencies": {
"@chronus/chronus": "catalog:",
"@chronus/github": "catalog:",
"@eslint/js": "catalog:",
"@pnpm/workspace.find-packages": "catalog:",
"@types/node": "catalog:",
"@vitest/coverage-v8": "catalog:",
"@vitest/eslint-plugin": "catalog:",
"cspell": "catalog:",
"eslint": "catalog:",
"eslint-plugin-import": "catalog:",
"eslint-plugin-unicorn": "catalog:",
"oxlint": "catalog:",
"oxlint-tsgolint": "catalog:",
"playwright": "catalog:",
"prettier": "catalog:",
"prettier-plugin-astro": "catalog:",
Expand All @@ -65,7 +63,6 @@
"tsx": "catalog:",
"turbo": "catalog:",
"typescript": "catalog:",
"typescript-eslint": "catalog:",
"vitest": "catalog:"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/typespec-autorest-canonical/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@
"test:watch": "vitest -w",
"test:ui": "vitest --ui",
"test:ci": "vitest run --coverage --reporter=junit --reporter=default",
"lint": "eslint . --max-warnings=0",
"lint:fix": "eslint . --fix ",
"lint": "oxlint . --deny-warnings",
"lint:fix": "oxlint . --fix",
"regen-docs": "tspd doc . --enable-experimental --output-dir ../../website/src/content/docs/docs/emitters/typespec-autorest-canonical/reference"
},
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/typespec-autorest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"test:watch": "vitest -w",
"test:ui": "vitest --ui",
"test:ci": "vitest run --coverage --reporter=junit --reporter=default",
"lint": "eslint . --max-warnings=0",
"lint:fix": "eslint . --fix ",
"lint": "oxlint . --deny-warnings",
"lint:fix": "oxlint . --fix",
"regen-docs": "tspd doc . --enable-experimental --output-dir ../../website/src/content/docs/docs/emitters/typespec-autorest/reference"
},
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/typespec-azure-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
"test:watch": "vitest -w",
"test:ui": "vitest --ui",
"test:ci": "vitest run --coverage --reporter=junit --reporter=default",
"lint": "eslint . --max-warnings=0",
"lint:fix": "eslint . --fix ",
"lint": "oxlint . --deny-warnings",
"lint:fix": "oxlint . --fix",
"regen-docs": "tspd doc . --enable-experimental --llmstxt --output-dir ../../website/src/content/docs/docs/libraries/azure-core/reference"
},
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/typespec-azure-playground-website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@
"watch": "vite --port 5174",
"test:e2e": "cross-env PW_EXPERIMENTAL_TS_ESM=1 playwright test -c e2e",
"test:e2e:headed": "cross-env PW_EXPERIMENTAL_TS_ESM=1 playwright test -c e2e --headed",
"lint": "eslint . --max-warnings=0",
"lint:fix": "eslint . --fix "
"lint": "oxlint . --deny-warnings",
"lint:fix": "oxlint . --fix"
},
"files": [
"lib/*.tsp",
Expand Down
4 changes: 2 additions & 2 deletions packages/typespec-azure-portal-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"test:watch": "vitest -w",
"test:ui": "vitest --ui",
"test:ci": "vitest run --coverage --reporter=junit --reporter=default",
"lint": "eslint . --max-warnings=0",
"lint:fix": "eslint . --fix ",
"lint": "oxlint . --deny-warnings",
"lint:fix": "oxlint . --fix",
"regen-docs": "tspd doc . --enable-experimental --output-dir ../../website/src/content/docs/docs/libraries/azure-portal-core/reference"
},
"keywords": [
Expand Down
4 changes: 2 additions & 2 deletions packages/typespec-azure-resource-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@
"test:watch": "vitest -w",
"test:ui": "vitest --ui",
"test:ci": "vitest run --coverage --reporter=junit --reporter=default",
"lint": "eslint . --max-warnings=0",
"lint:fix": "eslint . --fix ",
"lint": "oxlint . --deny-warnings",
"lint:fix": "oxlint . --fix",
"regen-docs": "tspd doc . --enable-experimental --llmstxt --output-dir ../../website/src/content/docs/docs/libraries/azure-resource-manager/reference"
},
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/typespec-azure-rulesets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"test:watch": "vitest -w",
"test:ui": "vitest --ui",
"test:ci": "vitest run --coverage --reporter=junit --reporter=default",
"lint": "eslint . --max-warnings=0",
"lint:fix": "eslint . --fix ",
"lint": "oxlint . --deny-warnings",
"lint:fix": "oxlint . --fix",
"regen-docs": "tspd doc . --enable-experimental --output-dir ../../website/src/content/docs/docs/emitters/typespec-azure-rulesets/reference"
},
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/typespec-client-generator-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
"test:watch": "vitest -w",
"test:ui": "vitest --ui",
"test:ci": "vitest run --coverage --reporter=junit --reporter=default",
"lint": "eslint . --max-warnings=0",
"lint:fix": "eslint . --fix ",
"lint": "oxlint . --deny-warnings",
"lint:fix": "oxlint . --fix",
"regen-docs": "tspd doc . --enable-experimental --llmstxt --output-dir ../../website/src/content/docs/docs/libraries/typespec-client-generator-core/reference"
},
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/typespec-metadata/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
"build": "tsc -p tsconfig.build.json",
"watch": "tsc -p tsconfig.build.json --watch",
"clean": "rimraf ./dist ./temp",
"lint": "eslint . --max-warnings=0",
"lint:fix": "eslint . --fix ",
"lint": "oxlint . --deny-warnings",
"lint:fix": "oxlint . --fix",
"test": "vitest run",
"test:watch": "vitest -w",
"test:ui": "vitest --ui",
Expand Down
4 changes: 2 additions & 2 deletions packages/typespec-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"clean": "rimraf ./dist ./typespec-output",
"build": "tsc -p .",
"test": "npm run test-next && npm run unit-test && npm run integration-test-ci",
"lint": "eslint . --ext .ts --max-warnings=0",
"lint:fix": "eslint . --fix --ext .ts",
"lint": "oxlint . --deny-warnings",
"lint:fix": "oxlint . --fix",
"check:tree": "node ./test/commands/check-clean-tree.ts",
"integration-test-ci": "npm run copy:typespec && npm run spector-test",
"spector-test": "concurrently --kill-others --success first \"npm:start-test-server\" \"npm:generate-and-run\"",
Expand Down
Loading
Loading