Skip to content

Enable @typescript-eslint/no-deprecated linting rule for vite-plugin-cloudflare#14718

Merged
dario-piotrowicz merged 1 commit into
mainfrom
dario/no-deprecated-vite-plugin
Jul 17, 2026
Merged

Enable @typescript-eslint/no-deprecated linting rule for vite-plugin-cloudflare#14718
dario-piotrowicz merged 1 commit into
mainfrom
dario/no-deprecated-vite-plugin

Conversation

@dario-piotrowicz

Copy link
Copy Markdown
Member

This PR enables the @typescript-eslint/no-deprecated linting rule for the vite-pluging-cloudflare package

Followup for #14472, #14491, #14509, #14522, #14579, #14625 and #14671


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: internal refactoring

@ask-bonk

ask-bonk Bot commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

The changes are consistent and correct. Let me do a final verification on the fallbackOptions type — the object has logLevel: "silent" as const, but I want to confirm both rolldownOptions and rollupOptions accept this shape. The output.entryFileNames and input are common. logLevel — let me verify this is valid for both. This was "silent" before as rollupOptions.logLevel, so it's valid for rollup. For rolldown, RolldownOptions should also support logLevel. Given the as const was needed, TypeScript is validating this against both branches. Since the PR presumably passed pnpm check (type-check under Vite 8), and the code assigns fallbackOptions to both rolldownOptions and rollupOptions, TS would flag a mismatch if incompatible.

There's one subtle issue worth flagging: fallbackOptions is now a shared object literal assigned to environment.config.build.rolldownOptions OR rollupOptions. Under Vite 6/7, rolldownOptions doesn't exist, but that branch is guarded by isRolldown, so it's never executed there. Fine at runtime.

I've thoroughly reviewed all four changed files. The changes:

  1. Remove the lint override (correct, the goal of the PR)
  2. build.ts — branch rollup/rolldown for reading and writing build input options, correctly guarded by isRolldown, with no-deprecated disable comments only on the genuinely-deprecated rollupOptions accesses
  3. cloudflare-environment.ts — remove deprecated Rollup.RollupOptions annotation, use as const
  4. vitest-setup.ts — swap deprecated Rollup.* types for Rolldown.* (type-only, runtime-safe)

The logic is consistent between the read (hasClientEntry) and write (fallbackBuild) sites, the guards match the existing pattern in cloudflare-environment.ts, and no behavioral regression is introduced. Type-checking runs under Vite 8 where the Rolldown namespace exists; Vite 6/7 CI only runs runtime playground tests where erased types have no effect.

No actionable issues found.

LGTM

github run

@pkg-pr-new

pkg-pr-new Bot commented Jul 16, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@14718

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@14718

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@14718

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14718

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@14718

miniflare

npm i https://pkg.pr.new/miniflare@14718

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@14718

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@14718

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@14718

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@14718

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@14718

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@14718

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@14718

wrangler

npm i https://pkg.pr.new/wrangler@14718

commit: 450ec7b

@dario-piotrowicz
dario-piotrowicz force-pushed the dario/no-deprecated-vite-plugin branch from aec796a to b3068ed Compare July 16, 2026 16:56
@changeset-bot

changeset-bot Bot commented Jul 16, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 450ec7b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@dario-piotrowicz dario-piotrowicz added the ci:no-changeset-required Skip pull request checks for a valid changeset label Jul 16, 2026
@dario-piotrowicz
dario-piotrowicz force-pushed the dario/no-deprecated-vite-plugin branch from b3068ed to 450ec7b Compare July 16, 2026 17:46
@dario-piotrowicz
dario-piotrowicz marked this pull request as ready for review July 16, 2026 21:17
@workers-devprod
workers-devprod requested review from a team and NuroDev and removed request for a team July 16, 2026 21:18
@workers-devprod

workers-devprod commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

Comment thread packages/vite-plugin-cloudflare/src/cloudflare-environment.ts

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Jul 17, 2026
@dario-piotrowicz
dario-piotrowicz merged commit ec2600e into main Jul 17, 2026
76 of 77 checks passed
@dario-piotrowicz
dario-piotrowicz deleted the dario/no-deprecated-vite-plugin branch July 17, 2026 14:35
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Jul 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:no-changeset-required Skip pull request checks for a valid changeset

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants