0

As the title of the question indicates, we are a team, which uses TypeScript, but the editors Atom and VSCode. We have troubles with the tsconfig.json.

  1. VSCode does not recognize the typings, so ng (for Angular 1.x) is not known namespace for VSCode.
  2. The following tsconfig.json is commented by VSCode with a

    Matches a schema that is not allowed.

I guess, there is a connection between these issues.


{
    "compilerOptions":
        {
            "target": "es5",
            "module": "commonjs",
            "declaration": false,
            "noImplicitAny": false,
            "removeComments": true,
            "noLib": false,
            "preserveConstEnums": true,
            "suppressImplicitAnyIndexErrors": true,
            "outDir": "./tmp/typescript",
            "rootDir": "./our/ts/dir"
        },
    "filesGlob": [
        "./src/**/*.ts",
        "!./node_modules/**/*.ts",
        "./bower_components/our_library/src/company/**/*.ts",
        "./typings/tsd.d.ts"
    ],
    "files": [
        "./src/example.ts",
        "./src/many/many/entries/any.ts",
        "./src/lib.ts/a_library.ts",
        "./src/lib.ts/angular.ts",
        "./src/lib.ts/jquery.ts",
        "./src/lib.ts/lodash.ts",
        "./src/lib.ts/moment.ts",
        "./src/lib.ts/restangular.ts",
        "./src/lib.ts/selectize.ts",
        "./src/lib.ts/systemjs.ts",
        "./typings/tsd.d.ts"
    ],
    "exclude": [],
    "atom": {
        "rewriteTsconfig": true
    }
}

I've tried to manage the issue based on this question, but the answer does not help (the typings are already included in the tsconfig.json). Also reading the tsconfig.json spec was not very helpful, because the error message from VSCode occurrs when I remove the filesGlob and atom fields in the JSON.

Any advice is appreciated.

1 Answer 1

2

For issue number 2:

You have to remove the exclude property. If it is used in conjunction with the files property the files property takes precedence.

You can read the full spec for valid tsconfigs here: https://github.com/Microsoft/TypeScript/wiki/tsconfig.json

1
  • Perfect! This solved issue 1, either - as expected. Many, many thanks.
    – BairDev
    Mar 23, 2016 at 9:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.