From eb92f65b95448609a95ac07125b309b5d2d08507 Mon Sep 17 00:00:00 2001 From: Andrey Mikheychik Date: Sun, 10 Nov 2024 16:28:43 -0600 Subject: [PATCH] Upgrade eslint-plugin-promise to v7.1.0 - Enable `promise/spec-only` as an error. --- package-lock.json | 13 +++++++------ package.json | 4 ++-- src/rules/promise/index.adoc | 5 +++++ src/rules/promise/index.ts | 3 +++ 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/package-lock.json b/package-lock.json index d614d20..bc77923 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,7 +35,7 @@ "eslint-plugin-jsdoc": "50.4.3", "eslint-plugin-n": "17.13.1", "eslint-plugin-prefer-arrow": "1.2.3", - "eslint-plugin-promise": "6.2.0", + "eslint-plugin-promise": "7.1.0", "eslint-plugin-rxjs": "5.0.3", "eslint-plugin-security": "3.0.1", "eslint-plugin-simple-import-sort": "12.1.0", @@ -72,7 +72,7 @@ "eslint-plugin-jsdoc": "^50.4.3", "eslint-plugin-n": "^17.13.1", "eslint-plugin-prefer-arrow": "^1.2.3", - "eslint-plugin-promise": "^6.2.0", + "eslint-plugin-promise": "^7.1.0", "eslint-plugin-rxjs": "^5.0.3", "eslint-plugin-security": "^3.0.1", "eslint-plugin-simple-import-sort": "^12.1.0", @@ -5249,12 +5249,13 @@ } }, "node_modules/eslint-plugin-promise": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.2.0.tgz", - "integrity": "sha512-QmAqwizauvnKOlifxyDj2ObfULpHQawlg/zQdgEixur9vl0CvZGv/LCJV2rtj3210QCoeGBzVMfMXqGAOr/4fA==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-7.1.0.tgz", + "integrity": "sha512-8trNmPxdAy3W620WKDpaS65NlM5yAumod6XeC4LOb+jxlkG4IVcp68c6dXY2ev+uT4U1PtG57YDV6EGAXN0GbQ==", "dev": true, + "license": "ISC", "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }, "funding": { "url": "https://opencollective.com/eslint" diff --git a/package.json b/package.json index fc23895..28d96b0 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,7 @@ "eslint-plugin-jsdoc": "^50.4.3", "eslint-plugin-n": "^17.13.1", "eslint-plugin-prefer-arrow": "^1.2.3", - "eslint-plugin-promise": "^6.2.0", + "eslint-plugin-promise": "^7.1.0", "eslint-plugin-rxjs": "^5.0.3", "eslint-plugin-security": "^3.0.1", "eslint-plugin-simple-import-sort": "^12.1.0", @@ -111,7 +111,7 @@ "eslint-plugin-jsdoc": "50.4.3", "eslint-plugin-n": "17.13.1", "eslint-plugin-prefer-arrow": "1.2.3", - "eslint-plugin-promise": "6.2.0", + "eslint-plugin-promise": "7.1.0", "eslint-plugin-rxjs": "5.0.3", "eslint-plugin-security": "3.0.1", "eslint-plugin-simple-import-sort": "12.1.0", diff --git a/src/rules/promise/index.adoc b/src/rules/promise/index.adoc index f7c1e10..f5836ac 100644 --- a/src/rules/promise/index.adoc +++ b/src/rules/promise/index.adoc @@ -70,6 +70,11 @@ to enforce best practices for JavaScript promises. | Error +| `link:{eslint-promise-rules}/spec-only.md[promise/spec-only]` +| +| +| Error + | `link:{eslint-promise-rules}/valid-params.md[promise/valid-params]` | | diff --git a/src/rules/promise/index.ts b/src/rules/promise/index.ts index ea72864..d36b5a4 100644 --- a/src/rules/promise/index.ts +++ b/src/rules/promise/index.ts @@ -15,6 +15,9 @@ export = { 'promise/avoid-new': 'off', 'promise/no-new-statics': 'warn', 'promise/no-return-in-finally': 'error', + 'promise/spec-only': ['error', { + allowedMethods: [], + }], 'promise/valid-params': 'error', // Promises should always be used instead of async/await. 'promise/prefer-await-to-then': 'off', // == ES2017 Async/Await