提交 2141437f 编写于 作者: J Johannes Rieken

fix eslint issues in build/gulpfile.*

上级 84013e2e
...@@ -17,14 +17,14 @@ const compilation = require('./lib/compilation'); ...@@ -17,14 +17,14 @@ const compilation = require('./lib/compilation');
const monacoapi = require('./monaco/api'); const monacoapi = require('./monaco/api');
const fs = require('fs'); const fs = require('fs');
var root = path.dirname(__dirname); let root = path.dirname(__dirname);
var sha1 = util.getVersion(root); let sha1 = util.getVersion(root);
var semver = require('./monaco/package.json').version; let semver = require('./monaco/package.json').version;
var headerVersion = semver + '(' + sha1 + ')'; let headerVersion = semver + '(' + sha1 + ')';
// Build // Build
var editorEntryPoints = [ let editorEntryPoints = [
{ {
name: 'vs/editor/editor.main', name: 'vs/editor/editor.main',
include: [], include: [],
...@@ -40,11 +40,11 @@ var editorEntryPoints = [ ...@@ -40,11 +40,11 @@ var editorEntryPoints = [
} }
]; ];
var editorResources = [ let editorResources = [
'out-editor-build/vs/base/browser/ui/codiconLabel/**/*.ttf' 'out-editor-build/vs/base/browser/ui/codiconLabel/**/*.ttf'
]; ];
var BUNDLED_FILE_HEADER = [ let BUNDLED_FILE_HEADER = [
'/*!-----------------------------------------------------------', '/*!-----------------------------------------------------------',
' * Copyright (c) Microsoft Corporation. All rights reserved.', ' * Copyright (c) Microsoft Corporation. All rights reserved.',
' * Version: ' + headerVersion, ' * Version: ' + headerVersion,
...@@ -263,7 +263,7 @@ const finalEditorResourcesTask = task.define('final-editor-resources', () => { ...@@ -263,7 +263,7 @@ const finalEditorResourcesTask = task.define('final-editor-resources', () => {
// package.json // package.json
gulp.src('build/monaco/package.json') gulp.src('build/monaco/package.json')
.pipe(es.through(function (data) { .pipe(es.through(function (data) {
var json = JSON.parse(data.contents.toString()); let json = JSON.parse(data.contents.toString());
json.private = false; json.private = false;
data.contents = Buffer.from(JSON.stringify(json, null, ' ')); data.contents = Buffer.from(JSON.stringify(json, null, ' '));
this.emit('data', data); this.emit('data', data);
...@@ -307,10 +307,10 @@ const finalEditorResourcesTask = task.define('final-editor-resources', () => { ...@@ -307,10 +307,10 @@ const finalEditorResourcesTask = task.define('final-editor-resources', () => {
return; return;
} }
var relativePathToMap = path.relative(path.join(data.relative), path.join('min-maps', data.relative + '.map')); let relativePathToMap = path.relative(path.join(data.relative), path.join('min-maps', data.relative + '.map'));
var strContents = data.contents.toString(); let strContents = data.contents.toString();
var newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/'); let newStr = '//# sourceMappingURL=' + relativePathToMap.replace(/\\/g, '/');
strContents = strContents.replace(/\/\/# sourceMappingURL=[^ ]+$/, newStr); strContents = strContents.replace(/\/\/# sourceMappingURL=[^ ]+$/, newStr);
data.contents = Buffer.from(strContents); data.contents = Buffer.from(strContents);
......
...@@ -118,7 +118,7 @@ function mixinServer(watch) { ...@@ -118,7 +118,7 @@ function mixinServer(watch) {
const packageJSONPath = path.join(path.dirname(__dirname), 'package.json'); const packageJSONPath = path.join(path.dirname(__dirname), 'package.json');
function exec(cmdLine) { function exec(cmdLine) {
console.log(cmdLine); console.log(cmdLine);
cp.execSync(cmdLine, { stdio: "inherit" }); cp.execSync(cmdLine, { stdio: 'inherit' });
} }
function checkout() { function checkout() {
const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath).toString()); const packageJSON = JSON.parse(fs.readFileSync(packageJSONPath).toString());
......
...@@ -121,9 +121,9 @@ gulp.task(minifyVSCodeTask); ...@@ -121,9 +121,9 @@ gulp.task(minifyVSCodeTask);
* @return {Object} A map of paths to checksums. * @return {Object} A map of paths to checksums.
*/ */
function computeChecksums(out, filenames) { function computeChecksums(out, filenames) {
var result = {}; let result = {};
filenames.forEach(function (filename) { filenames.forEach(function (filename) {
var fullPath = path.join(process.cwd(), out, filename); let fullPath = path.join(process.cwd(), out, filename);
result[filename] = computeChecksum(fullPath); result[filename] = computeChecksum(fullPath);
}); });
return result; return result;
...@@ -136,9 +136,9 @@ function computeChecksums(out, filenames) { ...@@ -136,9 +136,9 @@ function computeChecksums(out, filenames) {
* @return {string} The checksum for `filename`. * @return {string} The checksum for `filename`.
*/ */
function computeChecksum(filename) { function computeChecksum(filename) {
var contents = fs.readFileSync(filename); let contents = fs.readFileSync(filename);
var hash = crypto let hash = crypto
.createHash('md5') .createHash('md5')
.update(contents) .update(contents)
.digest('base64') .digest('base64')
...@@ -428,7 +428,7 @@ gulp.task('vscode-translations-pull', function () { ...@@ -428,7 +428,7 @@ gulp.task('vscode-translations-pull', function () {
}); });
gulp.task('vscode-translations-import', function () { gulp.task('vscode-translations-import', function () {
var options = minimist(process.argv.slice(2), { let options = minimist(process.argv.slice(2), {
string: 'location', string: 'location',
default: { default: {
location: '../vscode-translations-import' location: '../vscode-translations-import'
......
...@@ -23,7 +23,7 @@ const commit = util.getVersion(root); ...@@ -23,7 +23,7 @@ const commit = util.getVersion(root);
const linuxPackageRevision = Math.floor(new Date().getTime() / 1000); const linuxPackageRevision = Math.floor(new Date().getTime() / 1000);
function getDebPackageArch(arch) { function getDebPackageArch(arch) {
return { x64: 'amd64', arm: 'armhf', arm64: "arm64" }[arch]; return { x64: 'amd64', arm: 'armhf', arm64: 'arm64' }[arch];
} }
function prepareDebPackage(arch) { function prepareDebPackage(arch) {
...@@ -117,7 +117,7 @@ function getRpmBuildPath(rpmArch) { ...@@ -117,7 +117,7 @@ function getRpmBuildPath(rpmArch) {
} }
function getRpmPackageArch(arch) { function getRpmPackageArch(arch) {
return { x64: 'x86_64', arm: 'armhf', arm64: "arm64" }[arch]; return { x64: 'x86_64', arm: 'armhf', arm64: 'arm64' }[arch];
} }
function prepareRpmPackage(arch) { function prepareRpmPackage(arch) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册