🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

eslint-plugin-wix-editor

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-wix-editor

Wix's editor group's custom ESLint rules

3.3.0
latest
Source
npm
Version published
Weekly downloads
417
181.76%
Maintainers
3
Weekly downloads
 
Created
Source

ESLint-plugin-wix-editor

NPM version Build Status Dependency Status Dependency Status

Wix's editor group's custom ESLint rules

Installation

Install ESLint and eslint-plugin-wix-editor into your project.

$ npm install --save-dev eslint eslint-plugin-wix-editor

Configuration

Add plugins section and specify eslint-plugin-wix-editor as a plugin into your .eslintrc:

{
  "plugins": ["wix-editor"]
}

Finally, enable all of the rules that you would like to use:

{
  "rules": {
    "wix-editor/no-instanceof-array": 2,
    "wix-editor/no-not-not": 2,
    "wix-editor/no-unneeded-match": 2,
    "wix-editor/prefer-filter": 2,
    "wix-editor/prefer-ternary": 2,
    "wix-editor/return-boolean": 2,
    "wix-editor/simplify-boolean-expression": 2
  }
}

Rules

  • no-instanceof-array: Prevent use of function definition inside boolean expression.
  • no-not-not: Prevent casting to boolean with !!
  • no-unneeded-match: Prevent using str.match(rgx) as a boolean value.
  • prefer-filter: Prevent forEach statements that only include an if statement.
  • prefer-ternary: Prevent use of if-else statements that only include assignment to the same variable.
  • return-boolean: Prevent use of if-else for returning boolean values.
  • simplify-boolean-expression: Prevent use of function definition inside boolean expression.

Contributions

Contributions in the form of issues and pull requests are welcome.

Before creating a pull request, please make sure that:

  • Each of your commits is needed and makes sense. Squash/rebase as needed.
  • Lint and tests pass. Check with npm test.
  • Coverage percentage has not dropped.

To begin:

git clone git@github.com:wix/eslint-plugin-wix-editor.git
cd eslint-plugin-wix-editor
npm i
npm test

License

eslint-plugin-wix-editor is licensed under the MIT License.

Keywords

wix

FAQs

Package last updated on 08 Mar 2021

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