eslint-plugin

@masknet/prefer-defer-import

Prefer defer import a module.

Rule Details

Options

/**
 * @minItems Infinity
 */
export type Options = [
  | {
      /**
       * @minItems 0
       */
      deferPackages?: string[]
    }
  | {
      /**
       * @minItems 0
       */
      eagerPackages?: string[]
    },
]

:x: Incorrect

import { foo } from 'bar'
foo

:white_check_mark: Correct

import defer * as foo from "bar";
foo.foo;

Attributes