{ "parser": "babel-eslint", "env": { "browser": true, "node": true, "es6": true, "mocha": true }, "ecmaFeatures": { "modules": true, "classes": true, "jsx": true }, "plugins": [ "react" ], "rules": { // http://eslint.org/docs/rules/ // Possible errors "no-cond-assign": [2, "always"], // Disallow assignment in conditional expressions "no-console": 0, // Allow use of console "no-constant-condition": 1, // Disallow use of constant expressions in conditions "no-control-regex": 2, // Disallow Controls Characters in Regular Expressions "no-debugger": 1, // Disallow use of debugger "no-dupe-keys": 2, // Disallow duplicate keys "no-duplicate-case": 2, // Disallow a duplicate case label "no-empty-character-class": 2, // Disallow empty character classes in regular expressions "no-empty": 1, // Disallow empty statements "no-ex-assign": 1, // Disallow assigning to the exception in a catch block "no-extra-boolean-cast": 2, // Disallow double-negation boolean casts in a boolean context "no-extra-semi": 2, // Disallow unnecessary semicolons "no-func-assign": 2, // Disallow overwriting functions written as function declarations "no-inner-declarations": [2, "functions"], "no-invalid-regexp": 2, // Disallow invalid regular expression strings in the RegExp constructor "no-irregular-whitespace": 2, // Disallow irregular whitespace outside of strings and comments "no-negated-in-lhs": 2, // Disallow negation of the left operand of an in expression "no-regex-spaces": 2, // Disallow multiple spaces in a regular expression literal "no-sparse-arrays": 2, // Disallow sparse arrays "no-unreachable": 1, // Disallow unreachable statements after a return, throw, continue, or break statement "use-isnan": 2, // Disallow comparisons with the value NaN "valid-jsdoc": [1, { // Ensure JSDoc comments are valid "requireReturnDescription": false }], "valid-typeof": 2, // Ensure that the results of typeof are compared against a valid string "no-unexpected-multiline": 1, // Avoid code that looks like two expressions but is actually one // Best practices "block-scoped-var": 1, // Treat var statements as if they were block scoped "consistent-return": 1, // Require return statements to either always or never specify values "curly": [2, "all"], // Require curly braces for all control statements "dot-notation": 1, // encourages use of dot notation whenever possible "eqeqeq": [2, "allow-null"], // Require the use of === and !== "no-alert": 1, // Disallow the use of alert, confirm, and prompt "no-eval": 2, // Disallow use of eval() "no-extend-native": 2, // Disallow adding to native types "no-extra-bind": 2, // Disallow unnecessary function binding "no-fallthrough": 0, // Disallow fallthrough of case statements "no-implicit-coercion": [2, { // Disallow the type conversion with shorter notations for numbers and strings "boolean": false, "number": true, "string": true }], "no-implied-eval": 2, // Disallow use of eval()-like methods "no-labels": 2, // Disallow use of labeled statements "no-loop-func": 2, // Disallow creation of functions within loops "no-multi-spaces": [1, {"exceptions": { // Disallow use of multiple spaces "Property": false }}], "no-multi-str": 2, // Disallow use of multiline strings "no-native-reassign": 2, // Disallow reassignments of native objects "no-new-func": 2, // Disallow use of new operator for Function object "no-new-wrappers": 1, // Disallows creating new instances of String,Number, and Boolean "no-new": 0, // Allow use of new operator when not part of the assignment or comparison "no-octal": 2, // Disallow use of octal literals "no-redeclare": 2, // Disallow declaring the same variable more than once "no-return-assign": 2, // Disallow use of assignment in return statement "no-self-compare": 2, // Disallow comparisons where both sides are exactly the same "no-sequences": 1, // Disallow use of comma operator "no-throw-literal": 2, // Restrict what can be thrown as an exception "no-unused-expressions": 1, // Disallow usage of expressions in statement position "no-void": 2, // Disallow use of void operator (off by default) "no-with": 2, // Disallow use of the with statement "prefer-spread": 2, // Suggest using the spread operator instead of .apply() "radix": 2, // Require use of the second argument for parseInt() "wrap-iife": [1, "outside"], // Require immediate function invocation to be wrapped in parentheses "yoda": [2, "never", { // Disallow Yoda conditions "exceptRange": true }], // Variables "no-delete-var": 2, // Disallow deletion of variables "no-shadow-restricted-names": 2, // Disallow shadowing of names such as arguments "no-shadow": [1, {"hoist": "functions"}], // Disallow declaration of variables already declared in the outer scope "no-undef": 2, // Disallow use of undeclared variables unless mentioned in a /*global */ block "no-unused-vars": 1, // Disallow declaration of variables that are not used in the code // Stylistic issues "array-bracket-spacing": [1, "never"], // Disallow spaces inside of brackets "brace-style": [1, "stroustrup", { // Stroustrup brace style (else on a separate line) "allowSingleLine": false }], "camelcase": [1, { // Require camel case names except properties "properties": "never" }], "comma-spacing": [1, { // No space before comma, space after coma "before": false, "after": true }], "comma-style": [1, "last"], // Do not start line with comma "computed-property-spacing": [1, "never"], // Disallow padding inside computed properties "eol-last": 0, // Do not require file to end with single newline "indent": [1, "tab", { // Tabs indentation "SwitchCase": 1 }], "key-spacing": [2, { // No space before colon, space after colon "beforeColon": false, "afterColon": true }], "lines-around-comment": 0, // Do not require new line before comments "linebreak-style": [2, "unix"], // Unix linebreaks "max-nested-callbacks": [1, 3], // No more than 3 levels of nested callbacks "new-cap": 0, // Do not require capital letter for constructors "new-parens": 2, // Disallow the omission of parentheses when invoking a constructor with no arguments "no-lonely-if": 1, // Disallow if as the only statement in an else block "no-mixed-spaces-and-tabs": 1, // Disallow mixed spaces and tabs for indentation "no-multiple-empty-lines": [1, { // No more than 2 empty lines "max": 2 }], "no-nested-ternary": 1, // Disallow nested ternary expressions "no-new-object": 1, // Disallow use of the Object constructor "no-spaced-func": 1, // Disallow space between function identifier and application "no-trailing-spaces": 1, // Disallow trailing whitespace at the end of lines "no-underscore-dangle": 0, // Allow dangling underscores in identifiers "no-unneeded-ternary": 1, // Disallow the use of Boolean literals in conditional expressions "no-useless-concat": 1, // Disallow unncessary concatenation of strings "operator-assignment": [1, "always"], // Require assignment operator shorthand where possible "operator-linebreak": [1, "after"], // Operators should be placed before line breaks "quote-props": 0, // Do not require quotes around object literal property names "quotes": [1, "single", "avoid-escape"], // Single quotes "semi-spacing": [1, { // No space before semicolon, space after semicolon "before": false, "after": true }], "semi": [2, "always"], // Require use of semicolons "space-after-keywords": [1, "always"], // Require space after keywords (if, else, etc.) "space-before-blocks": [1, "always"], // Require space after blocks "space-before-function-paren": [1, { // Disallow space before function opening parenthesis "anonymous": "never", "named": "never" }], "space-in-parens": [1, "never"], // Disallow spaces inside parentheses "space-infix-ops": 1, // Require spaces around operators "space-return-throw-case": 1, // Require space after return, throw, and case "space-unary-ops": [1, { // Require spaces before/after unary operators "words": true, "nonwords": false }], "spaced-comment": [1, "always"], // Require space immediately following the // or /* in a comment // ECMAScript 6 "arrow-spacing": [2, { // Require space before and after arrow function's arrow "before": true, "after": true }], "jsx-quotes": [1, "prefer-double"], "no-var": 0, // Do not require let or const instead of var (becau // React: https://github.com/yannickcr/eslint-plugin-react "react/display-name": 0, "react/jsx-boolean-value": [2, "never"], "react/jsx-closing-bracket-location": [1, { "location": "tag-aligned" }], "react/jsx-curly-spacing": [1, "never"], "react/jsx-indent-props": [1, 4], "react/jsx-no-duplicate-props": 2, "react/jsx-no-undef": 2, "react/jsx-sort-prop-types": 0, "react/jsx-sort-props": 0, "react/jsx-uses-react": 1, "react/jsx-uses-vars": 1, "react/no-danger": 0, "react/no-did-mount-set-state": 1, "react/no-did-update-set-state": 1, "react/no-multi-comp": 1, "react/no-unknown-property": 1, "react/prop-types": [1, { "ignore": [ "actions", "dispatch", "state" ] }], "react/require-extension": 0, "react/self-closing-comp": 1, // "react/sort-comp": [1, { // "order": [ // "/^handle.+$/", // "lifecycle", // "everything-else", // "/^render.+$/", // "render" // ], // }], "react/wrap-multilines": 1 }, "globals": { "describe": false, "it": false, "expect": false, "expectReactShallow": false } }