Skip to content

Latest commit

 

History

History
259 lines (110 loc) · 4.22 KB

imports.md

File metadata and controls

259 lines (110 loc) · 4.22 KB

Imports

ensure default import coupled with default export

❌ Disabled


disallow invalid exports, e.g. multiple defaults

✅ Enabled (error)


Ensure consistent use of file extension within the import path

❌ Disabled


disallow non-import statements appearing before import statements

✅ Enabled (error)

// Bad
/*
import foo from './foo';
initWith(foo);
import bar from './bar';
*/

// Good
import foo from './foo';
import bar from './bar';
initWith(foo);

ensure named imports coupled with named exports

❌ Disabled


enforces names exist at the time they are dereferenced, when imported as a full namespace

❌ Disabled


Require a newline after the last import/require in a group

❌ Disabled


disallow AMD require/define

✅ Enabled (error)


disallow require()

❌ Disabled


disallow use of jsdoc-marked-deprecated imports

❌ Disabled


disallow duplicate imports

✅ Enabled (error)

// Bad
/*
import SomeDefaultClass from './mod';
import foo from './some-other-mod';
import * as names from './mod';
import { something } from './mod.js';
*/

Forbid the use of extraneous packages

❌ Disabled


Forbid mutable exports

✅ Enabled (error)

// Bad
/*
export let count = 2;
let count = 4;
export { count };
*/

warn on accessing default export property names that are also named exports

❌ Disabled


do not allow a default import name to match a named export

❌ Disabled


disallow namespace imports

❌ Disabled


No Node.js builtin modules

❌ Disabled


ensure imports point to files/modules that can be resolved

✅ Enabled (error)


Enforce a convention in module import order

❌ Disabled


Require modules with a single export to use a default export

❌ Disabled