maloguertin / msw-trpc

tPRC support for MSW
208 stars 21 forks source link

@typescript-eslint/no-unsafe-argument #6

Closed CUexter closed 1 year ago

CUexter commented 1 year ago

Describe the bug

The examples fails to adhere to this typescript eslint rules https://typescript-eslint.io/rules/no-unsafe-argument/

To Reproduce Steps to reproduce the behavior: add this .eslintrc.json to the root of this repository

{
  "overrides": [
    {
      "extends": [
        "plugin:@typescript-eslint/recommended-requiring-type-checking"
      ],
      "files": ["*.ts", "*.tsx"],
      "parserOptions": {
        "project": "tsconfig.json"
      }
    }
  ],
  "parser": "@typescript-eslint/parser",
  "parserOptions": {
    "project": "./tsconfig.json"
  },
  "plugins": ["@typescript-eslint"],
  "extends": ["plugin:@typescript-eslint/recommended"]
}

run eslint test/integration.test.js There will be error:

  12:35  error  Unsafe argument of type `any` assigned to a parameter of type `ResponseTransformer<DefaultBodyType, any>`  @typescript-eslint/no-unsafe-argument
  15:35  error  Unsafe argument of type `any` assigned to a parameter of type `ResponseTransformer<DefaultBodyType, any>`  @typescript-eslint/no-unsafe-argument
  18:35  error  Unsafe argument of type `any` assigned to a parameter of type `ResponseTransformer<any, any>`              @typescript-eslint/no-unsafe-argument
  21:35  error  Unsafe argument of type `any` assigned to a parameter of type `ResponseTransformer<DefaultBodyType, any>`  @typescript-eslint/no-unsafe-argument
  24:35  error  Unsafe argument of type `any` assigned to a parameter of type `ResponseTransformer<DefaultBodyType, any>`  @typescript-eslint/no-unsafe-argument
  27:35  error  Unsafe argument of type `any` assigned to a parameter of type `ResponseTransformer<any, any>`              @typescript-eslint/no-unsafe-argument

Expected behavior

There should be no error.

maloguertin commented 1 year ago

I will try to look at this when I get some time, thank you for the bug report.