Skip to content

Commit a3fa7ad

Browse files
committed
Adding some typings in npm scripts
1 parent 63d0559 commit a3fa7ad

4 files changed

Lines changed: 17 additions & 2 deletions

File tree

build/jsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
"compilerOptions": {
33
"module": "commonjs",
44
"target": "es2017",
5-
"jsx": "preserve"
5+
"jsx": "preserve",
6+
"checkJs": true
67
},
78
"include": [
89
"**/*.js"

build/npm/postinstall.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ const path = require('path');
88
const fs = require('fs');
99
const yarn = process.platform === 'win32' ? 'yarn.cmd' : 'yarn';
1010

11+
/**
12+
* @param {string} location
13+
* @param {*} [opts]
14+
*/
1115
function yarnInstall(location, opts) {
1216
opts = opts || {};
1317
opts.cwd = location;

build/npm/update-all-grammars.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ const cp = require('child_process');
77
const fs = require('fs');
88
const path = require('path');
99

10+
/**
11+
* @param {string} location
12+
*/
1013
function updateGrammar(location) {
1114
const npm = process.platform === 'win32' ? 'npm.cmd' : 'npm';
1215
const result = cp.spawnSync(npm, ['run', 'update-grammar'], {

build/npm/update-grammar.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ var cson = require('cson-parser');
1212
var https = require('https');
1313
var url = require('url');
1414

15+
/**
16+
* @param {string} urlString
17+
*/
1518
function getOptions(urlString) {
1619
var _url = url.parse(urlString);
1720
var headers = {
1821
'User-Agent': 'VSCode'
1922
};
2023
var token = process.env['GITHUB_TOKEN'];
2124
if (token) {
22-
headers['Authorization'] = 'token ' + token
25+
headers['Authorization'] = 'token ' + token;
2326
}
2427
return {
2528
protocol: _url.protocol,
@@ -30,6 +33,10 @@ function getOptions(urlString) {
3033
};
3134
}
3235

36+
/**
37+
* @param {string} url
38+
* @param {number} redirectCount
39+
*/
3340
function download(url, redirectCount) {
3441
return new Promise((c, e) => {
3542
var content = '';

0 commit comments

Comments
 (0)