Vscode closes the binding element "xxx" implicitly has an error of type "any"

In the ts project, I often see any type of error, which is really annoying

So in order to keep the mind out of sight, I decided to eliminate this error message

Configure "noImplicitAny": false in tsconfig.json

{
    "compilerOptions": {
        "target": "ES2020",
        "useDefineForClassFields": true,
        "lib": ["ES2020", "DOM", "DOM.Iterable"],
        "module": "ESNext",
        "skipLibCheck": true,
        "noImplicitAny": false,

        /* Bundler mode */
        "moduleResolution": "Node",
        "allowSyntheticDefaultImports": true,
        "resolveJsonModule": true,
        "isolatedModules": true,
        "noEmit": true,
        "jsx": "react-jsx",

        /* Linting */
        "strict": true,
        "noUnusedLocals": true,
        "noUnusedParameters": true,
        "noFallthroughCasesInSwitch": true,
        "baseUrl": "./",
        "paths": {
            "@": ["src"],
            "@/*": ["src/*"]
        }
    },
    "include": ["src"],
    "references": [{ "path": "./tsconfig.node.json" }]
}

Save tsconfig.json, and you're good to go:

 

Guess you like

Origin blog.csdn.net/weixin_44786530/article/details/132194783