eslint-plugin-prodperfectqa

0.3.0 • Public • Published

eslint-plugin-prodperfectqa

ESLint plugin with rules for ProdPerfect customer test suites

Build Status

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-prodperfectqa:

$ npm install "https://github.com/ProdPerfect/eslint-plugin-prodperfectqa" --save-dev

Usage

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

{
  "plugins": ["prodperfectqa"]
}

To use the recommended configuration for customer test suites, add plugin:prodperfectqa/recommended to the extends

{
  "extends": ["plugin:prodperfectqa/recommended"]
}

Alternately, configure the specific rules you want to use under the rules section.

{
  "rules": {
    "prodperfectqa/no-only": "error",
    "prodperfectqa/no-skip": "warn",
    "prodperfectqa/no-debug": "error"
  }
}

Supported Rules

Name ✔️ 🛠 Description
no-debug ✔️ Prevent use of .debug method on tests and fixtures
no-native-test ✔️ Prevent use of TestCafe's native test function
no-only ✔️ Prevent use of .only method on tests and fixtures
no-p2-tracking ✔️ Prevent use of deprecated methods setProdPerfectTracking and setProdPerfectCookie
no-skip ✔️ Prevent use of .skip method on tests and fixtures
valid-test-name ✔️ Validate test name
valid-test-metadata ✔️ Validate test metadata

Best practices

The rules set for best practices are based off eslint and unicorn recommended rules:

Override rules by configuring specific rules in your eslint configuration file

{
  "rules": {
    "no-undef": "off",
    "semi": "warn",
    "unicorn/filename-case": ["error", { case: "camelCase" }],
  }
}

Package Sidebar

Install

npm i eslint-plugin-prodperfectqa

Weekly Downloads

25

Version

0.3.0

License

NONE

Unpacked Size

26.8 kB

Total Files

19

Last publish

Collaborators

  • prodperfectqa