ManageIQ/manageiq-ui-classic

View on GitHub
.eslintrc.json

Summary

Maintainability
Test Coverage
{
  "root": true,
  "env": {
    "browser": true,
    "jquery": true
  },
  "parser": "babel-eslint",
  "parserOptions": {
    "ecmaVersion": 5,
    "sourceType": "script",
    "ecmaFeatures": {
      "globalReturn": false,
      "impliedStrict": false
    }
  },

  "plugins": [],
  "extends": [],

  "globals": {
    "sendDataWithRx": false, // local: miq_observable.js
    "listenToRx": true, // local: miq_observable.js
    "vanillaJsAPI": false, // local: http_api/api.js - deprecated
    "API": false, // local: http_api/api.js
    "ManageIQ": false, // local: mig_global.js
    "Promise": false, // modern browser / npm: es6-shim
    "_": false, // npm: lodash
    "__": false, // local: i18n.js
    "angular": false, // npm: angular
    "c3": false, // npm: c3
    "d3": false, // npm: d3
    "http": false, // local: http_api/http.js
    "i18n": false, // gem: gettext_i18n_rails_js
    "moment": false, // npm: moment
    "numeral": false, // npm: numeral
    "sprintf": false, // npm: sprintf-js
    "add_flash": true, // local miq_flash
    "miq_bootstrap": true // local miq_angular_application
  },

  "rules": {
    // {{{ this section comes from eslint-config-airbnb-es5 1.0.9
    "strict": 0,
    "no-shadow": 0,
    "no-shadow-restricted-names": 2,
    "no-cond-assign": [2, "always"],
    "no-console": 1,
    "no-constant-condition": 1,
    "no-dupe-keys": 2,
    "no-duplicate-case": 2,
    "no-empty": 2,
    "no-empty-character-class": 2,
    "no-ex-assign": 2,
    "no-extra-semi": 2,
    "no-func-assign": 2,
    "no-inner-declarations": 2,
    "no-invalid-regexp": 2,
    "no-irregular-whitespace": 2,
    "no-negated-in-lhs": 2,
    "no-new-require": 2,
    "no-obj-calls": 2,
    "no-path-concat": 2,
    "no-regex-spaces": 2,
    "no-sparse-arrays": 2,
    "no-unreachable": 2,
    "use-isnan": 2,
    "valid-jsdoc": 2,
    "valid-typeof": [2, {
      "requireStringLiterals": true
    }],
    "dot-notation": [2, {
      "allowKeywords": true
    }],
    "guard-for-in": 2,
    "no-caller": 2,
    "no-div-regex": 2,
    "no-labels": 2,
    "no-eval": 2,
    "no-extend-native": 2,
    "no-extra-bind": 2,
    "no-floating-decimal": 2,
    "no-implied-eval": 2,
    "no-lone-blocks": 2,
    "no-loop-func": 2,
    "no-multi-str": 2,
    "no-native-reassign": 2,
    "no-new": 2,
    "no-new-func": 2,
    "no-new-wrappers": 2,
    "no-octal": 2,
    "no-octal-escape": 2,
    "no-process-exit": 2,
    "no-proto": 2,
    "no-redeclare": 2,
    "no-return-assign": 2,
    "no-script-url": 2,
    "no-self-compare": 2,
    "no-sequences": 2,
    "no-throw-literal": 2,
    "no-undef-init": 2,
    "no-undefined": 1,
    "no-with": 2,
    "handle-callback-err": 1,
    "radix": 2,
    "wrap-iife": [2, "any"],
    "yoda": 2,
    "brace-style": [2, "1tbs", {
      "allowSingleLine": false
    }],
    "comma-spacing": [2, {
      "before": false,
      "after": true
    }],
    "comma-style": [2, "last"],
    "eol-last": 2,
    "key-spacing": [2, {
      "beforeColon": false,
      "afterColon": true
    }],
    "new-cap": [2, {
      "newIsCap": true
    }],
    "new-parens": 2,
    "no-array-constructor": 2,
    "no-lonely-if": 1,
    "no-multiple-empty-lines": [2, {
      "max": 2
    }],
    "no-nested-ternary": 2,
    "no-new-object": 2,
    "no-spaced-func": 2,
    "no-trailing-spaces": 2,
    "no-extra-parens": [2, "functions"],
    "one-var": [2, "never"],
    "padded-blocks": [2, "never"],
    "semi": [2, "always"],
    "semi-spacing": [2, {
      "before": false,
      "after": true
    }],
    "keyword-spacing": 2,
    "space-before-blocks": 2,
    "space-before-function-paren": [2, "never"],
    "space-infix-ops": 2,
    "spaced-comment": [2, "always",  {
      "exceptions": ["-", "+"],
      "markers": ["=", "!"]          // space here to support sprockets directives
    }],
    // }}} (except for removing the JSX rules, and anything we override)

    "indent": [ "error", 2, {
      "SwitchCase": 1,
      "VariableDeclarator": 1
    }],
    "consistent-return": 1,
    "default-case": 1,
    "vars-on-top": 0,
    "no-var": 0,
    "linebreak-style": [ "error", "unix" ],
    "comma-dangle": [ "warn", {
      "arrays": "always-multiline",
      "objects": "always-multiline",
      "imports": "always-multiline",
      "exports": "always-multiline",
      "functions": "only-multiline"
    }],
    "space-unary-ops": [ "error", {
      "words": true,
      "nonwords": false,
      "overrides": {
        "!": false
      }
    }],
    "no-unused-vars": [ "error", {
      "args": "after-used",
      "argsIgnorePattern": "^_",
      "vars": "local",
      "caughtErrors": "all",
      "caughtErrorsIgnorePattern": "^_"
    }],
    "no-alert": 2,
    "no-debugger": 2,
    "no-else-return": 1,
    "no-undef": [ "warn", {
      "typeof": true
    }],
    "eqeqeq": [ "error", "smart" ],
    "quotes": [ "warn", "single", {
      "avoidEscape": true,
      "allowTemplateLiterals": true
    }],
    "func-names": 0,
    "no-mixed-spaces-and-tabs": 2,
    "camelcase": 0,

    "curly": [ "warn", "all" ],
    "no-eq-null": 0,
    "no-param-reassign": [ "warn", {
      "props": false
    }],
    "no-fallthrough": [ "error", {
      "commentPattern": "fall.*through|pass"
    }],
    "no-use-before-define": [ "error", {
      "functions": false,
      "classes": true
    }]
  }
}