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.
Report unused ES6 imports in JS / JSX files. Supports output of vim commands that highlight all unused imports. unused
exits with code 1 when unused imports were found.
Sample output:
$ cat test.js
import foo from 'bar';
import { foo as fooz } from 'bar';
//fooz.execute(foo);
//foo.fooz();
fooz.foo();
$ unused test.js
foo (test.js 1:7)
total 1
There is also a raw mode which outputs json:
$ unused --raw=true test.js
[ { start: { line: 1, column: 7 },
end: { line: 1, column: 10 },
name: 'foo' } ]
Vim output mode:
$ unused -v true test.js
:call matchadd('Error', '\%1l\%<11v.\%>8v')
Install via npm:
npm install -g unused-es6
Add the following to your ~/.vimrc file:
"" Highlight unused imports, first saves, clears previous matches
nnoremap <leader>ji :w<CR>:call clearmatches()<CR>:let cmd = system('unused -v true ' . expand('%'))<CR>:exec cmd<CR>
Press <leader>ji
to highlight all unused imports in your current file.
FAQs
Check for unused ES6 module imports.
The npm package unused-es6 receives a total of 1 weekly downloads. As such, unused-es6 popularity was classified as not popular.
We found that unused-es6 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.