Skip to content

Latest commit

Β 

History

History
48 lines (33 loc) Β· 1.12 KB

require-module-attributes.md

File metadata and controls

48 lines (33 loc) Β· 1.12 KB

require-module-attributes

πŸ“ Require non-empty module attributes for imports and exports.

πŸ’Ό This rule is enabled in the following configs: βœ… recommended, β˜‘οΈ unopinionated.

πŸ”§ This rule is automatically fixable by the --fix CLI option.

Enforce non-empty attribute list in import/export statements and import() expressions.

Empty import or export attributes and empty dynamic-import options carry no metadata and can make a module reference look configured when it is not.

Examples

// ❌
import foo from 'foo' with {};

// βœ…
import foo from 'foo';
// ❌
export {foo} from 'foo' with {};

// βœ…
export {foo} from 'foo';
// ❌
const foo = await import('foo', {});

// βœ…
const foo = await import('foo');
// ❌
const foo = await import('foo', {with: {}});

// βœ…
const foo = await import('foo');