source: frontend/node_modules/eslint-plugin-import/docs/rules/no-namespace.md

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 993 bytes
Line 
1# import/no-namespace
2
3🔧 This rule is automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/latest/user-guide/command-line-interface#--fix).
4
5<!-- end auto-generated rule header -->
6
7Enforce a convention of not using namespace (a.k.a. "wildcard" `*`) imports.
8
9The rule is auto-fixable when the namespace object is only used for direct member access, e.g. `namespace.a`.
10
11## Options
12
13This rule supports the following options:
14
15 - `ignore`: array of glob strings for modules that should be ignored by the rule.
16
17## Rule Details
18
19Valid:
20
21```js
22import defaultExport from './foo'
23import { a, b } from './bar'
24import defaultExport, { a, b } from './foobar'
25```
26
27```js
28/* eslint import/no-namespace: ["error", {ignore: ['*.ext']}] */
29import * as bar from './ignored-module.ext';
30```
31
32Invalid:
33
34```js
35import * as foo from 'foo';
36```
37
38```js
39import defaultExport, * as foo from 'foo';
40```
41
42## When Not To Use It
43
44If you want to use namespaces, you don't want to use this rule.
Note: See TracBrowser for help on using the repository browser.