wotan icon indicating copy to clipboard operation
wotan copied to clipboard

Fix wotan with typescript 4.4+

Open notanengineercom opened this issue 3 years ago • 1 comments

Checklist

  • [X] Fixes: TypeError: directoryExists is not a function
  • [X] Added or updated tests / baselines

Overview of change

Typescript 4.4+ added a new required parameter called directoryExists to their matchFiles utility function. See here

When using wotan in a project using typescript >= 4.4 the following exception would be thrown

> wotan -c tslint.json -p tsconfig.json "private/**/*.ts"

TypeError: directoryExists is not a function
    at Object.matchFiles (/runner/node_modules/typescript/lib/typescript.js:20102:17)
    at ProjectHost.readDirectory (/runner/node_modules/@fimbul/wotan/src/project-host.js:42:19)
    at Object.readDirectory (/runner/node_modules/@fimbul/wotan/src/project-host.js:28:85)
    at getFileNamesFromConfigSpecs (/runner/node_modules/typescript/lib/typescript.js:40747:40)
    at getFileNames (/runner/node_modules/typescript/lib/typescript.js:40250:29)
    at parseJsonConfigFileContentWorker (/runner/node_modules/typescript/lib/typescript.js:40183:24)
    at Object.parseJsonSourceFileConfigFileContent (/runner/node_modules/typescript/lib/typescript.js:40135:16)
    at ProjectHost.parseConfigFile (/runner/node_modules/@fimbul/wotan/src/project-host.js:225:19)
    at Object.resolveCachedResult (/runner/node_modules/@fimbul/wotan/src/utils.js:25:18)
    at ProjectHost.getParsedCommandLine (/runner/node_modules/@fimbul/wotan/src/project-host.js:217:24)

notanengineercom avatar Nov 10 '21 17:11 notanengineercom

@ajafff a little ping 🙈

notanengineercom avatar Nov 22 '21 11:11 notanengineercom