mirror of
https://github.com/hanzoai/azure-sdk-for-js.git
synced 2026-10-30 19:51:51 +00:00
## Summary Upgrades the repo from ESLint **v9 → v10** (latest 10.x, resolves 10.8.0) and bumps `typescript-eslint` / `@typescript-eslint/*` from `~8.60.0` → `~8.65.0`. The repo already uses flat config (`eslint.config.mjs`) via the internal `@azure/eslint-plugin-azure-sdk`, so this is a version-bump + compatibility effort, not a config migration. Follow-up commits tidy up dependency declarations (pnpm catalog + redundant `@types/*`), address review feedback, and fix the real-world v10 lint breaks surfaced by CI. **Repo-wide lint verified:** `turbo lint --continue` across the whole workspace → **468/468 packages pass, 0 errors** (remaining `✖` are warnings only — the intentionally-downgraded rules). ESLint version is controlled centrally by the pnpm catalog in `pnpm-workspace.yaml`. ## Commit 1 — ESLint v9 → v10 + typescript-eslint 8.65 - **pnpm catalog**: `eslint ^9.39.1 → ^10.x`. - `@eslint/js ^9 → ^10.0.1`; `eslint-plugin-promise ^7.2.1 → ^7.3.0` (adds eslint `^10` peer); plugin `peerDependencies.eslint ^9.22.0 → ^10.0.0`. - `typescript-eslint` / `@typescript-eslint/*` `~8.60.0 → ~8.65.0` across the plugin, tooling packages, and `samples/frameworks/react/ts`. - **`eslint-plugin-import` peer blocker** (its latest still caps eslint at `^9`) resolved via pnpm `peerDependencyRules.allowedVersions` — only `import/no-extraneous-dependencies` is consumed and it works functionally under v10 (chosen over switching to `eslint-plugin-import-x` for lower risk / zero code change). - **`engines.node`** tightened to `>=22.13` (root) / `>=22.13.0` (plugin), matching ESLint 10's Node floor. - **ESLint 10 compat fix** in `src/utils/verifiers.ts`: `RuleFixer.replaceText` now hard-asserts a string, so a lying `(expected as string)` cast was replaced with `String(expected)` (2 fixers). - **3 new v10 `eslint:recommended` rules** (`preserve-caught-error`, `no-useless-assignment`, `no-unassigned-vars`) downgraded to `"warn"` in `eslint-customized.ts` with a justification comment, so the bump doesn't break `lint` repo-wide at once (mirrors the existing `no-param-reassign` precedent; can be promoted back to `error` after cleanup — tracked in #39423). **Validation:** plugin build OK; **vitest 703/703 pass**; `@azure/storage-queue` lint **0 errors, 51 warnings**. ## Commit 2 — pnpm catalog cleanup + redundant `@types/*` removal - Move **`@eslint/js`** and **`typescript-eslint`** into the `pnpm-workspace.yaml` default catalog and reference them via `"catalog:"` in workspace members (`eslint-plugin-azure-sdk`, `dev-tool`, `warp`, `vite-plugin-browser-test-map`, `turborepo-remote-cache`). - **`eng/tools/ci-runner`** is **not** a pnpm workspace member, so it keeps **direct** versions (a `catalog:` ref would not resolve there). The v7-pinned `js-sdk-release-tools` breaking-change-detector is left untouched. - Remove 3 redundant `@types/*` devDependencies from `eslint-plugin-azure-sdk` (`@types/eslint` — which was duplicated in both `dependencies` and `devDependencies` — plus `@types/eslint-config-prettier`), now that `eslint@10` and `eslint-config-prettier@10` ship their own bundled type definitions. ## Commit 3 — review feedback: bump the `eslint` runtime to v10 too - Two packages had `@eslint/js` bumped to v10 but still declared the `eslint` **runtime** at `^9`. Fixed: `turborepo-remote-cache` → `eslint: "catalog:"`; `ci-runner` → direct `eslint: ^10.8.0` (not a workspace member). - Catalog `eslint` pinned to the latest 10.x (`^10.8.0`); catalog now resolves eslint 10.8.0 everywhere. ## Commit 4 — repo-wide lint fix: `no-useless-assignment` in dev-tool Broad CI linting surfaced one real v10 error the shared `warn` downgrade did **not** cover: tooling packages (`dev-tool`, `warp`, `turborepo-remote-cache`, `ci-runner`, and the plugin itself) use **standalone** `eslint.config.mjs` files that apply `@eslint/js` `recommended` **directly**, bypassing the shared `eslint-customized.ts` overrides — so the 3 new rules fire as **errors** there, not warnings. - Fixed the single violation: `common/tools/dev-tool/.../checkNodeVersions.ts` dropped a redundant `= undefined` initializer on `artifactURL` (every code path reassigns or throws before it's read). Lint + `tsc` both clean. - Audited every standalone-config package in CI lint scope — `warp`, `vite-plugin-browser-test-map`, `turborepo-remote-cache`, and `eslint-plugin-azure-sdk` all lint clean; `dev-tool` was the only error. ## Commit 5 — `no-shadow-restricted-names` now reports `globalThis` (v10 change) A second CI run surfaced a different v10 behavior change: `no-shadow-restricted-names`'s `reportGlobalThis` option flipped its default from `false` → `true`, so it now flags `declare const globalThis` **ambient TypeScript declarations** (used to narrowly type `globalThis.*` without pulling in full lib types) as shadowing a restricted name. This broke `@typespec/ts-http-runtime` lint (`src/util/uuidUtils.ts` + `uuidUtils-react-native.mts`, 2 errors — the only two such declarations in the repo). - Restored the v9 behavior in the shared `eslint-customized.ts` via `"no-shadow-restricted-names": ["error", { reportGlobalThis: false }]`, keeping the rest of the rule active (still catches shadowing of `NaN`, `undefined`, `Infinity`, `eval`, `arguments`). This is the fix ESLint's own migration guide documents for the ambient-declaration case. ## Notes - The 3 new v10 recommended rules are intentionally `warn`, not `off`, for packages on the shared config — they stay visible for later cleanup (#39423). - The other `[ELIFECYCLE] Command failed` lines in the CI logs were turbo fail-fast casualties (different set each run), not independent errors — confirmed by linting them directly (all pass) and by the full-repo `turbo lint` (468/468). - No source/runtime behavior changes beyond the `verifiers.ts` compat fix and the dev-tool `artifactURL` cleanup; the rest is dependency + config metadata. ## Commit 6 — review feedback: downgrade the 3 new v10 rules in the `internal` config too _Copilot agent :copilot: (on behalf of @jeremymeng):_ Review feedback surfaced one more path the shared `eslint-customized.ts` warning downgrades did **not** reach: the `internal` config (in `src/configs/index.ts`) builds its own array that spreads `eslint.configs.recommended` but never includes `eslintCustomized`, so `preserve-caught-error`, `no-useless-assignment`, and `no-unassigned-vars` stayed as **errors** for consumers of `configs.internal` (e.g. `sdk/test-utils/recorder`) — contrary to the repo-wide warning-only migration intent. - Added the three `"warn"` downgrades directly to the `internal` config's inline `rules` block so it matches the `recommended` config. Scoped to just those three rules; no other restructuring. --------- Co-authored-by: Copilot App <[email protected]> Copilot-Session: cf6320ed-d2d6-420c-8188-6a63a557ca4b
59 lines
1.8 KiB
JSON
59 lines
1.8 KiB
JSON
{
|
|
"name": "@azure-tools/vite-plugin-browser-test-map",
|
|
"version": "1.0.0",
|
|
"description": "A vite plugin for dynamically remapping browser replacement maps for tests",
|
|
"sdk-type": "utility",
|
|
"type": "module",
|
|
"private": true,
|
|
"keywords": [
|
|
"vite-plugin"
|
|
],
|
|
"author": "Microsoft Corporation",
|
|
"license": "MIT",
|
|
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/common/tools/vite-plugin-browser-test-map/",
|
|
"repository": {
|
|
"type": "git",
|
|
"url": "https://github.com/Azure/azure-sdk-for-js.git",
|
|
"directory": "common/tools/vite-plugin-browser-test-map"
|
|
},
|
|
"bugs": {
|
|
"url": "https://github.com/Azure/azure-sdk-for-js/issues"
|
|
},
|
|
"main": "dist/index.js",
|
|
"types": "types/index.d.ts",
|
|
"files": [
|
|
"dist/",
|
|
"types/"
|
|
],
|
|
"scripts": {
|
|
"build": "tsc -p .",
|
|
"build:samples": "echo Skipped.",
|
|
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"./**/*.{ts,json,md}\"",
|
|
"clean": "rimraf --glob dist/",
|
|
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"./**/*.{ts,json,md}\"",
|
|
"lint": "eslint src",
|
|
"lint:fix": "eslint src --fix --fix-type [problem,suggestion]",
|
|
"pack": "pnpm pack 2>&1",
|
|
"prebuild": "npm run clean",
|
|
"test": "npm run test:node && npm run test:browser",
|
|
"test:browser": "echo skipped",
|
|
"test:node": "echo skipped",
|
|
"update-snippets": "echo skipped"
|
|
},
|
|
"engines": {
|
|
"node": ">=22.0.0"
|
|
},
|
|
"dependencies": {
|
|
"tslib": "^2.2.0"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "catalog:",
|
|
"@types/node": "catalog:",
|
|
"eslint": "catalog:",
|
|
"prettier": "^3.3.3",
|
|
"rimraf": "^6.0.1",
|
|
"typescript": "catalog:",
|
|
"typescript-eslint": "catalog:"
|
|
}
|
|
}
|