From e98e2e561e6768a06ecf44b11025d3f5d992166e Mon Sep 17 00:00:00 2001 From: Evgeny Orekhov Date: Sun, 8 Dec 2019 16:55:57 +0300 Subject: [PATCH] Fix #36 Add eslint-plugin-ramda --- README.md | 3 ++- disabled-rules.json | 5 ++++- fp.json | 30 ++++++++++++++++++++++++++++-- package-lock.json | 22 ++++++++++++++++++++++ package.json | 1 + 5 files changed, 57 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ffe5f51f..3333f3c7 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,8 @@ This config is designed to be compatible with Douglas Crockford's | [eslint-plugin-json](https://github.com/azeemba/eslint-plugin-json)¹ ² | 1 | **1** | | **Total: `hardcore`** | 409 | **365** | | [eslint-plugin-fp](https://github.com/jfmengels/eslint-plugin-fp) | 17 | **15** | -| **Total: `hardcore` + `hardcore/fp`** | 426 | **381** | +| [eslint-plugin-ramda](https://github.com/ramda/eslint-plugin-ramda) | 26 | **24** | +| **Total: `hardcore` + `hardcore/fp`** | 452 | **405** | ¹ eslint-plugin-json actually includes 19 rules, but we consider them as one "no-invalid-json" rule. diff --git a/disabled-rules.json b/disabled-rules.json index 96fc87c8..f9c5ac8d 100644 --- a/disabled-rules.json +++ b/disabled-rules.json @@ -55,5 +55,8 @@ { "allowUseStrict": true } - ] + ], + + "ramda/compose-pipe-style": "off", + "ramda/prefer-ramda-boolean": "off" } diff --git a/fp.json b/fp.json index 99a4608b..60d3f50a 100644 --- a/fp.json +++ b/fp.json @@ -1,6 +1,7 @@ { "plugins": [ - "fp" + "fp", + "ramda" ], "rules": { @@ -27,6 +28,31 @@ "commonjs": true, "exceptions": [] } - ] + ], + + "ramda/always-simplification": "error", + "ramda/any-pass-simplification": "error", + "ramda/both-simplification": "error", + "ramda/complement-simplification": "error", + "ramda/compose-simplification": "error", + "ramda/cond-simplification": "error", + "ramda/either-simplification": "error", + "ramda/eq-by-simplification": "error", + "ramda/filter-simplification": "error", + "ramda/if-else-simplification": "error", + "ramda/map-simplification": "error", + "ramda/merge-simplification": "error", + "ramda/no-redundant-and": "error", + "ramda/no-redundant-not": "error", + "ramda/no-redundant-or": "error", + "ramda/pipe-simplification": "error", + "ramda/prefer-both-either": "error", + "ramda/prefer-complement": "error", + "ramda/prop-satisfies-simplification": "error", + "ramda/reduce-simplification": "error", + "ramda/reject-simplification": "error", + "ramda/set-simplification": "error", + "ramda/unless-simplification": "error", + "ramda/when-simplification": "error" } } diff --git a/package-lock.json b/package-lock.json index 7c2ae970..d8ca52b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -447,6 +447,23 @@ "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-4.2.1.tgz", "integrity": "sha512-VoM09vT7bfA7D+upt+FjeBO5eHIJQBUWki1aPvB+vbNiHS3+oGIJGIeyBtKQTME6UPXXy3vV07OL1tHd3ANuDw==" }, + "eslint-plugin-ramda": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-ramda/-/eslint-plugin-ramda-2.5.1.tgz", + "integrity": "sha512-1Uuyl5hMiyBNsn1F0Px0q8hGX95HC6CAzaEBeKngwixXwsbw+j98U7fatxDME8lUKyLPXuO5Ulon2QOcwVDrxw==", + "requires": { + "create-eslint-index": "^1.0.0", + "ramda": "0.25.0", + "req-all": "^1.0.0" + }, + "dependencies": { + "req-all": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/req-all/-/req-all-1.0.0.tgz", + "integrity": "sha1-0ShWlFHDQLQyQJxlbPFmJgzSYo0=" + } + } + }, "eslint-plugin-security": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/eslint-plugin-security/-/eslint-plugin-security-1.4.0.tgz", @@ -1299,6 +1316,11 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "ramda": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.25.0.tgz", + "integrity": "sha512-GXpfrYVPwx3K7RQ6aYT8KPS8XViSXUVJT1ONhoKPE9VAleW42YE+U+8VEyGWt41EnEQW7gwecYJriTI0pKoecQ==" + }, "read-pkg": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", diff --git a/package.json b/package.json index 37f20b1d..ec9ca825 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "eslint-plugin-json": "^2.0.1", "eslint-plugin-optimize-regex": "^1.1.7", "eslint-plugin-promise": "^4.2.1", + "eslint-plugin-ramda": "^2.5.1", "eslint-plugin-security": "^1.4.0", "eslint-plugin-sonarjs": "^0.5.0", "eslint-plugin-unicorn": "^14.0.1"