
Research
Security News
Lazarus Strikes npm Again with New Wave of Malicious Packages
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
@gorazdo/eslint-plugin-preact
Advanced tools
You'll first need to install ESLint:
npm i eslint --save-dev
# yarn add eslint -D
Next, install @gorazdo/eslint-plugin-preact
:
npm install @gorazdo/eslint-plugin-preact --save-dev
# yarn add @gorazdo/eslint-plugin-preact -D
Add @gorazdo/preact
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:
{
"plugins": [
"@gorazdo/preact"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"@gorazdo/preact/forbid-render-arguments": 2,
"@gorazdo/preact/prefer-classname": 2
}
}
Preact allows you to consume props
and state
in Class-based components directly from the arguments of render()
method like this: render(props, state)
.
Although, it is possible it has downsides:
render(props: MyProps, state: MyState)
;this.props
.Preact allows you to use class
as JSX Attribute. With preact/compat
it is possible to use className
.
There is a great discussion why Preact uses class
and React className
. Although, consider the following theses:
class
is still a reserved word in Javascript, which means that the syntax is limited;className
has a wider usage over class
.FAQs
Eslint rules for Preact in compat mode
We found that @gorazdo/eslint-plugin-preact 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
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.
Security News
Opengrep continues building momentum with the alpha release of its Playground tool, demonstrating the project's rapid evolution just two months after its initial launch.