Skip to content

Commit f3246f7

Browse files
authored
chore: Disable redudant lint rule (#425)
The rule `promise/valid-params` is now disabled in our TypeScript config. The rule is redundant in a TypeScript context, where Promise parameters are being type-checked already. <!-- CURSOR_SUMMARY --> --- > [!NOTE] > Disables the `promise/valid-params` rule in the TypeScript config and documents it in the changelog, updating the rules snapshot. > > - **TypeScript ESLint config** > - Disable `promise/valid-params` in `packages/typescript/src/index.mjs` (redundant with TS type-checking). > - **Changelog** > - Add Unreleased note about disabling `promise/valid-params` in `packages/typescript/CHANGELOG.md`. > - **Rules snapshot** > - Update `packages/typescript/rules-snapshot.json` to include `"promise/valid-params": "off"`. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 0ed1ba2. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 383fbec commit f3246f7

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

packages/typescript/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1313
- This version has a matching supported `typescript` range, and includes some bug fixes for problems we ran into.
1414
- Disable `@typescript-eslint/no-unnecessary-type-arguments` ([#426](https://github.com/MetaMask/eslint-config/pull/426))
1515
- We decided that "unnecessary" type arguments make types easier to read sometimes, so we should allow them.
16+
- Disable `promise/valid-params` because it's redundant in type-checked projects ([#425](https://github.com/MetaMask/eslint-config/pull/425))
1617

1718
## [14.1.0]
1819

packages/typescript/rules-snapshot.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,5 +250,6 @@
250250
"prefer-promise-reject-errors": "off",
251251
"prefer-rest-params": "error",
252252
"prefer-spread": "error",
253+
"promise/valid-params": "off",
253254
"require-await": "off"
254255
}

packages/typescript/src/index.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,11 @@ const config = createConfig({
232232
message: 'Use a hash name instead.',
233233
},
234234
],
235+
236+
/* promise plugin rules */
237+
238+
// TypeScript already validates Promise params, no need to validate them twice
239+
'promise/valid-params': 'off',
235240
},
236241
});
237242

0 commit comments

Comments
 (0)