0.0.1 • Published 7 years ago

eslint-plugin-cleanjs v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

eslint-plugin-cleanjs Build Status

ESLint rules for functional programming

Install

$ npm install --save-dev eslint eslint-plugin-cleanjs

Usage

Configure it in package.json.

{
  "name": "my-awesome-project",
  "eslintConfig": {
    "env": {
      "es6": true
    },
    "plugins": [
      "cleanjs"
    ],
    "rules": {
      "cleanjs/explicit-return": "off",
      "cleanjs/must-return": "error",
      "cleanjs/no-arguments": "error",
      "cleanjs/no-class": "error",
      "cleanjs/no-delete": "error",
      "cleanjs/no-events": "error",
      "cleanjs/no-exceptions": "off",
      "cleanjs/no-exports": "off",
      "cleanjs/no-function-expressions": "off",
      "cleanjs/no-get-set": "error",
      "cleanjs/no-ifs": "error",
      "cleanjs/no-imports": "off",
      "cleanjs/no-instanceofs": "error",
      "cleanjs/no-let": "error",
      "cleanjs/no-loops": "error",
      "cleanjs/no-mutating-assign": "error",
      "cleanjs/no-mutating-methods": "error",
      "cleanjs/no-mutation": "error",
      "cleanjs/no-new": "error",
      "cleanjs/no-nil": [
        "error",
        {
          "explicitReturn": false
        }
      ],
      "cleanjs/no-nulls": "off",
      "cleanjs/no-proxy": "error",
      "cleanjs/no-reassigns": "off",
      "cleanjs/no-rest-parameters": "error",
      "cleanjs/no-switches": "off",
      "cleanjs/no-this": "error",
      "cleanjs/no-throw": "error",
      "cleanjs/no-typeofs": "off",
      "cleanjs/no-undefined": "off",
      "cleanjs/no-unused-expression": "error",
      "cleanjs/no-valueof-field": "error",
      "cleanjs/no-variable-declarations": "off",
      "no-var": "error",
      "prefer-spread": "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": [
      "cleanjs"
    ],
    "extends": "plugin:cleanjs/recommended"
  }
}

See ESLint documentation for more information about extending configuration files.

Thanks

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