Skip to content

Commit

Permalink
Revert #621 changes (#627)
Browse files Browse the repository at this point in the history
  • Loading branch information
loilo authored and johnnyreilly committed Sep 7, 2017
1 parent 9349914 commit bd7c0da
Show file tree
Hide file tree
Showing 22 changed files with 2 additions and 680 deletions.
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,6 @@ You may provide
* a relative path to the configuration file. It will be resolved relative to the respective `.ts` entry file.
* an absolute path to the configuration file.

Note that TypeScript only accepts source files inside the project root. By default, the project root will be the folder that holds your config file. You can modify it by setting the [`rootDir`](https://www.typescriptlang.org/docs/handbook/compiler-options.html) TypeScript option in your configuration.

#### visualStudioErrorFormat *(boolean) (default=false)*

If `true`, the TypeScript compiler output for an error or a warning, e.g. `(3,14): error TS4711: you did something very wrong`, in file `myFile` will instead be `myFile(3,14): error TS4711: you did something very wrong` (notice the file name at the beginning). This way Visual Studio will interpret this line and show any errors or warnings in the *error list*. This enables navigation to the file/line/column through double click.
Expand Down
25 changes: 2 additions & 23 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,40 +121,19 @@ export function getConfigParseResult(
configFile: ConfigFile,
configFilePath: string
) {
let basePath: string
const configDir = path.dirname(configFilePath || '')

// check for `compilerOptions.rootDir`
if (configFile.config.compilerOptions && typeof configFile.config.compilerOptions.rootDir === 'string') {
const configuredRootDir = configFile.config.compilerOptions.rootDir

// `rootDir` is absolute -> use it as `basePath`
if (path.isAbsolute(configuredRootDir)) {
basePath = configuredRootDir

// `rootDir` is relative -> resolve it relative to config dir
} else {
basePath = path.resolve(configDir, configuredRootDir)
}

// no `rootDir` -> use config directory as `basePath`
} else {
basePath = configDir
}

let configParseResult: typescript.ParsedCommandLine;
if (typeof (<any> compiler).parseJsonConfigFileContent === 'function') {
// parseConfigFile was renamed between 1.6.2 and 1.7
configParseResult = (/*<TSCompatibleCompiler>*/ <any> compiler).parseJsonConfigFileContent(
configFile.config,
compiler.sys,
basePath
path.dirname(configFilePath || '')
);
} else {
configParseResult = (/*<TSCompatibleCompiler>*/ <any> compiler).parseConfigFile(
configFile.config,
compiler.sys,
basePath
path.dirname(configFilePath || '')
);
}

Expand Down
Binary file removed test/comparison-tests/configureRoot/.DS_Store
Binary file not shown.
5 changes: 0 additions & 5 deletions test/comparison-tests/configureRoot/config/tsconfig.json

This file was deleted.

74 changes: 0 additions & 74 deletions test/comparison-tests/configureRoot/expectedOutput-1.6/bundle.js

This file was deleted.

This file was deleted.

74 changes: 0 additions & 74 deletions test/comparison-tests/configureRoot/expectedOutput-1.7/bundle.js

This file was deleted.

This file was deleted.

74 changes: 0 additions & 74 deletions test/comparison-tests/configureRoot/expectedOutput-1.8/bundle.js

This file was deleted.

This file was deleted.

74 changes: 0 additions & 74 deletions test/comparison-tests/configureRoot/expectedOutput-2.0/bundle.js

This file was deleted.

This file was deleted.

Loading

0 comments on commit bd7c0da

Please sign in to comment.