diff --git a/.eslintrc.js b/.eslintrc.js index 1fc0053..78a98d6 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -17,7 +17,7 @@ module.exports = { "sourceType": "module" }, "plugins": [ - "react", "flowtype" + "react", "flowtype", "fp" ], "globals": { "require": false @@ -140,6 +140,27 @@ module.exports = { // flow "flowtype/no-dupe-keys": "error", "flowtype/no-weak-types": "warn", - "flowtype/require-variable-type": "off" // wait for https://github.com/gajus/eslint-plugin-flowtype/issues/198 to be resolved + "flowtype/require-variable-type": "off", // wait for https://github.com/gajus/eslint-plugin-flowtype/issues/198 to be resolved + + // fp + // TODO: Import fp/recommended after resolving the warnings + "fp/no-arguments": "warn", + "fp/no-class": "warn", + "fp/no-delete": "warn", + "fp/no-events": "warn", + "fp/no-get-set": "warn", + "fp/no-let": "warn", + "fp/no-loops": "warn", + "fp/no-mutating-assign": "warn", + "fp/no-mutating-methods": "warn", + "fp/no-mutation": "warn", + "fp/no-nil": "warn", + "fp/no-proxy": "warn", + "fp/no-rest-parameters": "warn", + "fp/no-this": "warn", + "fp/no-throw": "warn", + "fp/no-unused-expression": "warn", + "fp/no-valueof-field": "warn", + "no-var": "warn" } }; diff --git a/package.json b/package.json index 745d87a..e2c4f82 100644 --- a/package.json +++ b/package.json @@ -39,6 +39,7 @@ "css-loader": "^1.0.0", "eslint": "^5.0.1", "eslint-plugin-flowtype": "^2.42.0", + "eslint-plugin-fp": "^2.3.0", "eslint-plugin-react": "^7.6.1", "file-loader": "^1.1.5", "flow": "^0.2.3", diff --git a/yarn.lock b/yarn.lock index b99a21f..17cfcb4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1747,6 +1747,12 @@ create-ecdh@^4.0.0: bn.js "^4.1.0" elliptic "^6.0.0" +create-eslint-index@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/create-eslint-index/-/create-eslint-index-1.0.0.tgz#d954372d86d5792fcd67e9f2b791b1ab162411bb" + dependencies: + lodash.get "^4.3.0" + create-hash@^1.1.0, create-hash@^1.1.2: version "1.2.0" resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196" @@ -2225,12 +2231,28 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" +eslint-ast-utils@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/eslint-ast-utils/-/eslint-ast-utils-1.1.0.tgz#3d58ba557801cfb1c941d68131ee9f8c34bd1586" + dependencies: + lodash.get "^4.4.2" + lodash.zip "^4.2.0" + eslint-plugin-flowtype@^2.42.0: version "2.50.0" resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.50.0.tgz#953e262fa9b5d0fa76e178604892cf60dfb916da" dependencies: lodash "^4.17.10" +eslint-plugin-fp@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-fp/-/eslint-plugin-fp-2.3.0.tgz#376d2a108710e981980bdc3875e3b9920da0489c" + dependencies: + create-eslint-index "^1.0.0" + eslint-ast-utils "^1.0.0" + lodash "^4.13.1" + req-all "^0.1.0" + eslint-plugin-react@^7.6.1: version "7.10.0" resolved "https://registry.yarnpkg.com/eslint-plugin-react/-/eslint-plugin-react-7.10.0.tgz#af5c1fef31c4704db02098f9be18202993828b50" @@ -3700,7 +3722,15 @@ lodash.debounce@^4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" -lodash@^4.0.0, lodash@^4.17.10, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0: +lodash.get@^4.3.0, lodash.get@^4.4.2: + version "4.4.2" + resolved "https://registry.yarnpkg.com/lodash.get/-/lodash.get-4.4.2.tgz#2d177f652fa31e939b4438d5341499dfa3825e99" + +lodash.zip@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/lodash.zip/-/lodash.zip-4.2.0.tgz#ec6662e4896408ed4ab6c542a3990b72cc080020" + +lodash@^4.0.0, lodash@^4.13.1, lodash@^4.17.10, lodash@^4.17.3, lodash@^4.17.4, lodash@^4.17.5, lodash@^4.2.1, lodash@^4.3.0: version "4.17.10" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.10.tgz#1b7793cf7259ea38fb3661d4d38b3260af8ae4e7" @@ -4970,6 +5000,10 @@ repeating@^2.0.0: dependencies: is-finite "^1.0.0" +req-all@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/req-all/-/req-all-0.1.0.tgz#130051e2ace58a02eacbfc9d448577a736a9273a" + require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"