Skip to content

Commit 5e41d2a

Browse files
committed
enable checkJS
1 parent a36ef3d commit 5e41d2a

20 files changed

Lines changed: 71 additions & 24 deletions

build/builtin/browser-main.js

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

1515
function readJson(filePath) {
16+
//@ts-ignore review
1617
return JSON.parse(fs.readFileSync(filePath));
1718
}
1819

build/gulpfile.editor.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ var File = require('vinyl');
1212

1313
var root = path.dirname(__dirname);
1414
var sha1 = util.getVersion(root);
15+
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
1516
var semver = require('./monaco/package.json').version;
1617
var headerVersion = semver + '(' + sha1 + ')';
1718

@@ -79,7 +80,8 @@ gulp.task('optimize-editor', ['clean-optimized-editor', 'compile-client-build'],
7980
bundleLoader: false,
8081
header: BUNDLED_FILE_HEADER,
8182
bundleInfo: true,
82-
out: 'out-editor'
83+
out: 'out-editor',
84+
languages: undefined
8385
}));
8486

8587
gulp.task('clean-minified-editor', util.rimraf('out-editor-min'));
@@ -155,6 +157,7 @@ gulp.task('editor-distro', ['clean-editor-distro', 'minify-editor', 'optimize-ed
155157
});
156158

