Security News
The Dark Side of Open Source
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
eslint-import-resolver-root-import
Advanced tools
Readme
Babel Plugin Root Import ESLint resolver.
This is a fork of eslint-import-resolver-babel-root-import that works with latest version of Babel using babel.config.js
for configaration.
yarn add eslint-plugin-import eslint-import-resolver-root-import
Inside your .eslintrc
file, pass this resolver to eslint-plugin-import
:
"settings": {
"import/resolver": "root-import"
}
And see [babel-plugin-root-import] to know how to configure your prefix/suffix.
Configuration will be parsed down from babel.config.js
file.
This plugin accept all configurations that eslint-import-resolver-node accepts plus rootPathSuffix
and rootPathPrefix
.
Both rootPathSuffix
and rootPathPrefix
are fetched by default from your babel.config.js
, but if you prefer you can define these values inside .eslintrc
.
{
"extends": "airbnb",
"rules": {},
"settings": {
"import/resolver": {
"root-import": {
"rootPathPrefix": "~",
"rootPathSuffix": "src/js",
"extensions": [".js", ".android.js", ".ios.js"]
}
}
}
}
In this case we are using .android.js
and .ios.js
in our extensions so in React Native we can import files like:
import MyComponent from '~/components/MyComponent';
And it will resolve to components/MyComponent/index.android.js
or components/MyComponent/index.ios.js
;
MIT, see LICENSE.md for details.
FAQs
Babel Plugin Root Import ESLint resolver.
The npm package eslint-import-resolver-root-import receives a total of 517 weekly downloads. As such, eslint-import-resolver-root-import popularity was classified as not popular.
We found that eslint-import-resolver-root-import 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
At Node Congress, Socket CEO Feross Aboukhadijeh uncovers the darker aspects of open source, where applications that rely heavily on third-party dependencies can be exploited in supply chain attacks.
Research
Security News
The Socket Research team found this npm package includes code for collecting sensitive developer information, including your operating system username, Git username, and Git email.
Security News
OpenJS is warning of social engineering takeovers targeting open source projects after receiving a credible attempt on the foundation.