New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-vest

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-vest

Eslint plugin for vest validations.

  • 0.1.3
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

eslint-plugin-vest

Eslint plugin for vest validations.

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-vest:

$ npm install eslint-plugin-vest --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-vest globally.

Usage

Add vest to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
  "plugins": ["vest"]
}

Then configure the rules you want to use under the rules section.

{
  "rules": {
    "exclude-before-test": 2,
    "hook-scope": 2
  }
}

Supported rules

exclude-before-test

This rule prevents you from calling the vest.only() and vest.skip() hooks after your test runs, improving performance and preventing unexpected behavior in async tests.

  • Bad code example 🚨
validate('MyForm', () => {
  test('fieldName1', 'message', () => {
    // ...
  });

  test('fieldName2', 'message', () => {
    // ...
  });

  vest.only('fieldName2'); // 🚨Should be called before test()
});
  • Good code example ✅
validate('MyForm', () => {
  vest.only();

  test('fieldName', 'message', () => {
    // ...
  });
});

hook-scope

Makes sure you only call vest hooks from the scope they are allowed to run from.

  • Bad code examples 🚨
validate('MyForm', () => {
  vest.warn(); // 🚨Should be called inside test()

  test('fieldName1', 'message', () => {
    // ...
  });

  test('fieldName2', 'message', () => {
    vest.only('fieldName2'); // 🚨Should be called inside validate()
  });
});
  • Good code examples ✅
validate('MyForm', () => {
  vest.only('fieldName2');

  test('fieldName1', 'message', () => {
    vest.warn();
    // ...
  });

  test('fieldName2', 'message', () => {});
});

Keywords

FAQs

Package last updated on 20 Jun 2020

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