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.
Examples of incorrect code for this rule:
import styles from './MyComponent.scss';
Examples of correct code for this rule:
import './MyComponent.scss';
- Default bundler loader configuration used in liferay-portal.