## 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
Azure SDK samples for React (TypeScript)
This sample application shows how to use the TypeScript client libraries for Azure in some common scenarios.
In this sample, we build a simple Todo application in React using create-react-app and integrating with various Azure services.
- Integration with Azure Event Hubs to support real-time updates across multiple instances of the application.
- Integration with Azure Storage Blob for persisting ToDo attachments.
Prerequisites
The samples are compatible with LTS versions of Node.js.
Before running the samples in Node, they must be compiled to JavaScript using the TypeScript compiler. For more information on TypeScript, see the TypeScript documentation.
You need an Azure subscription and the following resources created to run this sample:
- An Azure Event Hubs namespace. Please refer to the Event Hubs documentation for additional information on Event Hubs.
- An Azure Storage Blob container. Please refer to the Storage Blob documentation for additional information on Azure Storage Blob. This file will be fetched from Azure Storage Blob and displayed on the screen.
- Finally, you'll need a way to authenticate the application with Azure. Please refer to the @azure/identity package for information on authentication. The instructions below will walk you through the necessary steps.
To quickly create the needed resources in Azure and to receive the necessary environment variables for them, you can deploy our sample template by clicking:
The above template will create the necessary resources for you and the output tab will contain the exact environment variables that you'll need as soon as deployment succeeds. When the deployment is finished, head over to the "outputs" tab and copy the outputs to a local file - you'll need them in the next step.
Register a new application in AAD and assign the "Azure Event Hubs Data Owner" and "Azure Storage Blob Data Contributor" role to it.
Authentication will still need to be set-up manually using the following instructions:
- See https://learn.microsoft.com/azure/active-directory/develop/quickstart-register-app to register a new application in the Azure Active Directory.
- Note down the client id and tenant id from the above step. You will need to set these in the .env file below.
By default we'll be using http://localhost:3000 to serve the app and handle redirects, so please go ahead and add that configuration with the following steps:
- Click on Authentication in the app registration side bar
- Select "Add a platform"
- Select "Single-page application"
- In the "Redirect URIs" field please enter: http://localhost:3000
- Click "Configure"
Ensure your app registration has been configured properly to allow the implicit grant flow
and allow both Access tokens and ID tokens to be issued by the authorization endpoint.
In your app registration, you will also need to add a permission for the Microsoft.EventHubs and Azure Storage apps.
When adding permission for Microsoft.EventHubs and Azure Storage, the type should be delegated permissions and the permission should be user_impersonation.
Running the sample
Once the above created you'll want to ensure React has the necessary environment variables. To do this, copy sample.env as .env and provide the necessary environment variables to configure the application. You can get most values from the output tab of the deployment, and the client and tenant ID from the App registration step. Please note that environment variables should be upper case. For example: REACT_APP_TENANT_ID and REACT_APP_EVENT_HUBS_NAME.
Install the various packages as well as the TypeScript compiler using:
npm install
Run the sample app:
npm start
Since this is a contrived example, you can only create new Todos and complete existing Todos. As you interact with the application, you'll notice EventHubs messages get written out to the console in the browser's developer tools. You may attach a note which will get uploaded as Blobs or fetch an existing note to display it on the screen.
Additionally, you may open multiple instances of this sample application and watch as Todos synchronize in real-time.
Next Steps
Take a look at our API Documentation for more information about the APIs that are available.
