webhook/node_modules/eslint-plugin-import/docs/rules/no-namespace.md
Joel Male 1ada95e04a
v2.0.0 (#12)
- Convert project to Javascript/Typescript
- Allow custom headers to be passed in (optional)
- Allow body to be optional
2020-08-26 10:52:47 +10:00

706 B

import/no-namespace

Enforce a convention of not using namespace (a.k.a. "wildcard" *) imports.

+(fixable) The --fix option on the [command line] automatically fixes problems reported by this rule, provided that the namespace object is only used for direct member access, e.g. namespace.a. The --fix functionality for this rule requires ESLint 5 or newer.

Rule Details

Valid:

import defaultExport from './foo'
import { a, b }  from './bar'
import defaultExport, { a, b }  from './foobar'

Invalid:

import * as foo from 'foo';
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.