Skip to content

Commit

Permalink
Ignore rootDir errors (#544)
Browse files Browse the repository at this point in the history
  • Loading branch information
blakeembrey authored Mar 1, 2018
1 parent 10af1c5 commit 0c7fa0d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,12 +170,16 @@ function getTmpDir (): string {
* Register TypeScript compiler.
*/
export function register (opts: Options = {}): Register {
const emptyFileListWarnings = [18002, 18003]
const options = Object.assign({}, DEFAULTS, opts)
const cacheDirectory = options.cacheDirectory || getTmpDir()
const ignoreDiagnostics = arrify(options.ignoreDiagnostics).concat(emptyFileListWarnings).map(Number)
const originalJsHandler = require.extensions['.js']

const ignoreDiagnostics = arrify(options.ignoreDiagnostics).concat([
6059, // "'rootDir' is expected to contain all source files."
18002, // "The 'files' list in config file is empty."
18003 // "No inputs were found in config file."
]).map(Number)

const memoryCache: MemoryCache = {
contents: Object.create(null),
versions: Object.create(null),
Expand Down
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"compilerOptions": {
"target": "es5",
"lib": ["es2015"],
"rootDir": "src",
"outDir": "dist",
"module": "commonjs",
"declaration": true,
Expand Down

0 comments on commit 0c7fa0d

Please sign in to comment.