1.0.1 • Published 6 years ago

@jesterxl/eslint-plugin-fp-jxl v1.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

What

ESLint rules for functional programming.

NOTE: This is a fork from https://github.com/jfmengels/eslint-plugin-fp. I looked at the 33 forks at the time and none were up to date. So, I forked it, merged in 2 of the outstanding PR's, and added some missing features (allow class constructors, using classes if you extend React.Component, switch statements that have a default with a return value don't violate fp/no-nil, etc).

Install

$ npm install --save-dev eslint @jesterxl/eslint-plugin-fp-jxl

Usage

Configure it in package.json.

{
  "name": "my-awesome-project",
  "eslintConfig": {
    "env": {
      "es6": true
    },
    "plugins": [
      "fp"
    ],
    "rules": {
      "fp/explicit-return": "off",
      "fp/must-return": "off",
      "fp/no-arguments": "error",
      "fp/no-class": "error",
      "fp/no-delete": "error",
      "fp/no-events": "error",
      "fp/no-exceptions": "off",
      "fp/no-exports": "off",
      "fp/no-function-expressions": "off",
      "fp/no-get-set": "error",
      "fp/no-ifs": "off",
      "fp/no-imports": "off",
      "fp/no-instanceofs": "off",
      "fp/no-let": "error",
      "fp/no-loops": "error",
      "fp/no-mutating-assign": "error",
      "fp/no-mutating-methods": "error",
      "fp/no-mutation": "error",
      "fp/no-new": "off",
      "fp/no-nil": "error",
      "fp/no-nulls": "off",
      "fp/no-proxy": "error",
      "fp/no-reassigns": "off",
      "fp/no-rest-parameters": "error",
      "fp/no-switches": "off",
      "fp/no-this": "error",
      "fp/no-throw": "error",
      "fp/no-typeofs": "off",
      "fp/no-undefined": "off",
      "fp/no-unused-expression": "error",
      "fp/no-valueof-field": "error",
      "fp/no-variable-declarations": "off",
      "no-var": "error"
    }
  }
}

Rules

Recommended configuration

This plugin exports a recommended configuration that enforces good practices.

To enable this configuration, use the extends property in your package.json.

{
  "name": "my-awesome-project",
  "eslintConfig": {
    "plugins": [
      "fp"
    ],
    "extends": "plugin:fp-jxl/recommended"
  }
}

See ESLint documentation for more information about extending configuration files.

MIT © Jeroen Engels MIT © Ivan Dmitriev MIT © Thomas Grainger MIT © Jesse Warden