
Security News
PolinRider: North Korea-Linked Supply Chain Campaign Expands Across Open Source Ecosystems
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.
eslint-plugin-loadable-imports
Advanced tools
An ESLint plugin to automatically sort loadable imports alphabetically in your JavaScript files.
You can install this plugin using either npm or yarn:
# npm
npm install eslint-plugin-loadable-imports --save-dev
# yarn
yarn add eslint-plugin-loadable-imports --dev
After installing the plugin, you need to add it to your ESLint configuration file (.eslintrc.js or equivalent).
Add loadable-imports to the plugins array and the sort-loadable-imports rule to the rules section:
module.exports = {
plugins: [
'loadable-imports',
],
rules: {
'loadable-imports/sort-loadable-imports': 'error', // or warn
},
};
Before running ESLint:
const SecondComponent = loadable(() => import('@/components/SecondComponent'));
const FirstComponent = loadable(() => import('@/components/FirstComponent'));
const ThirdComponent = loadable(() => import('@/components/ThirdComponent'));
After applying the rule (sorted alphabetically):
const FirstComponent = loadable(() => import('@/components/FirstComponent'));
const SecondComponent = loadable(() => import('@/components/SecondComponent'));
const ThirdComponent = loadable(() => import('@/components/ThirdComponent'));
Currently, sort-loadable-imports does not have any options. It simply sorts the imports wrapped in loadable() alphabetically based on the variable names.
You can use ESLint's --fix option to automatically sort the imports.
FAQs
ESLint plugin to sort loadable imports
We found that eslint-plugin-loadable-imports demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
PolinRider expands across npm, Packagist, Go modules, and Chrome extensions, using hidden loaders to target developer environments.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.