[eslint] Allow `any` in rest parameters.
This enables the `ignoreRestArgs` setting[^1] for the ESLint rule
@typescript-eslint/no-explicit-any, which allows the use of `any`
in rest parameters (which is actually a valid use case for `any`)
and thereby reduces the number of pragmas in the code base where
we need to explicitly silence ESLint about this.
Drive-by-fixes: Refine some uses of `any` that can now be removed, and
refactor the heap snapshot worker proxy to make it easier to read and
type properly.
[^1]: https://typescript-eslint.io/rules/no-explicit-any/#ignorerestargs
Bug: b:319814509, chromium:1172300
Change-Id: I713f1fbf2a91348d422fb567c50d08d870e348cf
Doc: http://go/chrome-devtools:eslint-pain-points-design
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/5204645
Reviewed-by: Philip Pfaffe <[email protected]>
Commit-Queue: Benedikt Meurer <[email protected]>
Reviewed-by: Simon Zünd <[email protected]>
diff --git a/.eslintrc.js b/.eslintrc.js
index 6daeb50..a81c7dd 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -115,7 +115,12 @@
'@typescript-eslint/naming-convention':
[2, {'selector': 'interface', 'format': ['PascalCase'], 'custom': {'regex': '^I[A-Z]', 'match': false}}],
'@typescript-eslint/explicit-member-accessibility': [0],
- '@typescript-eslint/no-explicit-any': 2,
+ '@typescript-eslint/no-explicit-any': [
+ "error",
+ {
+ "ignoreRestArgs": true
+ }
+ ],
// Closure does not properly typecheck default exports
'import/no-default-export': 2,