Commit ab3704a
committed
chore(lint): prefer 'unknown' to 'any', fix lint warnings
Explicitly enable `any` usage in typescript in:
- `dev-packages`, since those are largely integration and E2E tests.
(This is done with the addition of a `dev-packages/.eslintrc.js`
file.)
- `packages/*/test/`, since those are all tests. (This is done with a
rule override added to the root `.eslintrc.js` file.)
- Several one-off allowances, generally for vendored types from third
party sources, and cases involving method overwriting that TypeScript
can't follow. (These are done with file/line overrides, explicit `as`
casting, and adding type inference to the `isInstanceOf` method.)
In other places (ie, in exported production code paths), replace `any`
with `unknown`, and upgrade the `@typescript/no-explicit-any` lint rule
to an error.
This silences a lot of eslint warnings that were habitually ignored, and
encourages us to not opt out of strict type safety in our exported code.1 parent 6fd995e commit ab3704a
File tree
48 files changed
+90
-41
lines changed- dev-packages
- browser-integration-tests
- bundler-tests
- clear-cache-gh-action
- cloudflare-integration-tests
- suites/tracing/google-genai
- e2e-tests
- external-contributor-gh-action
- node-core-integration-tests
- node-integration-tests
- node-overhead-gh-action
- rollup-utils
- size-limit-gh-action
- test-utils
- packages
- aws-serverless/src/integration/instrumentation-aws-lambda
- cloudflare/src
- core
- src
- integrations
- types-hoist
- utils
- test/lib/utils
- feedback/src/modal
- nextjs/src/config
- node/src/integrations/tracing
- fastify
- v3
- firebase/otel
- patches
- remix/src
- utils
- vendor
- replay-internal
- src/types
- vercel-edge
- src/vendored
- test
- vue/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
48 files changed
+90
-41
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
36 | 39 | | |
37 | 40 | | |
38 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
39 | 45 | | |
40 | 46 | | |
41 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | 6 | | |
8 | 7 | | |
9 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
0 commit comments