Skip to content

Commit

Permalink
ignore spurious rootDir warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Nov 15, 2023
1 parent 0dc06db commit 4dd144c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/service/diagnostic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@ import { getCanonicalFileName } from './get-canonical-filename.js'

const cwd = process.cwd()

// Ignore the rootDir warning. Just means we're running something outside of
// cwd, which happens a lot in tests where we're spinning up the daemon and
// stuff repeatedly in test dirs, but almost never irl, and isn't a problem
// anyway.
export const reportAll = (
diagnostics: Diagnostic[],
pretty?: boolean
) => diagnostics.map(d => report(d, pretty))
) =>
diagnostics.filter(d => d.code !== 6059).map(d => report(d, pretty))

const host = {
getCurrentDirectory: () => cwd,
Expand Down
1 change: 1 addition & 0 deletions test/service/get-output-typecheck.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ for (const tsconfigModule of ['commonjs', 'esnext', 'nodenext']) {
`${dir}/${file}`
)
const d = diagnostics
.filter(d => d.code !== 6059)
.map(
d =>
[
Expand Down

0 comments on commit 4dd144c

Please sign in to comment.