Wix's editor group's custom ESLint rules
Install ESLint and eslint-plugin-wix-editor into your project.
$ npm install --save-dev eslint eslint-plugin-wix-editor
plugins section and specify eslint-plugin-wix-editor as a plugin into your
Finally, enable all of the rules that you would like to use:
- 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
forEachstatements that only include an
- prefer-ternary: Prevent use of
if-elsestatements that only include assignment to the same variable.
- return-boolean: Prevent use of
if-elsefor returning boolean values.
- simplify-boolean-expression: Prevent use of function definition inside boolean expression.
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
- Coverage percentage has not dropped.
git clone firstname.lastname@example.org:wix/eslint-plugin-wix-editor.gitcd eslint-plugin-wix-editornpm inpm test
eslint-plugin-wix-editor is licensed under the MIT License.