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-plugin-command
Advanced tools
Comment-as-command for one-off codemod with ESLint.
https://github.com/antfu/eslint-plugin-command/assets/11247099/ec401a21-4081-42d0-8748-9d0376b7d501
ESLint Plugin Command is a special kind of ESLint plugin, that by default, does nothing. Instead of checking for code quality, it serves as a micro-codemod tool triggers by special comments on-demand, resuse the infrastructure of ESLint.
For example, one of the built-in commands, /// to-function
allows you to convert a single arrow function expression to a function declaration.
/// to-function
const foo = async <T>(msg: T): void => {
console.log(msg)
}
Will be transformed to this when you hit save with your editor or run eslint . --fix
. After executing the command, the comment will also be removed along with the transformation:
async function foo<T>(msg: T): void {
console.log(msg)
}
One more example that /// to-promis-all
converts a sequence of await
expressions to await Promise.all()
:
/// to-promise-all
const foo = await bar().then
const { get } = await import('lodash-es')
Will be transformed to:
const [
foo,
{ get },
] = await Promise.all([
bar(),
import('lodash-es'),
] as const)
Refer to the documentation for more details.
MIT License © 2024-PRESENT Anthony Fu
FAQs
Comment-as-command for one-off codemod with ESLint
The npm package eslint-plugin-command receives a total of 110,774 weekly downloads. As such, eslint-plugin-command popularity was classified as popular.
We found that eslint-plugin-command demonstrated a healthy version release cadence and project activity because the last version was released less than 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
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.