Skip to content
Draft
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.
3 changes: 0 additions & 3 deletions .github/workflows/consistency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,6 @@ jobs:
- run: pnpm install
name: Install dependencies

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

- run: pnpm run lint
name: Lint

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 142 files
1 change: 1 addition & 0 deletions cspell.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ words:
- stac
- strconv
- tcgc
- tsgolint
- tsmv
- userrp
- vnet
Expand Down
53 changes: 0 additions & 53 deletions eslint.config.js

This file was deleted.

74 changes: 74 additions & 0 deletions oxlint.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
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",
},
},
{
// 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,
],
});
12 changes: 4 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"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: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 +47,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 +62,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 @@ -22,8 +22,8 @@
"test": "npm run test-next && npm run unit-test && npm run integration-test-ci",
"test:azure": "npm run test-next && npm run copy:typespec && npm run integration-test-ci:azure-rlc && npm run integration-test-ci:azure-modular",
"test:standard": "npm run test-next && npm run copy:typespec && npm run unit-test&& npm run integration-test-ci:rlc && npm run integration-test-ci:modular",
"lint": "eslint . --ext .ts --max-warnings=0",
"lint:fix": "eslint . --fix --ext .ts",
"lint": "oxlint . --deny-warnings",
"lint:fix": "oxlint . --fix",
"check:tree": "tsx ./test/commands/check-clean-tree.ts",
"test:ts:e2e": "npm run copy:typespec && npm run integration-test-ci:azure-rlc && npm run integration-test-ci:azure-modular",
"integration-test-ci": "npm-run-all copy:typespec integration-test-ci:rlc integration-test-ci:azure-rlc integration-test-ci:modular integration-test-ci:azure-modular",
Expand Down
Loading
Loading