Skip to content

Commit 0c7fa0d

Browse files
authored
Ignore rootDir errors (#544)
1 parent 10af1c5 commit 0c7fa0d

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,16 @@ function getTmpDir (): string {
170170
* Register TypeScript compiler.
171171
*/
172172
export function register (opts: Options = {}): Register {
173-
const emptyFileListWarnings = [18002, 18003]
174173
const options = Object.assign({}, DEFAULTS, opts)
175174
const cacheDirectory = options.cacheDirectory || getTmpDir()
176-
const ignoreDiagnostics = arrify(options.ignoreDiagnostics).concat(emptyFileListWarnings).map(Number)
177175
const originalJsHandler = require.extensions['.js']
178176

177+
const ignoreDiagnostics = arrify(options.ignoreDiagnostics).concat([
178+
6059, // "'rootDir' is expected to contain all source files."
179+
18002, // "The 'files' list in config file is empty."
180+
18003 // "No inputs were found in config file."
181+
]).map(Number)
182+
179183
const memoryCache: MemoryCache = {
180184
contents: Object.create(null),
181185
versions: Object.create(null),

tsconfig.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"compilerOptions": {
33
"target": "es5",
44
"lib": ["es2015"],
5+
"rootDir": "src",
56
"outDir": "dist",
67
"module": "commonjs",
78
"declaration": true,

0 commit comments

Comments
 (0)