
Research
Namastex.ai npm Packages Hit with TeamPCP-Style CanisterWorm Malware
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.
eslint-plugin-use-decorator
Advanced tools
This is a custom plugin for eslint which enforces the use of decorators on methods.
This is a custom plugin for eslint which enforces the use of decorators on methods.
This only works with the @typescript-eslint plugin
npm install --save-dev eslint-plugin-use-decorator
Add this to your .eslintrc
// .eslintrc
{
"plugins": ["use-decorator"],
"rules": {
"use-decorator/use-decorator": [1, {
"params": [
{
"name": "assertParameter",
"public": true
}
],
"methods": [
{
"name": "assert",
"public": true
},
{
"name": "errorcatch",
"async": true,
"private": true
}
],
"class": [
{
"superClass": ["Vue", "Mixins"],
"name": "Component"
},
]
}]
}
}
Now methods and its parameters are checked for their decorators. Above rule would enforce following custom decorators:
class SomeClass {
@assert
someMethod(
@assertParameter
someParameter: number
): number {
return someParameter;
}
@errorcatch
private async somePrivateAsyncMethod(
someParameter: number
): Promise<number> {
return someParameter;
}
/**
* This one does not need a decorator, because its only async.
* It would need to be private as well for the linting to take effect.
*/
async someAsyncMethod(
someParameter: number
): Promise<number> {
return someParameter;
}
}
The options object looks like this:
{
"params": [
{
"name": "string",
"private?": "boolean", // default: false
"public?": "boolean", // default: false
"async?": "boolean", // default: false,
"static?": "boolean" // default: false
}
],
"methods": [
{
"name": "assert",
"private?": "boolean", // default: false
"public?": "boolean", // default: false
"async?": "boolean", // default: false
"static?": "boolean" // default: false
}
]
}
FAQs
This is a custom plugin for eslint which enforces the use of decorators on methods.
The npm package eslint-plugin-use-decorator receives a total of 5,953 weekly downloads. As such, eslint-plugin-use-decorator popularity was classified as popular.
We found that eslint-plugin-use-decorator 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.

Research
Malicious Namastex.ai npm packages appear to replicate TeamPCP-style Canister Worm tradecraft, including exfiltration and self-propagation.

Product
Explore exportable charts for vulnerabilities, dependencies, and usage with Reports, Socket’s new extensible reporting framework.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.