1
1
#!/usr/bin/env node
2
2
'use strict'
3
3
4
- const childProcess = require ( 'child_process' )
5
4
const fs = require ( 'fs' )
6
5
const path = require ( 'path' )
7
6
const tslint = require ( 'tslint' )
@@ -36,20 +35,6 @@ if (inFile) {
36
35
apiPromise = fetchDocs ( )
37
36
}
38
37
39
- const typeCheck = ( ) => {
40
- const tscExec = path . resolve ( require . resolve ( 'typescript' ) , '../../bin/tsc' )
41
- const tscChild = childProcess . spawn ( 'node' , [ tscExec , '--project' , 'tsconfig.json' ] , {
42
- cwd : path . resolve ( __dirname , 'test-smoke/electron' )
43
- } )
44
- tscChild . stdout . on ( 'data' , d => console . log ( d . toString ( ) ) )
45
- tscChild . stderr . on ( 'data' , d => console . error ( d . toString ( ) ) )
46
- tscChild . on ( 'exit' , ( tscStatus ) => {
47
- if ( tscStatus !== 0 ) {
48
- process . exit ( tscStatus )
49
- }
50
- } )
51
- }
52
-
53
38
apiPromise . then ( API => {
54
39
return JSON . parse ( JSON . stringify ( API ) )
55
40
} ) . then ( API => {
@@ -63,9 +48,6 @@ apiPromise.then(API => {
63
48
64
49
if ( result . failureCount === 0 ) {
65
50
fs . writeFileSync ( outFile , output )
66
- fs . writeFileSync ( path . resolve ( __dirname , 'test-smoke/electron/index.d.ts' ) , output )
67
-
68
- typeCheck ( )
69
51
} else {
70
52
console . error ( 'Failed to lint electron.d.ts' )
71
53
result . failures . forEach ( failure => {
@@ -75,11 +57,6 @@ apiPromise.then(API => {
75
57
console . log ( failure )
76
58
} )
77
59
78
- // Save file for debugging purpsoses
79
- const debugFile = path . resolve ( __dirname , 'test-smoke/electron/index.d.ts' )
80
- fs . writeFileSync ( debugFile , output )
81
- console . log ( `See ${ debugFile } ` )
82
-
83
60
process . exit ( 1 )
84
61
}
85
62
} )
0 commit comments