Files
NapCatQQ/.pnpm-store/v3/files/15/6d93099fc5382ec0bc666aa8aeb3f692d2868936f478f229e535f9ce28222c1a8111b0fde2a9b836b4b3de96dbb4e05e7bb7e618c7271e58b40ccb3d1a2a51
TanTan e311ca3275
Build NapCat Artifacts / Type Check & Test (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

45 lines
993 B
Plaintext

# import/no-namespace
🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
<!-- end auto-generated rule header -->
Enforce a convention of not using namespace (a.k.a. "wildcard" `*`) imports.
The rule is auto-fixable when the namespace object is only used for direct member access, e.g. `namespace.a`.
## Options
This rule supports the following options:
- `ignore`: array of glob strings for modules that should be ignored by the rule.
## Rule Details
Valid:
```js
import defaultExport from './foo'
import { a, b } from './bar'
import defaultExport, { a, b } from './foobar'
```
```js
/* eslint import/no-namespace: ["error", {ignore: ['*.ext']}] */
import * as bar from './ignored-module.ext';
```
Invalid:
```js
import * as foo from 'foo';
```
```js
import defaultExport, * as foo from 'foo';
```
## When Not To Use It
If you want to use namespaces, you don't want to use this rule.