Skip to content

Add --watch mode #479

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ajafff opened this issue Dec 7, 2018 · 0 comments
Open

Add --watch mode #479

ajafff opened this issue Dec 7, 2018 · 0 comments

Comments

@ajafff
Copy link
Member

ajafff commented Dec 7, 2018

This proposes to add a --watch option or a plugin module that does the actual watching.

  • creates all the specified projects
    • regardless of whether it contains no files to lint -> these could be added later
  • watch for changes in the TypeScript projects
    • watch failed lookup locations of initial tsconfig.json
  • watch for changes in configuration files (requires configuration: return failed lookup locations #478)
  • lint everything that is affected by the change (could be based on Caching lint results #370)
  • report failures in all files, not just the ones affected by a change
  • uses ts.createWatchProgram instead of ts.createProgram
  • requires some major refactoring in runner.ts
  • reusing SourceFiles is probably no longer possible if multiple Programs are watched at the same time
  • TypeScript should be able to access environment variables, because file watching can be affected by that

TBD:

  • how does this interact with --fix?
  • Display some message when starting a new run due to changes?
  • how to test this?
  • requires a way to invalidate caches
  • what to use for watching of raw glob patterns if --project is not specified?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant