Skip to content

Commit 838f402

Browse files
committed
1 parent 6dc27ec commit 838f402

8 files changed

Lines changed: 12 additions & 22 deletions

File tree

build/builtin/browser-main.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@ const builtInExtensionsPath = path.join(__dirname, '..', 'builtInExtensions.json
1414
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
1515

1616
function readJson(filePath) {
17-
//@ts-ignore review
18-
return JSON.parse(fs.readFileSync(filePath));
17+
return JSON.parse(fs.readFileSync(filePath, { encoding: 'utf8' }));
1918
}
2019

2120
function writeJson(filePath, obj) {

build/gulpfile.extensions.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,8 @@ const tasks = compilations.map(function (tsconfigFile) {
9494
sourceRoot: '../src'
9595
}))
9696
.pipe(tsFilter.restore)
97-
// @ts-ignore review
9897
.pipe(build ? nlsDev.createAdditionalLanguageFiles(languages, i18nPath, out) : es.through())
99-
// @ts-ignore review
10098
.pipe(build ? nlsDev.bundleMetaDataFiles(headerId, headerOut) : es.through())
101-
// @ts-ignore review
10299
.pipe(build ? nlsDev.bundleLanguageFiles() : es.through())
103100
.pipe(reporter.end(emitError));
104101

@@ -146,8 +143,7 @@ const tasks = compilations.map(function (tsconfigFile) {
146143
const watchInput = watcher(src, srcOpts);
147144

148145
return watchInput
149-
// @ts-ignore review
150-
.pipe(util.incremental(() => pipeline(true), input))
146+
.pipe(util.incremental(() => pipeline(), input))
151147
.pipe(gulp.dest(out));
152148
});
153149

build/gulpfile.vscode.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const getElectronVersion = require('./lib/electron').getElectronVersion;
3939
const createAsar = require('./lib/asar').createAsar;
4040

4141
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
42-
//@ts-ignore review
42+
// @ts-ignore
4343
const baseModules = Object.keys(process.binding('natives')).filter(n => !/^_|\//.test(n));
4444
const nodeModules = ['electron', 'original-fs']
4545
.concat(Object.keys(product.dependencies || {}))
@@ -107,7 +107,6 @@ gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compil
107107
header: BUNDLED_FILE_HEADER,
108108
out: 'out-vscode',
109109
languages: languages,
110-
// @ts-ignore review
111110
bundleInfo: undefined
112111
}));
113112

@@ -250,7 +249,6 @@ function packageTask(platform, arch, opts) {
250249
// // TODO@Dirk: this filter / buffer is here to make sure the nls.json files are buffered
251250
.pipe(nlsFilter)
252251
.pipe(buffer())
253-
//@ts-ignore review
254252
.pipe(nlsDev.createAdditionalLanguageFiles(languages, path.join(__dirname, '..', 'i18n')))
255253
.pipe(nlsFilter.restore);
256254
}));
@@ -303,7 +301,6 @@ function packageTask(platform, arch, opts) {
303301
.pipe(util.cleanNodeModule('native-is-elevated', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node']))
304302
.pipe(util.cleanNodeModule('native-watchdog', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
305303
.pipe(util.cleanNodeModule('spdlog', ['binding.gyp', 'build/**', 'deps/**', 'src/**', 'test/**'], ['**/*.node']))
306-
//@ts-ignore review
307304
.pipe(util.cleanNodeModule('jschardet', ['dist/**']))
308305
.pipe(util.cleanNodeModule('windows-foreground-love', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
309306
.pipe(util.cleanNodeModule('windows-process-tree', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
@@ -446,8 +443,7 @@ gulp.task('vscode-translations-pull', function () {
446443
gulp.task('vscode-translations-import', function () {
447444
[...i18n.defaultLanguages, ...i18n.extraLanguages].forEach(language => {
448445
gulp.src(`../vscode-localization/${language.id}/build/*/*.xlf`)
449-
//@ts-ignore review
450-
.pipe(i18n.prepareI18nFiles(language))
446+
.pipe(i18n.prepareI18nFiles())
451447
.pipe(vfs.dest(`./i18n/${language.folderName}`));
452448
gulp.src(`../vscode-localization/${language.id}/setup/*/*.xlf`)
453449
.pipe(i18n.prepareIslFiles(language, innoSetupConfig[language.id]))
@@ -478,8 +474,8 @@ gulp.task('upload-vscode-sourcemaps', ['minify-vscode'], () => {
478474
const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json');
479475
gulp.task('upload-vscode-configuration', ['generate-vscode-configuration'], () => {
480476
const branch = process.env.BUILD_SOURCEBRANCH;
481-
//@ts-ignore review
482-
if (!branch.endsWith('/master') && branch.indexOf('/release/') < 0) {
477+
478+
if (!/\/master$/.test(branch) && branch.indexOf('/release/') < 0) {
483479
console.log(`Only runs on master and release branches, not ${branch}`);
484480
return;
485481
}

build/lib/builtInExtensions.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ function isUpToDate(extension) {
3232
return false;
3333
}
3434

35-
const packageContents = fs.readFileSync(packagePath);
35+
const packageContents = fs.readFileSync(packagePath, { encoding: 'utf8' });
3636

3737
try {
38-
//@ts-ignore review
3938
const diskVersion = JSON.parse(packageContents).version;
4039
return (diskVersion === extension.version);
4140
} catch (err) {

build/lib/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ export function skipDirectories(): NodeJS.ReadWriteStream {
129129
});
130130
}
131131

132-
export function cleanNodeModule(name: string, excludes: string[], includes: string[]): NodeJS.ReadWriteStream {
132+
export function cleanNodeModule(name: string, excludes: string[], includes?: string[]): NodeJS.ReadWriteStream {
133133
const toGlob = (path: string) => '**/node_modules/' + name + (path ? '/' + path : '');
134134
const negate = (str: string) => '!' + str;
135135

build/lib/watch/watch-nsfw.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ function watch(root) {
3030
path: path,
3131
base: root
3232
});
33-
//@ts-ignore review
33+
//@ts-ignore
3434
file.event = type;
3535
result.emit('data', file);
3636
}

build/lib/watch/watch-win32.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function watch(root) {
2525
var child = cp.spawn(watcherPath, [root]);
2626

2727
child.stdout.on('data', function (data) {
28-
//@ts-ignore review
28+
// @ts-ignore
2929
var lines = data.toString('utf8').split('\n');
3030
for (var i = 0; i < lines.length; i++) {
3131
var line = lines[i].trim();
@@ -47,7 +47,7 @@ function watch(root) {
4747
path: changePathFull,
4848
base: root
4949
});
50-
//@ts-ignore review
50+
//@ts-ignore
5151
file.event = toChangeType(changeType);
5252
result.emit('data', file);
5353
}

build/npm/postinstall.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extensions.forEach(extension => yarnInstall(`extensions/${extension}`));
5050
function yarnInstallBuildDependencies() {
5151
// make sure we install the deps of build/lib/watch for the system installed
5252
// node, since that is the driver of gulp
53-
//@ts-ignore review
53+
//@ts-ignore
5454
const env = Object.assign({}, process.env);
5555
const watchPath = path.join(path.dirname(__dirname), 'lib', 'watch');
5656
const yarnrcPath = path.join(watchPath, '.yarnrc');

0 commit comments

Comments
 (0)