
Security News
NVD Concedes Inability to Keep Pace with Surging CVE Disclosures in 2025
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
eslint-import-resolver-localalias
Advanced tools
A simple Node behavior import resolution plugin for eslint-plugin-import, supporting module alias with local project modules and node_modules.
This is a simple Node.js module import resolution plugin for eslint-plugin-import
, which supports native Node.js module resolution, module alias and custom file extensions. Also supports aliases for project modules.
Prerequisites: Node.js >=6.x and corresponding version of npm.
npm install eslint-plugin-import eslint-import-resolver-localalias --save-dev
Pass this resolver and its parameters to eslint-plugin-import
using your eslint
config file, .eslintrc
or .eslintrc.js
.
// .eslintrc.js
module.exports = {
settings: {
'import/resolver': {
localalias: {
map: [
['babel-polyfill', 'babel-polyfill/dist/polyfill.min.js'],
['helper', './utils/helper'],
['material-ui/DatePicker', '../custom/DatePicker'],
['material-ui', 'material-ui-ie10'],
['@project-module', 'module/path/'],
['project-module2', 'module2']
],
extensions: ['.ts', '.js', '.jsx', '.json']
}
}
}
};
Note:
map
and extensions
, both of which are array typesmap
array is also array type which contains 2 string
map
item ['helper', './utils/helper']
means that the module helper/*
will be resolved to ./utils/helper/*
. See #3extensions
property is ['.js', '.json', '.node']
if it is assigned to an empty array or not specified.If the extensions
property is not specified, the config object can be simplified to the map
array.
// .eslintrc.js
module.exports = {
settings: {
'import/resolver': {
localalias: [
['babel-polyfill', 'babel-polyfill/dist/polyfill.min.js'],
['helper', './utils/helper'],
['material-ui/DatePicker', '../custom/DatePicker'],
['material-ui', 'material-ui-ie10'],
['@project-module', 'module/path/'],
['project-module2', 'module2']
]
}
}
};
When the config is not a valid object (such as true
), the resolver falls back to native Node.js module resolution.
// .eslintrc.js
module.exports = {
settings: {
'import/resolver': {
alias: true
}
}
};
FAQs
A simple Node behavior import resolution plugin for eslint-plugin-import, supporting module alias with local project modules and node_modules.
The npm package eslint-import-resolver-localalias receives a total of 3 weekly downloads. As such, eslint-import-resolver-localalias popularity was classified as not popular.
We found that eslint-import-resolver-localalias 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
Security experts warn that recent classification changes obscure the true scope of the NVD backlog as CVE volume hits all-time highs.
Security Fundamentals
Attackers use obfuscation to hide malware in open source packages. Learn how to spot these techniques across npm, PyPI, Maven, and more.
Security News
Join Socket for exclusive networking events, rooftop gatherings, and one-on-one meetings during BSidesSF and RSA 2025 in San Francisco.