Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
eslint-import-resolver-jest
Advanced tools
🃏 Jest import resolution plugin for eslint-plugin-import
"I like my testutils
where I can see 'em" 🕵🏽♀️
If you're using jest and you have installed custom name mappings in your config via the moduleNameMapper
config and you're using the wonderful eslint-plugin-import you might get yelled at by eslint:
(I oftentimes create an alias for the helpers I use for testing)
yarn add eslint-import-resolver-jest -D
or
npm i eslint-import-resolver-jest -D
If you are using the package.json
config option from jest everything should just work™.
If you are using a separate config file for jest using the --config
option you have to point this plugin to it, too (in your .eslintrc):
"settings": {
"import/resolver": {
"jest": {
"jestConfigFile": "./jest.conf.json"
}
}
}
That's it!
If you want to ensure that this resolver only applies to your test files, you can use ESLint's overrides
configuration option:
"overrides": [
{
"files": ["**/__tests__/**/*.js"],
"settings": {
"import/resolver": {
"jest": {
"jestConfigFile": "./jest.conf.json"
}
}
}
}
]
It will only resolve the modules in your test files that you specified via testRegex
or testMatch
in your jest config.
Create issues in this repo or get active yourself:
yarn test # npm test works, too
MIT
FAQs
🃏 Jest import resolution plugin for eslint-plugin-import
The npm package eslint-import-resolver-jest receives a total of 99,719 weekly downloads. As such, eslint-import-resolver-jest popularity was classified as popular.
We found that eslint-import-resolver-jest demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.