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

cypress-eslint

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

cypress-eslint

Cypress plugin that will run linting via ESLint on your spec files as they are loaded and display errors in console

  • 1.1.0
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

cypress-eslint

Cypress plugin that will run linting via ESLint on your spec files and display linting errors in your terminal.

This uses the file:preprocessor event which means it will lint files as they are loaded by Cypress. If you are running your full suite of tests, all the spec files will be linted, but if you are only running tests on a specific test suite then only the files that it loads will be linted.

This will use the .eslintrc file in your project root combined with the .eslintrc file in your Cypress directory (if you have one). This means you can easily set custom rules just for your Cypress spec files.

Install

# npm
npm i cypress-eslint --save-dev

# yarn
yarn add cypress-eslint --dev

Usage

If you are not currently using another plugin on the file:preprocessor event

// cypress/plugins/index.js
const cypressEslint = require('cypress-eslint');

module.exports = (on) => {
    on('file:preprocessor', cypressEslint());
};

If you are using another plugin on the file:preprocessor event, pass this in as a parameter to cypress eslint

// cypress/plugins/index.js

const cypressEslint = require('cypress-eslint');
const babelEsX = require('cypress-babel-esx');

module.exports = (on) => {
    on('file:preprocessor', cypressEslint(babelEsX()));
};

Keywords

FAQs

Package last updated on 10 Apr 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