Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

CLI: handle directories passed with -p #2756

Merged
merged 2 commits into from May 14, 2017
Merged

CLI: handle directories passed with -p #2756

merged 2 commits into from May 14, 2017

Conversation

ajafff
Copy link
Contributor

@ajafff ajafff commented May 13, 2017

PR checklist

Overview of change:

Search for tsconfig.json in specified directory. Exit with error if there is none.
Ref: #2692
[enhancement] cli: -p option handles directories

Is there anything you'd like reviewers to focus on?

CHANGELOG.md entry:

Search for tsconfig.json in specified directory. Exit with error if  there is none.
Ref: #2692
[enhancement] cli: `-p` option handles directories
src/runner.ts Outdated
if (!fs.existsSync(this.options.project)) {
let project: string;
try {
project = findTsconfig(this.options.project);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this function should handle error handling itself (and return string | undefined) instead of throwing an error whose value is ignored.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -175,9 +178,6 @@ export class Runner {
// if not type checking, we don't need to pass in a program object
program = undefined;
}
} else if (this.options.typeCheck) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you move this code?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all static option validation is done in tslint-cli.ts
runner.ts should only be responsible to catch errors that occur at runtime

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants