Security News
cURL Project and Go Security Teams Reject CVSS as Broken
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
@panbenson/suppress-eslint-errors
Advanced tools
A codemod that suppresses existing violations of eslint rules.
Have you ever tried to turn on a new eslint rule only to be discouraged by hundreds or thousands of errors in an existing codebase? So have we.
Sometimes, there isn't a great business case for updating all of the existing (working!) code, especially in a larger, legacy codebase.
For those times, suppress-eslint-errors
has you covered.
suppress-eslint-errors
is a codemod for jscodeshift that runs eslint against your existing code.
For each eslint error it finds, it adds a little snippet:
// TODO: Fix this the next time the file is edited.
// eslint-disable-next-line cool-new-rule
This way, you can get the benefits of the rule in new code without having to immediately work through a huge backlog.
suppress-eslint-errors
comes with a wrapper script so that you can call it directly without installing anything extra:
npx suppress-eslint-errors [jscodeshift options] PATH...
The wrapper will call jscodeshift
with the transformer and any other arguments that you pass to it.
If it detects a .gitignore
in the local directory, it will also specify that as the --ignore-config
.
suppress-eslint-errors
must be used with a locally installed copy of eslint
.
If it can't find one, it will bail out early.
NOTE: jscodeshift
has some bugs with respect to how it handles .gitignore
files that sometimes causes it to ignore all files.
If this tool detects that your .gitignore
contains problematic patterns, the --ignore-config
option will be skipped.
In some cases, the code produced by this codemod will make some unfortunate indentation decisions. Be sure to re-run any code formatting tools you use before committing!
--message: Sets the comment to add above eslint-disable-next-line comments.
--rules: Comma-separated list of ESLint rule IDs to disable. When specified, violations of rules not in this set will be left in place.
Suppress all errors in the index.js
file, using a custom comment:
npx suppress-eslint-errors ./index.js --message="TODO: Issue #123"
Suppress violations of the eqeqeq
and @typescript-eslint/no-explicit-any
rules in .ts and .tsx files in the src
directory:
npx suppress-eslint-errors ./src --extensions=ts,tsx --parser=tsx --rules=eqeqeq,@typescript-eslint/no-explicit-any
Like the name of the tool says, this only suppresses eslint errors.
If you have warnings that you'd like to suppress, change your eslint config to turn them into errors before running the tool or specify the rules using the --rules
flag.
Definitely not. PRs are welcome for any edge cases that you encounter.
FAQs
A codemod that suppresses existing violations of eslint rules.
The npm package @panbenson/suppress-eslint-errors receives a total of 4 weekly downloads. As such, @panbenson/suppress-eslint-errors popularity was classified as not popular.
We found that @panbenson/suppress-eslint-errors 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.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.