2016-01-03 01:54:07 +05:30
|
|
|
{
|
|
|
|
"parser": "babel-eslint",
|
2016-11-30 12:18:47 +05:30
|
|
|
"parserOptions": {
|
|
|
|
"ecmaVersion": 2017,
|
|
|
|
"sourceType": "module"
|
|
|
|
},
|
|
|
|
|
2016-01-03 01:54:07 +05:30
|
|
|
"plugins": [
|
|
|
|
"react"
|
|
|
|
],
|
|
|
|
|
|
|
|
"env": {
|
2017-06-08 00:10:44 +05:30
|
|
|
"mocha": true, // needed for tests. Apply it globaly till eslint/selint#3611
|
2016-01-03 01:54:07 +05:30
|
|
|
"browser": true,
|
2016-06-04 14:47:06 +05:30
|
|
|
"commonjs": true,
|
2016-01-03 01:54:07 +05:30
|
|
|
"es6": true
|
|
|
|
},
|
|
|
|
|
|
|
|
"extends": "eslint:recommended",
|
|
|
|
|
|
|
|
// @see: http://eslint.org/docs/rules/
|
|
|
|
"rules": {
|
|
|
|
// possible errors (including eslint:recommended)
|
2016-06-10 10:36:21 +05:30
|
|
|
"valid-jsdoc": ["warn", {
|
|
|
|
"requireParamDescription": false,
|
|
|
|
"requireReturn": false,
|
|
|
|
"requireReturnDescription": false,
|
|
|
|
"prefer": {
|
|
|
|
"returns": "return"
|
|
|
|
},
|
|
|
|
"preferType": {
|
|
|
|
"String": "string",
|
|
|
|
"Object": "object",
|
|
|
|
"Number": "number",
|
|
|
|
"Function": "function"
|
|
|
|
}
|
|
|
|
}],
|
2016-01-03 01:54:07 +05:30
|
|
|
|
|
|
|
// best practice
|
2016-06-02 22:00:51 +05:30
|
|
|
"block-scoped-var": "error",
|
|
|
|
"curly": "error",
|
2017-04-12 00:55:27 +05:30
|
|
|
"default-case": "warn",
|
2016-06-02 22:00:51 +05:30
|
|
|
"dot-location": ["error", "property"],
|
|
|
|
"dot-notation": "error",
|
|
|
|
"eqeqeq": ["error", "smart"],
|
|
|
|
"no-alert": "error",
|
2017-06-13 01:02:59 +05:30
|
|
|
"no-console": "off",
|
2016-06-02 22:00:51 +05:30
|
|
|
"no-caller": "error",
|
|
|
|
"no-case-declarations": "error",
|
|
|
|
"no-div-regex": "error",
|
|
|
|
"no-else-return": "error",
|
|
|
|
"no-empty-pattern": "error",
|
|
|
|
"no-eq-null": "error",
|
|
|
|
"no-eval": "error",
|
|
|
|
"no-extend-native": "error",
|
|
|
|
"no-extra-bind": "warn",
|
|
|
|
"no-fallthrough": "error",
|
|
|
|
"no-floating-decimal": "warn",
|
|
|
|
"no-implied-eval": "error",
|
|
|
|
"no-invalid-this": "off",
|
|
|
|
"no-labels": "error",
|
|
|
|
"no-lone-blocks": "warn",
|
|
|
|
"no-loop-func": "error",
|
|
|
|
"no-multi-spaces": "error",
|
|
|
|
"no-multi-str": "error",
|
|
|
|
"no-native-reassign": "error",
|
|
|
|
"no-new-wrappers": "warn",
|
|
|
|
"no-new": "warn",
|
|
|
|
"no-octal-escape": "warn",
|
|
|
|
"no-octal": "error",
|
|
|
|
"no-proto": "error",
|
|
|
|
"no-redeclare": "warn",
|
|
|
|
"no-script-url": "error",
|
|
|
|
"no-self-compare": "error",
|
|
|
|
"no-sequences": "error",
|
|
|
|
"no-throw-literal": "error",
|
|
|
|
"no-unused-expressions": ["warn", {"allowShortCircuit": true, "allowTernary": true}],
|
|
|
|
"no-useless-call": "warn",
|
|
|
|
"no-useless-concat": "warn",
|
|
|
|
"no-void": "error",
|
|
|
|
"no-with": "error",
|
|
|
|
"radix": "error",
|
|
|
|
"wrap-iife": "error",
|
|
|
|
"yoda": "warn",
|
|
|
|
"no-constant-condition": "error",
|
2016-01-03 01:54:07 +05:30
|
|
|
|
|
|
|
// strict mode
|
2016-06-02 22:00:51 +05:30
|
|
|
"strict": ["warn", "never"], // babel все сделает за нас
|
2016-01-03 01:54:07 +05:30
|
|
|
|
|
|
|
// variables
|
2016-06-02 22:00:51 +05:30
|
|
|
"no-catch-shadow": "error",
|
|
|
|
"no-delete-var": "error",
|
|
|
|
"no-label-var": "error",
|
|
|
|
"no-shadow-restricted-names": "error",
|
|
|
|
"no-shadow": "off",
|
2016-07-26 10:09:56 +05:30
|
|
|
"no-undef-init": "error",
|
2016-06-02 22:00:51 +05:30
|
|
|
"no-undef": "error",
|
|
|
|
"no-use-before-define": ["warn", "nofunc"],
|
2017-04-12 00:48:27 +05:30
|
|
|
"no-restricted-globals": ["error",
|
|
|
|
"localStorage", "sessionStorage", // we have our own localStorage module
|
|
|
|
"event"
|
|
|
|
],
|
2016-01-03 01:54:07 +05:30
|
|
|
|
|
|
|
// CommonJS
|
2016-06-02 22:00:51 +05:30
|
|
|
"no-mixed-requires": "warn",
|
|
|
|
"no-path-concat": "warn",
|
2016-01-03 01:54:07 +05:30
|
|
|
|
|
|
|
// stylistic
|
2016-06-02 22:00:51 +05:30
|
|
|
"array-bracket-spacing": "error",
|
|
|
|
"block-spacing": ["error", "never"],
|
|
|
|
"brace-style": ["error", "1tbs", {"allowSingleLine": true}],
|
|
|
|
"comma-spacing": "error",
|
|
|
|
"comma-style": "error",
|
2016-06-04 14:47:06 +05:30
|
|
|
"comma-dangle": ["warn", "only-multiline"],
|
2016-06-02 22:00:51 +05:30
|
|
|
"computed-property-spacing": "error",
|
|
|
|
"consistent-this": ["error", "that"],
|
|
|
|
"camelcase": "warn",
|
|
|
|
"eol-last": "warn",
|
2017-06-13 01:02:59 +05:30
|
|
|
"id-length": ["error", {"min": 2, "exceptions": ["x", "y", "i", "k", "l", "m", "n", "$", "_"]}],
|
2016-06-02 22:00:51 +05:30
|
|
|
"indent": ["error", 4, {"SwitchCase": 1}],
|
|
|
|
"jsx-quotes": "error",
|
|
|
|
"key-spacing": ["error", {"mode": "minimum"}],
|
|
|
|
"linebreak-style": "error",
|
|
|
|
"max-depth": "error",
|
|
|
|
"new-cap": "error",
|
|
|
|
"new-parens": "error",
|
|
|
|
"no-array-constructor": "warn",
|
|
|
|
"no-bitwise": "warn",
|
|
|
|
"no-lonely-if": "error",
|
|
|
|
"no-negated-condition": "warn",
|
|
|
|
"no-nested-ternary": "error",
|
|
|
|
"no-new-object": "error",
|
|
|
|
"no-spaced-func": "error",
|
|
|
|
"no-trailing-spaces": "warn",
|
|
|
|
"no-unneeded-ternary": "warn",
|
|
|
|
"one-var": ["error", "never"],
|
|
|
|
"operator-assignment": ["warn", "always"],
|
|
|
|
"operator-linebreak": ["error", "before"],
|
|
|
|
"padded-blocks": ["warn", "never"],
|
|
|
|
"quote-props": ["warn", "as-needed"],
|
|
|
|
"quotes": ["warn", "single"],
|
|
|
|
"semi": "error",
|
|
|
|
"semi-spacing": "error",
|
|
|
|
"keyword-spacing": "warn",
|
|
|
|
"space-before-blocks": "error",
|
|
|
|
"space-before-function-paren": ["error", "never"],
|
|
|
|
"space-in-parens": "warn",
|
2017-04-12 00:55:27 +05:30
|
|
|
"space-infix-ops": "warn",
|
2016-06-02 22:00:51 +05:30
|
|
|
"space-unary-ops": "error",
|
|
|
|
"spaced-comment": "warn",
|
2016-01-03 01:54:07 +05:30
|
|
|
|
|
|
|
// es6
|
2017-06-13 01:02:59 +05:30
|
|
|
"arrow-body-style": "off",
|
2016-06-02 22:00:51 +05:30
|
|
|
"arrow-parens": "error",
|
|
|
|
"arrow-spacing": "error",
|
|
|
|
"constructor-super": "error",
|
|
|
|
"generator-star-spacing": "warn",
|
|
|
|
"no-class-assign": "error",
|
|
|
|
"no-const-assign": "error",
|
|
|
|
"no-dupe-class-members": "error",
|
|
|
|
"no-this-before-super": "error",
|
|
|
|
"no-var": "warn",
|
|
|
|
"object-shorthand": "warn",
|
|
|
|
"prefer-arrow-callback": "warn",
|
|
|
|
"prefer-const": "warn",
|
2017-06-08 00:10:44 +05:30
|
|
|
"prefer-reflect": ["warn", {"exceptions": ["delete"]}],
|
2016-06-02 22:00:51 +05:30
|
|
|
"prefer-spread": "warn",
|
|
|
|
"prefer-template": "warn",
|
|
|
|
"require-yield": "error",
|
2016-01-03 01:54:07 +05:30
|
|
|
|
|
|
|
// react
|
2017-06-08 01:39:11 +05:30
|
|
|
"react/display-name": "off",
|
|
|
|
"react/react-in-jsx-scope": "warn",
|
2016-06-02 22:00:51 +05:30
|
|
|
"react/forbid-prop-types": "warn",
|
|
|
|
"react/jsx-boolean-value": "warn",
|
2017-06-08 00:10:44 +05:30
|
|
|
"react/jsx-closing-bracket-location": "off", // can not configure for our code style
|
2016-06-02 22:00:51 +05:30
|
|
|
"react/jsx-curly-spacing": "warn",
|
|
|
|
"react/jsx-handler-names": ["warn", {"eventHandlerPrefix": "on", "eventHandlerPropPrefix": "on"}],
|
|
|
|
"react/jsx-indent-props": "warn",
|
|
|
|
"react/jsx-key": "warn",
|
|
|
|
"react/jsx-max-props-per-line": ["warn", {"maximum": 3}],
|
2017-05-26 00:41:57 +05:30
|
|
|
"react/jsx-no-bind": "off",
|
2016-06-02 22:00:51 +05:30
|
|
|
"react/jsx-no-duplicate-props": "warn",
|
2017-06-08 01:39:11 +05:30
|
|
|
"react/jsx-no-literals": "off",
|
2017-05-26 00:41:57 +05:30
|
|
|
"react/jsx-no-undef": "error",
|
2016-06-02 22:00:51 +05:30
|
|
|
"react/jsx-pascal-case": "warn",
|
|
|
|
"react/jsx-uses-react": "warn",
|
|
|
|
"react/jsx-uses-vars": "warn",
|
2016-08-14 14:27:15 +05:30
|
|
|
"react/jsx-no-comment-textnodes": "warn",
|
|
|
|
"react/jsx-wrap-multilines": "warn",
|
2016-06-02 22:00:51 +05:30
|
|
|
"react/no-deprecated": "warn",
|
|
|
|
"react/no-did-mount-set-state": "warn",
|
|
|
|
"react/no-did-update-set-state": "warn",
|
|
|
|
"react/no-direct-mutation-state": "warn",
|
2016-08-14 14:27:15 +05:30
|
|
|
"react/require-render-return": "warn",
|
2016-06-02 22:00:51 +05:30
|
|
|
"react/no-is-mounted": "warn",
|
2017-08-23 00:09:08 +05:30
|
|
|
"react/no-multi-comp": "off",
|
2016-06-02 22:00:51 +05:30
|
|
|
"react/no-string-refs": "warn",
|
|
|
|
"react/no-unknown-property": "warn",
|
|
|
|
"react/prefer-es6-class": "warn",
|
2017-08-23 02:01:41 +05:30
|
|
|
"react/prop-types": "off", // using flowtype for this task
|
2016-06-02 22:00:51 +05:30
|
|
|
"react/self-closing-comp": "warn",
|
2017-06-08 01:39:11 +05:30
|
|
|
"react/sort-comp": ["off", {"order": ["lifecycle", "render", "everything-else"]}]
|
2016-01-03 01:54:07 +05:30
|
|
|
}
|
|
|
|
}
|