Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@hirasaki/eslint-plugin-coding-rules
Advanced tools
eslint plugin for making coding rules.
npm install --save-dev @hirasaki1985/eslint-plugin-coding-rules
Then, in your .eslintrc.json
{
"plugins": ["coding-rules"],
}
Finally, enable rules that you would like to use.
"rules": {
"no-use-specific-imports": [
"error", [
{
filePath: [
"**/components/**",
],
importName: ["react-redux", "**/stores"],
},
{
filePath: [
"**/pages/**",
],
importName: ["**/*Service", "**/ServiceFactory"],
message: "'{{importSource}}'からは'{{importFrom}}'をインポートすることはできません。",
},
]
]
}
Disallow specific imports from specific dirs or source files.
format is
{
filePath: string | string[],
importName: string | string[],
message?: string
}[]
key | types | description |
---|---|---|
filePath | string or string[] | Enter paths where the target file is located. |
importName | string or string[] | Enter the name of the libraries for which import is prohibited. |
message | string | custom error message. |
key | description |
---|---|
{{importSource}} | replaces the source file path. |
{{importFrom}} | replaces the import name. |
"rules": {
"no-use-specific-imports": [
'error',
[
{
filePath: [
"**/components/**",
],
importName: ["react-redux", "**/stores"],
},
{
filePath: [
"**/pages/**",
],
importName: ["**/*Service", "**/ServiceFactory"],
message: "'{{importSource}}'からは'{{importFrom}}'をインポートすることはできません。",
},
]
]
}
Files with paths that match filePath
will not be able to import the library specified by importName
.
components/atoms/ButtonAtom.tsx
can not import react-redux
or **/stores
.pages/MainPage.tsx
can not import **/Service
or **/ServiceFactory
.**/components/atoms/**
, components/moleculres/**
, **/components/organisms/**
can not import redux directly.**/components/atoms/**
, components/moleculres/**
, **/components/organisms/**
, **/pages/**
, can not import service files directly.Control the data processing flow by preventing direct import.
react sample code is here sample code
FAQs
eslint plugin for making coding rules.
The npm package @hirasaki/eslint-plugin-coding-rules receives a total of 0 weekly downloads. As such, @hirasaki/eslint-plugin-coding-rules popularity was classified as not popular.
We found that @hirasaki/eslint-plugin-coding-rules 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.