Skip to content

Ignore HTTP imports in no-missing-import - #547

Merged
aladdin-add merged 1 commit into
eslint-community:masterfrom
morgan-coded:fix/65-http-imports
Jul 3, 2026
Merged

Ignore HTTP imports in no-missing-import#547
aladdin-add merged 1 commit into
eslint-community:masterfrom
morgan-coded:fix/65-http-imports

Conversation

@morgan-coded

Copy link
Copy Markdown

HTTP(S) specifiers were being classified through the package-import path in ImportTarget, so n/no-missing-import could report them as missing files. The shared import-target utility now classifies them as URL imports before package matching and skips filesystem resolution for http: and https: imports.

The rule run passed with 78 cases. The full rules run passed with 3059 passing and 3 pending, along with ESLint and TypeScript checks. Fixes #65

Copilot AI review requested due to automatic review settings July 2, 2026 21:37

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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

Copy link
Copy Markdown

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: 17115f0f14

ℹ️ 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".

Comment thread lib/util/import-target.js
Comment on lines +310 to 313
(this.moduleType === "data" || this.moduleType === "http") &&
this.moduleStyle === "import"
) {
return this.name

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Avoid treating URL imports as file paths

For http(s) imports this returns the URL string as target.filePath, but other consumers of ImportTarget assume filePath is a real filesystem path. In n/no-unpublished-import, checkPublish calls toRelative(target.filePath) for targets with no moduleName; when a published file imports https://..., that URL is interpreted as a relative path (often outside the package, depending on cwd/package layout) and can be reported as "https://..." is not published. The no-missing rule only needs to suppress resolveError, so URL imports should be skipped without exposing them as filesystem paths to publish checks.

Useful? React with 👍 / 👎.

@aladdin-add aladdin-add left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM, thanks!

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.

no-missing-import to support HTTP imports

3 participants