Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Typescript compiler doesnt seem to be honouring my skipLibCheck flag being set to true

Tags:

typescript

I am receiving a bunch of syntax issues for library d.ts files in my project which I want to suppress. I see the 'skipLibCheck' option is available which I have set to true in my config, but it makes no difference:

ERROR in C:\Users\\***\Documents\GitHub\\***\node_modules\@types\leaflet\index.d.ts
[tsl] ERROR in C:\Users\\***\Documents\GitHub\\***\node_modules\@types\leaflet\index.d.ts(594,5)
      TS7028: Unused label.

ERROR in C:\Users\\***\Documents\GitHub\\***\node_modules\@types\handlebars\index.d.ts
[tsl] ERROR in C:\Users\\***\Documents\GitHub\\***\node_modules\@types\handlebars\index.d.ts(22,31)
      TS1005: ',' expected.

ERROR in C:\Users\\***\Documents\GitHub\\***\node_modules\@types\handlebars\index.d.ts
[tsl] ERROR in C:\Users\\***\Documents\GitHub\\***\node_modules\@types\handlebars\index.d.ts(24,32)
      TS1005: ',' expected.

ERROR in C:\Users\\***\Documents\GitHub\\***\node_modules\@types\handlebars\index.d.ts
[tsl] ERROR in C:\Users\\***\Documents\GitHub\\***\node_modules\@types\handlebars\index.d.ts(99,40)
      TS1005: ',' expected.

My tsconfig:

{
    "compilerOptions": {
        "target": "es5",
        "sourceMap": true,
        "outDir": "./dist",
        "rootDir": "../",
        "noImplicitAny": false,
        "noImplicitThis": false,
        "noUnusedLocals": false,
        "noUnusedParameters": false,
        "pretty": true,
        "removeComments": false,
        "allowUnreachableCode": false,
        "declaration": false,
        "allowJs": true,
        "module": "commonJs",
        "typeRoots" : ["./typings/index.d.ts", "../../node_modules/@types"],
        "skipLibCheck": true
    },
    "include": [
        "./typings/index.d.ts",
        "./app/**/*.module.ts",
        "./app/**/*.run.ts",
        "./app/**/*.routes.ts",
        "./app/**/*.enum.ts",
        "./app/**/*.controller.ts",
        "./app/**/*.model.ts",
        "./app/**/*.directive.ts",
        "./app/**/*.component.ts",
        "./app/**/*.filter.ts",
        "./app/**/*.service.ts",
        "./app/interfaces/**/*.ts"
    ],
    "exclude": [
        "dist"
    ]
}

I am using the latest version of webpack (3.11.0), should the skipLibCheck flag work here?

Thanks

like image 792
mindparse Avatar asked Feb 23 '18 22:02

mindparse


1 Answers

skipLibCheck skips the type inconsistency checks, but seems like you have some syntax errors. TS1005: ',' expected. is obviously not a type error.

like image 82
shal Avatar answered Sep 29 '22 21:09

shal