Skip to content

feat: eslint rule to remove redundant imports#15

Merged
onmax merged 7 commits intomainfrom
feat/no-redundant-import
Mar 30, 2026
Merged

feat: eslint rule to remove redundant imports#15
onmax merged 7 commits intomainfrom
feat/no-redundant-import

Conversation

@onmax
Copy link
Copy Markdown
Owner

@onmax onmax commented Mar 29, 2026

Summary

  • Ships an ESLint plugin (nuxt-skill-hub/eslint-plugin) with a no-redundant-import rule
  • Auto-enabled when @nuxt/eslint is installed via the eslint:config:addons hook
  • Collects auto-imports from Nuxt's unimport and passes them as ESLint settings
  • Auto-fixes: removes redundant specifiers or entire statements, converts import { type X } to import type { X } when applicable

Before: import { ref, computed } from 'vue' (redundant — already auto-imported)
After: removed by eslint --fix

Opt-out: skillHub: { eslint: false } or 'skill-hub/no-redundant-import': 'off'

Test plan

  • ESLint rule unit tests with RuleTester (valid/invalid cases, partial removal, .d.ts skip)
  • Module setup test updated for new hook registration
  • Lint passes clean
  • Production build succeeds

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 29, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
nuxt-skill-hub Ready Ready Preview, Comment Mar 29, 2026 7:59pm

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Mar 29, 2026

Open in StackBlitz

npm i https://pkg.pr.new/nuxt-skill-hub@15

commit: a189900

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: db7d465809

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown
Owner Author

@onmax onmax left a comment

Choose a reason for hiding this comment

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

Reviewed locally and addressed the issues on this branch.

Fixed in 7a3c1c5:

  • detect aliased auto-import bindings by local name
  • keep type-only auto-import metadata separate from runtime imports
  • rebuild import declarations correctly when default imports are kept
  • add regression coverage and document the new skillHub.eslint option

Verified with:

  • pnpm vitest run test/eslint-no-redundant-import.test.ts test/module-setup.test.ts
  • pnpm lint

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4274878690

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 1eb2b1fe7a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4936bff02a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@onmax onmax merged commit 73a06f9 into main Mar 30, 2026
5 checks passed
@onmax onmax deleted the feat/no-redundant-import branch March 30, 2026 06:14
Sign up for free to 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.

1 participant