emptyModuleAttributes
Reports empty import/export attributes that serve no purpose.
✅ This rule is included in the ts stylistic presets.
Import attributes (using with {}) allow specifying metadata about a module import.
An empty with {} clause provides no additional information and should be removed.
Examples
Section titled “Examples”import data from "./data.json" with {};import { x } from "./module" with {};export { x } from "./module" with {};export * from "./module" with {};import data from "./data.json" with { type: "json" };import { x } from "./module";export { x } from "./module";import styles from "./styles.css" with { type: "css" };Options
Section titled “Options”This rule is not configurable.
When Not To Use It
Section titled “When Not To Use It”If you intentionally use empty import attributes as placeholders or for tooling purposes, you may disable this rule.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”
Made with ❤️🔥 in Boston by
Josh Goldberg and contributors.