
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
add-eslint-comment
Advanced tools
Every time when I trying to add ESLint to an old project, it's painful to fix errors like eqeqeq
or no-var
.
One way is to enable these rules and add eslint comment to the old files to prevent new files breaking these rules.
This is what this tool can do.
Add ESLint comment per file according to the ESLint result.
Before:
var foo;
if (foo == 1) {
alert(foo);
}
After:
/* eslint no-var:0 */
/* eslint no-alert:0 */
/* eslint eqeqeq:0 */
var foo;
if (foo == 1) {
alert(foo);
}
npm install add-eslint-comment -g
eslint -f json src > eslint-result.json
This will lint your src
directory, formatter the result to json, and output into eslint-result.json
file.
Checkout the documentation for more details.
add-eslint-comment -j eslint-result.json
Have fun with add-eslint-comment!
FAQs
Add ESLint comment per file according to the ESLint result.
We found that add-eslint-comment 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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.