anchor.diff:      "noImplicitThis": true,
       "allowSyntheticDefaultImports": true,
       "removeComments": true,
  -    "preserveConstEnums": true,
       "sourceMap": true
     }
   }
   ----
   
  -This tells the TypeScript compiler to resolve source files beneath the `src` directory and that the compiled JavaScript files should be placed in the `dist` directory. Furthermore, we instructed the compiler to produce `es2015` modules that we will use with _rollup.js_ later on. Also notice that we activated the generation of sourcemaps right at the end of the compiler options.
  -
  -If you want to dive into the TypeScript compiler options further please have a look at the https://www.typescriptlang.org/docs/handbook/tsconfig-json.html[documentation].
  +`"rootDir": "src"`:: Uses the `src` directory as the root directory for the resolution of source files. This ensures that our compiled JavaScript files in the `dist` directory are organized in the same directory structure as in the `src` directory.
  +
  +`"outDir": "dist"`:: Writes the compiled JavaScript files to the `dist` directory.
  +
  +`"target": "es2015"`:: Compiles the TypeScript code to JavaScript code that still utilizes ES2015 language features like lambda expressions. This language level is not supported by all browsers yet but we will convert it to a more compatible level later on.
  +
  +`"module": "es2015"`:: Compiles the TypeScript modules to ES2015 modules using the standardized `import/export` syntax. This module format is required because we want to use the compiled JavaScript files with rollup.js to create a single JavaScript file.
  +
  +`"moduleResolution": "node"`:: Instructs the compiler to resolve non-relative module imports like `import $ from 'jquery'` with the Node.js mechanism thus looking for modules in the `node_modules` directory. This allows us to use modules installed with NPM in our TypeScript code. See the TypeScript https://www.typescriptlang.org/docs/handbook/module-resolution.html[handbook] for further details.
  +
  +`"noImplicitAny": true`:: Raises a compile error if any variable does not have an explicit type declaration and therefore the compiler would have to assume `any` for it. This helps to improve code stability because it enforces strict type checking.
  +
  +`"noImplicitReturns": true`:: Raises a compile error if any function with a return type other than `void` or `any` has branches that do not explicitly return any result. This may result in unexpected behavior and therefore it is reasonable to let the compiler check for such mistakes.
  +
  +`"noImplicitThis": true`:: Raises a compile error if the keyword `this` is used in the code and the compiler does not know what kind of object it will be in that context. This can happen when you use `this` in functions which are not declared as methods of a class but by an interface. See the TypeScript https://www.typescriptlang.org/docs/handbook/functions.html[handbook] for an example and how to tell the compiler what `this` means in a function.
  +
  +`"allowSyntheticDefaultImports": true`:: Forces the compiler to accept default imports of modules which actually do not have any default export as it is the case with the jQuery type declaration. Without that option the statement `import $ from 'jquery'` would yield a compile error.
  +
  +`"removeComments": true`:: Removes the source code comments from the compiled JavaScript files. This reduces their size and we still have sourcemaps for debugging, so comments are not needed in the output.
  +
  +`"sourceMap": true`:: Generates `.js.map` sourcemap files for all generated JavaScript files. This makes it easier to debug our source code when it runs in the browser.
  +
  +TIP: If you want to dive into the TypeScript compiler options further please have a look at the https://www.typescriptlang.org/docs/handbook/tsconfig-json.html[documentation].
   
   === Creating a TypeScript source file
   
  -Now that you have configured the TypeScript compiler you are ready to create a first source code file. As we told the compiler to expect source files in the `src` directory you should put all your TypeScript files there (or in subdirectories beneath).
  -
  -. Create a directory `src` in your project directory.
  +Now that we have configured the TypeScript compiler we are ready to create a first source code file. Since we told the compiler to expect source files in the `src` directory we should put all TypeScript files there (or in subdirectories beneath).
  +
  +. Create a directory `src` in our project directory.
   . Create a new file `example-service.ts` in the `src` directory.
   . Open the new TypeScript file in the text editor and insert the following code:
   
  
positive.code: }
  ----
  
  So we told Karma that all TypeScript files beneath the `src` directory should be loaded and that TypeScript files need to be processed by `karma-typescript`. Furthermore, we defined `PhantomJS` as the browser to execute our tests and instructed Karma to load framework support for Jasmine and TypeScript.
  
  If you want to know more about the Karma configuration please have a look at the https://karma-runner.github.io/1.0/config/configuration-file.html[documentation].
  
  Since Karma is also installed locally in your project you will have to create NPM script to run the tests from the command line.
  
  . Open the file `package.json` with the text editor.
  . There should already be a property `test` in the `scripts` object (if not create a new property). Set the value of the `test` script to `karma start`:
  
negative.code: }
  ----
  
  This allows us to run the TypeScript compiler from the command line via `npm run compile`. But do not execute it for now since we have not created a configuration yet.
  
  === Configuring the TypeScript compiler
  
  We run the TypeScript compiler by simply executing the `tsc` command in our project. Therefore the compiler needs some more information about where to look for source files and how the generated JavaScript code should look like. A very convenient way to configure the compiler is to put a `tsconfig.json` file directly in our project directory.
  
  . Create a file `tsconfig.json` in our project directory.
  . Open the file with the text editor and insert the following code:
  
  [source,json]
  