Skip to content

Commit 8fb34e9

Browse files
authored
Merge pull request #27 from vegarringdal/master
v2.3.3
2 parents e37b5de + 9e73d9a commit 8fb34e9

File tree

11 files changed

+48
-40
lines changed

11 files changed

+48
-40
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ doTypeCheck();
7676

7777

7878
```typescript
79-
interface OptionsInterface {
79+
interface IOptionsInterface {
8080
tsConfig: string; //config file (compared to basepath './tsconfig.json')
8181
throwOnSyntactic?: boolean; // if you want it to throwe error
8282
throwOnSemantic?: boolean; // if you want it to throwe error
@@ -86,7 +86,7 @@ interface OptionsInterface {
8686
basePath: string; // base path to use
8787
name?: string; // name, will be displayed when it runs, useful when you have more then 1
8888
tsLint: string; // config file (compared to basepath './tslint.json')
89-
lintoptions? LintOptions; // see below, optional
89+
lintoptions? ILintOptions; // see below, optional
9090
yellowLint?: boolean; // use yellow color instead of red on TSLint errors
9191
yellowOnOptions?: boolean; // use yellow color instead of red on Options errors
9292
yellowOnGlobal?: boolean; // use yellow color instead of red on Global errors
@@ -95,7 +95,7 @@ interface OptionsInterface {
9595
}
9696

9797

98-
interface LintOptions {
98+
interface ILintOptions {
9999
fix?: boolean; // default is false
100100
formatter?: string; //JSON, can not be edited
101101
formattersDirectory?: string; //default is null

dist/commonjs/checker.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { InternalTypeCheckerOptions } from './interfaces';
1+
import { IInternalTypeCheckerOptions } from './interfaces';
22
export declare class Checker {
33
private options;
44
private program;
55
private elapsedInspectionTime;
66
private tsDiagnostics;
77
private lintFileResult;
88
constructor();
9-
inspectCode(options: InternalTypeCheckerOptions): void;
9+
inspectCode(options: IInternalTypeCheckerOptions): void;
1010
printResult(isWorker?: boolean): number;
1111
private writeText(text);
1212
private processLintFiles();

dist/commonjs/checker.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/commonjs/index.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { TypeCheckerOptions } from './interfaces';
1+
import { ITypeCheckerOptions } from './interfaces';
22
export declare class TypeHelperClass {
33
private options;
44
private worker;
55
private checker;
66
private monitor;
77
private watchTimeout;
88
private isWorkerInspectPreformed;
9-
constructor(options: TypeCheckerOptions);
9+
constructor(options: ITypeCheckerOptions);
1010
runAsync(): void;
1111
runSync(): number;
1212
runPromise(): Promise<number>;
@@ -18,4 +18,4 @@ export declare class TypeHelperClass {
1818
private writeText(text);
1919
private getPath(usePath);
2020
}
21-
export declare const TypeHelper: (options: TypeCheckerOptions) => TypeHelperClass;
21+
export declare const TypeHelper: (options: ITypeCheckerOptions) => TypeHelperClass;

dist/commonjs/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/commonjs/interfaces.d.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export interface TypeCheckerOptions {
1+
export interface ITypeCheckerOptions {
22
basePath: string;
33
tsConfig: string;
44
throwOnSyntactic?: boolean;
@@ -13,22 +13,22 @@ export interface TypeCheckerOptions {
1313
yellowOnSyntactic?: boolean;
1414
tsLint?: string;
1515
name?: string;
16-
lintoptions?: LintOptions;
16+
lintoptions?: ILintOptions;
1717
}
18-
export interface LintOptions {
18+
export interface ILintOptions {
1919
fix?: boolean;
2020
formatter?: string;
2121
formattersDirectory?: string | null;
2222
rulesDirectory?: string | null;
2323
}
24-
export interface InternalTypeCheckerOptions extends TypeCheckerOptions {
24+
export interface IInternalTypeCheckerOptions extends ITypeCheckerOptions {
2525
type: TypecheckerRunType;
2626
tsConfigJsonContent?: any;
2727
quit?: boolean;
2828
}
2929
export interface IWorkerOptions {
3030
type: WorkerCommand;
31-
options?: InternalTypeCheckerOptions;
31+
options?: IInternalTypeCheckerOptions;
3232
}
3333
export declare enum WorkerCommand {
3434
inspectCode = 0,

dist/commonjs/interfaces.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/checker.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ import * as ts from 'typescript';
22
import * as chalk from 'chalk';
33
import * as tslint from 'tslint';
44
import * as path from 'path';
5-
import { InternalTypeCheckerOptions, END_LINE } from './interfaces';
5+
import { IInternalTypeCheckerOptions, END_LINE } from './interfaces';
66

77

88
export class Checker {
99

1010
// options that will be used when checking and printing results
11-
private options: InternalTypeCheckerOptions;
11+
private options: IInternalTypeCheckerOptions;
1212

1313
// typescript program
1414
private program: ts.Program;
@@ -28,7 +28,7 @@ export class Checker {
2828
}
2929

3030

31-
public inspectCode(options: InternalTypeCheckerOptions) {
31+
public inspectCode(options: IInternalTypeCheckerOptions) {
3232
this.options = options;
3333

3434

src/index.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22

33
import * as child from 'child_process';
44
import * as path from 'path';
5-
import { LintOptions, TypeCheckerOptions, WorkerCommand, TypecheckerRunType, InternalTypeCheckerOptions } from './interfaces';
5+
import { ILintOptions, ITypeCheckerOptions, WorkerCommand, TypecheckerRunType, IInternalTypeCheckerOptions } from './interfaces';
66
import { Checker } from './checker';
77
import * as watch from 'watch';
88
import * as ts from 'typescript';
99
import * as chalk from 'chalk';
1010

1111

1212
export class TypeHelperClass {
13-
private options: TypeCheckerOptions;
13+
private options: ITypeCheckerOptions;
1414
private worker: child.ChildProcess;
1515
private checker: Checker;
1616
private monitor: any;
1717
private watchTimeout: NodeJS.Timer;
1818
private isWorkerInspectPreformed: boolean;
1919

2020

21-
constructor(options: TypeCheckerOptions) {
21+
constructor(options: ITypeCheckerOptions) {
2222
this.checker = new Checker();
2323
this.options = options;
2424

@@ -31,7 +31,7 @@ export class TypeHelperClass {
3131

3232
// tslint options
3333
let lintOp = this.options.lintoptions;
34-
this.options.lintoptions = lintOp ? lintOp : ({} as LintOptions);
34+
this.options.lintoptions = lintOp ? lintOp : ({} as ILintOptions);
3535

3636
// fix tslint options so tslint do not complain
3737
this.options.lintoptions = {
@@ -43,7 +43,7 @@ export class TypeHelperClass {
4343

4444
// get tsconfig path and options
4545
let tsconf = this.getPath(options.tsConfig);
46-
(<InternalTypeCheckerOptions>this.options).tsConfigJsonContent = require(tsconf);
46+
(<IInternalTypeCheckerOptions>this.options).tsConfigJsonContent = require(tsconf);
4747
this.writeText(chalk.yellow(`Typechecker tsconfig: ${chalk.white(`${tsconf}${'\n'}`)}`));
4848

4949
// get tslint path and options
@@ -62,7 +62,7 @@ export class TypeHelperClass {
6262
public runAsync(): void {
6363

6464
// set options, add if it need to quit and run type
65-
let options: InternalTypeCheckerOptions = Object.assign(this.options, { quit: true, type: TypecheckerRunType.async });
65+
let options: IInternalTypeCheckerOptions = Object.assign(this.options, { quit: true, type: TypecheckerRunType.async });
6666

6767
// create thread
6868
this.createThread();
@@ -82,7 +82,7 @@ export class TypeHelperClass {
8282
public runSync(): number {
8383

8484
// set options, add if it need to quit and run type
85-
let options: InternalTypeCheckerOptions = Object.assign(this.options, { quit: true, type: TypecheckerRunType.sync });
85+
let options: IInternalTypeCheckerOptions = Object.assign(this.options, { quit: true, type: TypecheckerRunType.sync });
8686

8787
// inspect our code
8888
this.checker.inspectCode(options);
@@ -105,7 +105,7 @@ export class TypeHelperClass {
105105
try {
106106

107107
// set options, add if it need to quit and run type
108-
let options: InternalTypeCheckerOptions = Object.assign(this.options, { quit: true, type: TypecheckerRunType.promiseSync });
108+
let options: IInternalTypeCheckerOptions = Object.assign(this.options, { quit: true, type: TypecheckerRunType.promiseSync });
109109

110110
// inspect our code
111111
this.checker.inspectCode(options);
@@ -130,7 +130,7 @@ export class TypeHelperClass {
130130
public runWatch(pathToWatch: string): void {
131131

132132
// set options, add if it need to quit and run type
133-
let options: InternalTypeCheckerOptions = Object.assign(this.options, { quit: false, type: TypecheckerRunType.watch });
133+
let options: IInternalTypeCheckerOptions = Object.assign(this.options, { quit: false, type: TypecheckerRunType.watch });
134134

135135
// const
136136
const write = this.writeText;
@@ -218,7 +218,7 @@ export class TypeHelperClass {
218218
* Configure worker, internal function
219219
*
220220
*/
221-
private inspectCodeWithWorker(options: TypeCheckerOptions): void {
221+
private inspectCodeWithWorker(options: ITypeCheckerOptions): void {
222222
this.worker.send({ type: WorkerCommand.inspectCode, options: options });
223223

224224
// we set this so we can stop worker print from trying to run
@@ -296,7 +296,7 @@ export class TypeHelperClass {
296296
}
297297

298298
// return new typechecker
299-
export const TypeHelper = (options: TypeCheckerOptions): TypeHelperClass => {
299+
export const TypeHelper = (options: ITypeCheckerOptions): TypeHelperClass => {
300300
return new TypeHelperClass(options);
301301
};
302302

src/interfaces.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
// options they can use to create the typechecker
3-
export interface TypeCheckerOptions {
3+
export interface ITypeCheckerOptions {
44
// base path
55
basePath: string;
66

@@ -29,19 +29,19 @@ export interface TypeCheckerOptions {
2929

3030
// lint options that can be passed in
3131
// todo: rename to lintOptions, but thats a breaking change, so will do that later
32-
lintoptions?: LintOptions;
32+
lintoptions?: ILintOptions;
3333
}
3434

3535
// lint options,this is the same as tsLint uses all paths will be from basepath
36-
export interface LintOptions {
36+
export interface ILintOptions {
3737
fix?: boolean;
3838
formatter?: string;
3939
formattersDirectory?: string | null;
4040
rulesDirectory?: string | null;
4141
}
4242

4343
// extended internal options, needed for some interal usage
44-
export interface InternalTypeCheckerOptions extends TypeCheckerOptions {
44+
export interface IInternalTypeCheckerOptions extends ITypeCheckerOptions {
4545
type: TypecheckerRunType;
4646
tsConfigJsonContent?: any;
4747
quit?: boolean;
@@ -50,7 +50,7 @@ export interface InternalTypeCheckerOptions extends TypeCheckerOptions {
5050
// params used when calling worker to tell it what to do
5151
export interface IWorkerOptions {
5252
type: WorkerCommand;
53-
options?: InternalTypeCheckerOptions;
53+
options?: IInternalTypeCheckerOptions;
5454
}
5555

5656
// run options for worker

0 commit comments

Comments
 (0)