157159
gulp.task('analyze-editor-distro', function() {
160+
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
158161
var bundleInfo = require('../out-editor/bundleInfo.json');
159162
var graph = bundleInfo.graph;
160163
var bundles = bundleInfo.bundles;

build/gulpfile.extensions.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,11 @@ const tasks = compilations.map(function (tsconfigFile) {
9494
sourceRoot: '../src'
9595
}))
9696
.pipe(tsFilter.restore)
97+
// @ts-ignore review
9798
.pipe(build ? nlsDev.createAdditionalLanguageFiles(languages, i18nPath, out) : es.through())
99+
// @ts-ignore review
98100
.pipe(build ? nlsDev.bundleMetaDataFiles(headerId, headerOut) : es.through())
101+
// @ts-ignore review
99102
.pipe(build ? nlsDev.bundleLanguageFiles() : es.through())
100103
.pipe(reporter.end(emitError));
101104

@@ -143,6 +146,7 @@ const tasks = compilations.map(function (tsconfigFile) {
143146
const watchInput = watcher(src, srcOpts);
144147

145148
return watchInput
149+
// @ts-ignore review
146150
.pipe(util.incremental(() => pipeline(true), input))
147151
.pipe(gulp.dest(out));
148152
});

build/gulpfile.hygiene.js

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ gulp.task('tslint', () => {
151151

152152
return vfs.src(all, { base: '.', follow: true, allowEmpty: true })
153153
.pipe(filter(tslintFilter))
154-
.pipe(gulptslint({ rulesDirectory: 'build/lib/tslint' }))
155-
.pipe(gulptslint.report(options));
154+
.pipe(gulptslint.default({ rulesDirectory: 'build/lib/tslint' }))
155+
.pipe(gulptslint.default.report(options));
156156
});
157157

158158
const hygiene = exports.hygiene = (some, options) => {
@@ -202,6 +202,11 @@ const hygiene = exports.hygiene = (some, options) => {
202202
verify: true,
203203
tsfmt: true,
204204
// verbose: true
205+
// keep checkJS happy
206+
editorconfig: undefined,
207+
replace: undefined,
208+
tsconfig: undefined,
209+
tslint: undefined
205210
}).then(result => {
206211
if (result.error) {
207212
console.error(result.message);
@@ -227,9 +232,9 @@ const hygiene = exports.hygiene = (some, options) => {
227232

228233
const tsl = es.through(function (file) {
229234
const configuration = tslint.Configuration.findConfiguration(null, '.');
230-
const options = { formatter: 'json', rulesDirectory: 'build/lib/tslint' };
235+
const linterOptions = { fix: false, formatter: 'json', rulesDirectory: 'build/lib/tslint' };
231236
const contents = file.contents.toString('utf8');
232-
const linter = new tslint.Linter(options);
237+
const linter = new tslint.Linter(linterOptions);
233238
linter.lint(file.relative, contents, configuration.results);
234239
const result = linter.getResult();
235240

build/gulpfile.mixin.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ const util = require('./lib/util');
1414
const remote = require('gulp-remote-src');
1515
const zip = require('gulp-vinyl-zip');
1616
const assign = require('object-assign');
17+
18+
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
1719
const pkg = require('../package.json');
1820

1921
gulp.task('mixin', function () {
@@ -54,6 +56,7 @@ gulp.task('mixin', function () {
5456
.pipe(util.rebase(2))
5557
.pipe(productJsonFilter)
5658
.pipe(buffer())
59+
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
5760
.pipe(json(o => assign({}, require('../product.json'), o)))
5861
.pipe(productJsonFilter.restore);
5962

build/gulpfile.vscode.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ const common = require('./lib/optimize');
2727
const nlsDev = require('vscode-nls-dev');
2828
const root = path.dirname(__dirname);
2929
const commit = util.getVersion(root);
30+
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
3031
const packageJson = require('../package.json');
32+
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
3133
const product = require('../product.json');
3234
const crypto = require('crypto');
3335
const i18n = require('./lib/i18n');
@@ -37,15 +39,16 @@ const getElectronVersion = require('./lib/electron').getElectronVersion;
3739
// const createAsar = require('./lib/asar').createAsar;
3840

3941
const productionDependencies = deps.getProductionDependencies(path.dirname(__dirname));
42+
//@ts-ignore review
4043
const baseModules = Object.keys(process.binding('natives')).filter(n => !/^_|\//.test(n));
4144
const nodeModules = ['electron', 'original-fs']
4245
.concat(Object.keys(product.dependencies || {}))
4346
.concat(_.uniq(productionDependencies.map(d => d.name)))
4447
.concat(baseModules);
4548

4649
// Build
47-
48-
const builtInExtensions = require('./builtInExtensions');
50+
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
51+
const builtInExtensions = require('./builtInExtensions.json');
4952

5053
const excludedExtensions = [
5154
'vscode-api-tests',
@@ -104,6 +107,8 @@ gulp.task('optimize-vscode', ['clean-optimized-vscode', 'compile-build', 'compil
104107
header: BUNDLED_FILE_HEADER,
105108
out: 'out-vscode',
106109
languages: languages,
110+
// @ts-ignore review
111+
bundleInfo: undefined
107112
}));
108113

109114

@@ -245,6 +250,7 @@ function packageTask(platform, arch, opts) {
245250
// // TODO@Dirk: this filter / buffer is here to make sure the nls.json files are buffered
246251
.pipe(nlsFilter)
247252
.pipe(buffer())
253+
//@ts-ignore review
248254
.pipe(nlsDev.createAdditionalLanguageFiles(languages, path.join(__dirname, '..', 'i18n')))
249255
.pipe(nlsFilter.restore);
250256
}));
@@ -297,6 +303,7 @@ function packageTask(platform, arch, opts) {
297303
.pipe(util.cleanNodeModule('native-is-elevated', ['binding.gyp', 'build/**', 'src/**', 'deps/**'], ['**/*.node']))
298304
.pipe(util.cleanNodeModule('native-watchdog', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
299305
.pipe(util.cleanNodeModule('spdlog', ['binding.gyp', 'build/**', 'deps/**', 'src/**', 'test/**'], ['**/*.node']))
306+
//@ts-ignore review
300307
.pipe(util.cleanNodeModule('jschardet', ['dist/**']))
301308
.pipe(util.cleanNodeModule('windows-foreground-love', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
302309
.pipe(util.cleanNodeModule('windows-process-tree', ['binding.gyp', 'build/**', 'src/**'], ['**/*.node']))
@@ -439,6 +446,7 @@ gulp.task('vscode-translations-pull', function () {
439446
gulp.task('vscode-translations-import', function () {
440447
[...i18n.defaultLanguages, ...i18n.extraLanguages].forEach(language => {
441448
gulp.src(`../vscode-localization/${language.id}/build/*/*.xlf`)
449+
//@ts-ignore review
442450
.pipe(i18n.prepareI18nFiles(language))
443451
.pipe(vfs.dest(`./i18n/${language.folderName}`));
444452
gulp.src(`../vscode-localization/${language.id}/setup/*/*.xlf`)
@@ -470,6 +478,7 @@ gulp.task('upload-vscode-sourcemaps', ['minify-vscode'], () => {
470478
const allConfigDetailsPath = path.join(os.tmpdir(), 'configuration.json');
471479
gulp.task('upload-vscode-configuration', ['generate-vscode-configuration'], () => {
472480
const branch = process.env.BUILD_SOURCEBRANCH;
481+
//@ts-ignore review
473482
if (!branch.endsWith('/master') && branch.indexOf('/release/') < 0) {
474483
console.log(`Only runs on master and release branches, not ${branch}`);
475484
return;

build/gulpfile.vscode.linux.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ const shell = require('gulp-shell');
1212
const es = require('event-stream');
1313
const vfs = require('vinyl-fs');
1414
const util = require('./lib/util');
15+
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
1516
const packageJson = require('../package.json');
17+
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
1618
const product = require('../product.json');
17-
const rpmDependencies = require('../resources/linux/rpm/dependencies');
19+
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
20+
const rpmDependencies = require('../resources/linux/rpm/dependencies.json');
1821

1922
const linuxPackageRevision = Math.floor(new Date().getTime() / 1000);
2023

build/gulpfile.vscode.win32.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ const assert = require('assert');
1111
const cp = require('child_process');
1212
const _7z = require('7zip')['7z'];
1313
const util = require('./lib/util');
14+
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
1415
const pkg = require('../package.json');
16+
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
1517
const product = require('../product.json');
1618
const vfs = require('vinyl-fs');
1719

build/lib/builtInExtensions.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ const ext = require('./extensions');
1717
const util = require('gulp-util');
1818

1919
const root = path.dirname(path.dirname(__dirname));
20-
const builtInExtensions = require('../builtInExtensions');
20+
// @ts-ignore Microsoft/TypeScript#21262 complains about a require of a JSON file
21+
const builtInExtensions = require('../builtInExtensions.json');
2122
const controlFilePath = path.join(os.homedir(), '.vscode-oss-dev', 'extensions', 'control.json');
2223

2324
function getExtensionPath(extension) {
@@ -34,6 +35,7 @@ function isUpToDate(extension) {
3435
const packageContents = fs.readFileSync(packagePath);
3536

3637
try {
38+
//@ts-ignore review
3739
const diskVersion = JSON.parse(packageContents).version;
3840
return (diskVersion === extension.version);
3941
} catch (err) {

build/lib/bundle.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,11 @@ interface ILoaderPluginReqFunc {
4444

4545
export interface IEntryPoint {
4646
name: string;
47-
include: string[];
48-
exclude: string[];
47+
include?: string[];
48+
exclude?: string[];
4949
prepend: string[];
50-
append: string[];
51-
dest: string;
50+
append?: string[];
51+
dest?: string;
5252
}
5353

5454
interface IEntryPointMap {

0 commit comments

Comments
 (0)