Skip to main content

no-at-sign-internal-import

Disallow internal alias imports under "@/".

Targeted pattern scopeโ€‹

This rule inspects module source strings in imports/exports and reports values matching the default disallow glob "@/**".

What this rule reportsโ€‹

This rule reports source strings that match "@/**". It is useful when @ should be reserved for package roots and not direct internal alias paths.

Why this rule existsโ€‹

If your architecture reserves @ for package-level entrypoints only, this rule prevents deep internal alias imports.

โŒ Incorrectโ€‹

import value from "@/feature";

โœ… Correctโ€‹

import value from "@";

Behavior and migration notesโ€‹

This rule reports only and does not provide an autofix.

Typical migration is switching to package exports, public entrypoints, or allowed local relative imports.

Optionsโ€‹

type Options = {
allow?: string[];
disallow?: string[];
};

Default:

{
"disallow": ["@/**"]
}

Additional examplesโ€‹

// default disallow: ["@/**"]
import { helper } from "@/internal/helper";
// โŒ reported

import { helper } from "@";
// โœ… not matched by default pattern

ESLint flat config exampleโ€‹

import etcMisc from "eslint-plugin-etc-misc";

export default [
{
plugins: { "etc-misc": etcMisc },
rules: {
"etc-misc/no-at-sign-internal-import": "error",
},
},
];

When not to use itโ€‹

Disable this rule if @/ internal alias imports are part of your standard architecture.

Package documentationโ€‹

Rule catalog ID: R018

Further readingโ€‹

Adoption resourcesโ€‹

  • Start at warning level in CI, then move to error after cleanup.
  • Use focused codemods/autofix batches per package or directory.