Skip to content

feat(lint): add pnpm vite alias oxlint rule - #1736

Draft
fengmk2 wants to merge 1 commit into
mainfrom
codex/pnpm-vite-alias-oxlint-rule
Draft

feat(lint): add pnpm vite alias oxlint rule#1736
fengmk2 wants to merge 1 commit into
mainfrom
codex/pnpm-vite-alias-oxlint-rule

Conversation

@fengmk2

Copy link
Copy Markdown
Member

Summary

  • Add vite-plus/require-pnpm-vite-alias to the Vite+ Oxlint plugin.
  • Enable the new rule in generated/default Vite+ lint configs.
  • Update generated-config snapshots to include the new default rule.

Why

PR #1728 fixed a pnpm monorepo issue where removing the direct aliased vite dependency from an application package made the workspace override appear ineffective. This lint rule catches that class of configuration drift in Vite+ application packages.

Validation

  • pnpm exec tsc --noEmit --pretty false
  • vp fmt --check packages/cli/src/oxlint-plugin.ts packages/cli/src/oxlint-plugin-config.ts packages/cli/src/__tests__/oxlint-plugin.spec.ts
  • vp lint packages/cli/src/oxlint-plugin.ts packages/cli/src/oxlint-plugin-config.ts packages/cli/src/__tests__/oxlint-plugin.spec.ts
  • vp test packages/cli/src/__tests__/oxlint-plugin.spec.ts
  • git diff --check

Note: pnpm -F vite-plus snap-test-global new-vite-monorepo was skipped on Windows by the snap-test runner.

@netlify

netlifyBot commented Jun 1, 2026

Copy link
Copy Markdown

Deploy Preview for viteplus-preview canceled.

NameLink
🔨 Latest commit526bf1b
🔍 Latest deploy loghttps://app.netlify.com/projects/viteplus-preview/deploys/6a1d5b587b986f00081faa6a

@fengmk2fengmk2 self-assigned this Jun 1, 2026
@fengmk2fengmk2 changed the title [codex] add pnpm vite alias oxlint rulefeat(lint): add pnpm vite alias oxlint ruleJun 1, 2026
@fengmk2
fengmk2force-pushed the codex/pnpm-vite-alias-oxlint-rule branch from bc77362 to 81c7565CompareJune 1, 2026 09:18
Comment threadpackages/cli/src/oxlint-plugin.ts Outdated
@fengmk2
fengmk2force-pushed the codex/pnpm-vite-alias-oxlint-rule branch from 81c7565 to 76d3a9dCompareJune 1, 2026 09:26
@github-actions

github-actionsBot commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

✅ Staging deployment successful!

Preview: https://viteplus-staging.void.app/
Commit: 526bf1b

@fengmk2
fengmk2force-pushed the codex/pnpm-vite-alias-oxlint-rule branch 3 times, most recently from c352ce0 to 0d2d55dCompareJune 1, 2026 10:06
Comment threadpackages/cli/snap-tests/lint-pnpm-vite-alias/snap.txt Outdated
@fengmk2
fengmk2force-pushed the codex/pnpm-vite-alias-oxlint-rule branch from 0d2d55d to cdab1ecCompareJune 1, 2026 10:10
@fengmk2
fengmk2force-pushed the codex/pnpm-vite-alias-oxlint-rule branch from cdab1ec to 526bf1bCompareJune 1, 2026 10:13
return false;
}

const packageJsonPath = path.join(path.dirname(filename), 'package.json');

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

@camc314 Does oxlint plan to support json files? We currently have two requirements for json configuration checks, both related to rule judgments for json files. This PR is one of them, and the other one is #1456.

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.

Does oxlint plan to support json files?

yes - it should work via a plugin once oxc-project/oxc#21936 has shipped

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.

in the interim, maybe only check the json files when linting vite.config.ts?

Copy link
Copy Markdown
MemberAuthor

Choose a reason for hiding this comment

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

Yes, this is how it is currently implemented, but the error message points to the vite.config.ts file, which is not user-friendly.

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@fengmk2@camc314