can someone tell me how to disable everything that's triggered by @typescript-eslint/ban-types?

Viewed 8679

This "@typescript-eslint/ban-types" gives me nightmares. I work on a large project and it generates large errors (in hundreds) that cannot be easily fixed.

This is the configuration that I have however does the stupid eslint does not want to take it:

 //
        // Typescript
        "@typescript-eslint/ban-types": [
            "error",
            {
                types: {
                    "{}": false,
                    Function: false,
                },
                extendDefaults: true,
            },
        ],
2 Answers

Looking at the ban-types.ts file from GitHub TypeScript ESLint Link

Add this to your .eslintrc file to ignore the default ban-types.

"@typescript-eslint/ban-types": ["error",
    {
        "types": {
            "String": false,
            "Boolean": false,
            "Number": false,
            "Symbol": false,
            "{}": false,
            "Object": false,
            "object": false,
            "Function": false,
        },
        "extendDefaults": true
    }
]

You can also do this shorter by doing:

rules: {
  "@typescript-eslint/ban-types": "off"
}
Related