Skip to content
This repository has been archived by the owner on Sep 30, 2020. It is now read-only.

Latest commit

 

History

History
23 lines (14 loc) · 1 KB

no-loader-import-specifier.md

File metadata and controls

23 lines (14 loc) · 1 KB

Disallow use of specifiers for non-JS resources imported via the loader (no-loader-import-specifier)

The Liferay bundler provides various loaders for injecting non-JS resources (for example, CSS, SCSS) into a page. These resources should be included via import statements for their side effects only, and not bound to a name using an import specifier.

NOTE: At present, we only use this mechanism to load ".scss" files, but may extend this rule in the future to handle other non-JS resource types.

Rule Details

Examples of incorrect code for this rule:

import styles from './MyComponent.scss';

Examples of correct code for this rule:

import './MyComponent.scss';

Further Reading