Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-hash-exempt

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-hash-exempt

ESlint rules to require/verify file hashes for disable directives

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

eslint-plugin-hash-exempt

This plugin supports exempting a file from linting based on a hash of its contents. This is useful for legacy code, or in cases where you may want to apply conflicting eslint standards to files from a scaffold or generator.

You break it, you buy it.

Once the content of the file changes, the exemption is invalidated. The hash will have to be updated, or the file corrected to current eslint standards. This can allow organizations to progressively update files without forcing a wholesale refactoring.

Installation

npm install --save-dev eslint-plugin-hash-exempt

** Note:** If you want to install ESLint globally, then the plugin must also be installed globally.

Usage

The rule to verify hashes is on by default. You may add further configuration in your .eslintrc.(yml|json|js):

---
plugins:
  - hash-exempt

rules:
  hash-exempt/no-hash-mismatch: [error, { hashRequired: true }]
  # etc...

Options

  • hashRequired: If this is false, only files that have a directive with hash will be verified. If it's true, any files with a directive at the top will require a hash. This is false by default.

Hash Creation

In order to insert hashed eslint directives in your files, run the command hash-exempt in your folder.

hash-exempt [--exempt-all] *.js

By default, hash-exempt will only insert directives into files that are currently failing lint.

Flags

  • --exempt-all: Insert a hashed eslint directive in all files matching the supplied glob, regardless of whether or not they contain lint errors.

FAQs

Package last updated on 29 Aug 2018

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc