Skip to content

Commit

Permalink
Fixes #141994: Address eslint problems
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdima committed Feb 2, 2022
1 parent de1ae9e commit cab9713
Show file tree
Hide file tree
Showing 22 changed files with 2,149 additions and 2,117 deletions.
13 changes: 7 additions & 6 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
**/build/*/**/*.js
**/dist/**/*.js
**/extensions/**/*.d.ts
**/extensions/**/build/**
**/extensions/**/colorize-fixtures/**
**/extensions/css-language-features/server/test/pathCompletionFixtures/**
**/extensions/html-language-features/server/lib/jquery.d.ts
**/extensions/html-language-features/server/src/test/pathCompletionFixtures/**
**/extensions/markdown-language-features/media/**
**/extensions/markdown-language-features/notebook-out/**
**/extensions/markdown-math/notebook-out/**
Expand All @@ -12,21 +15,19 @@
**/extensions/vscode-api-tests/testWorkspace2/**
**/fixtures/**
**/node_modules/**
**/out-*/**/*.js
**/out-editor-*/**
**/out/**/*.js
**/src/**/dompurify.js
**/src/**/marked.js
**/src/**/semver.js
**/src/typings/**/*.d.ts
**/src/vs/*/**/*.d.ts
**/src/vs/base/test/common/filters.perf.data.js
**/src/vs/css.build.js
**/src/vs/css.js
**/src/vs/loader.js
**/src/vs/nls.build.js
**/src/vs/nls.js
**/test/unit/assert.js
**/typings/**

# todo - fix these
**/test/**/*.js
**/build/*/**/*.ts
**/scripts/**/*.js
**/extensions/search-result/syntaxes/generateTMLanguage.js
3 changes: 2 additions & 1 deletion build/azure-pipelines/common/createAsset.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function getPlatform(product, os, arch, type) {
switch (os) {
case 'win32':
switch (product) {
case 'client':
case 'client': {
const asset = arch === 'ia32' ? 'win32' : `win32-${arch}`;
switch (type) {
case 'archive':
Expand All @@ -32,6 +32,7 @@ function getPlatform(product, os, arch, type) {
default:
throw new Error(`Unrecognized: ${product} ${os} ${arch} ${type}`);
}
}
case 'server':
if (arch === 'arm64') {
throw new Error(`Unrecognized: ${product} ${os} ${arch} ${type}`);
Expand Down
3 changes: 2 additions & 1 deletion build/azure-pipelines/common/createAsset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function getPlatform(product: string, os: string, arch: string, type: string): s
switch (os) {
case 'win32':
switch (product) {
case 'client':
case 'client': {
const asset = arch === 'ia32' ? 'win32' : `win32-${arch}`;
switch (type) {
case 'archive':
Expand All @@ -47,6 +47,7 @@ function getPlatform(product: string, os: string, arch: string, type: string): s
default:
throw new Error(`Unrecognized: ${product} ${os} ${arch} ${type}`);
}
}
case 'server':
if (arch === 'arm64') {
throw new Error(`Unrecognized: ${product} ${os} ${arch} ${type}`);
Expand Down
3 changes: 2 additions & 1 deletion build/azure-pipelines/upload-nlsmetadata.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ function main() {
case 'nls.metadata.header.json':
parsedJson = { header: parsedJson };
break;
case 'nls.metadata.json':
case 'nls.metadata.json': {
// put nls.metadata.json content in Core NlsMetadata format
const modules = Object.keys(parsedJson);
const json = {
Expand All @@ -64,6 +64,7 @@ function main() {
}
parsedJson = json;
break;
}
}
key = 'vscode.' + file.relative.split('/')[0];
return { [key]: parsedJson };
Expand Down
3 changes: 2 additions & 1 deletion build/azure-pipelines/upload-nlsmetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function main(): Promise<void> {
parsedJson = { header: parsedJson };
break;

case 'nls.metadata.json':
case 'nls.metadata.json': {
// put nls.metadata.json content in Core NlsMetadata format
const modules = Object.keys(parsedJson);

Expand All @@ -83,6 +83,7 @@ function main(): Promise<void> {
}
parsedJson = json;
break;
}
}
key = 'vscode.' + file.relative.split('/')[0];
return { [key]: parsedJson };
Expand Down
4 changes: 2 additions & 2 deletions build/darwin/create-universal-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ async function main() {
await fs.writeJson(productJsonPath, productJson);
// Verify if native module architecture is correct
const findOutput = await (0, cross_spawn_promise_1.spawn)('find', [outAppPath, '-name', 'keytar.node']);
const lipoOutput = await (0, cross_spawn_promise_1.spawn)('lipo', ['-archs', findOutput.replace(/\n$/, "")]);
if (lipoOutput.replace(/\n$/, "") !== 'x86_64 arm64') {
const lipoOutput = await (0, cross_spawn_promise_1.spawn)('lipo', ['-archs', findOutput.replace(/\n$/, '')]);
if (lipoOutput.replace(/\n$/, '') !== 'x86_64 arm64') {
throw new Error(`Invalid arch, got : ${lipoOutput}`);
}
}
Expand Down
8 changes: 4 additions & 4 deletions build/darwin/create-universal-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ async function main() {
await fs.writeJson(productJsonPath, productJson);

// Verify if native module architecture is correct
const findOutput = await spawn('find', [outAppPath, '-name', 'keytar.node'])
const lipoOutput = await spawn('lipo', ['-archs', findOutput.replace(/\n$/, "")]);
if (lipoOutput.replace(/\n$/, "") !== 'x86_64 arm64') {
throw new Error(`Invalid arch, got : ${lipoOutput}`)
const findOutput = await spawn('find', [outAppPath, '-name', 'keytar.node']);
const lipoOutput = await spawn('lipo', ['-archs', findOutput.replace(/\n$/, '')]);
if (lipoOutput.replace(/\n$/, '') !== 'x86_64 arm64') {
throw new Error(`Invalid arch, got : ${lipoOutput}`);
}
}

Expand Down
16 changes: 12 additions & 4 deletions build/linux/libcxx-fetcher.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
// Can be removed once https://github.com/electron/electron-rebuild/pull/703 is available.
'use strict';
Object.defineProperty(exports, "__esModule", { value: true });
Expand All @@ -10,10 +14,12 @@ const packageJSON = require("../../package.json");
const get_1 = require("@electron/get");
const d = debug('libcxx-fetcher');
async function downloadLibcxxHeaders(outDir, electronVersion, lib_name) {
if (await fs.pathExists(path.resolve(outDir, 'include')))
if (await fs.pathExists(path.resolve(outDir, 'include'))) {
return;
if (!await fs.pathExists(outDir))
}
if (!await fs.pathExists(outDir)) {
await fs.mkdirp(outDir);
}
d(`downloading ${lib_name}_headers`);
const headers = await (0, get_1.downloadArtifact)({
version: electronVersion,
Expand All @@ -25,10 +31,12 @@ async function downloadLibcxxHeaders(outDir, electronVersion, lib_name) {
}
exports.downloadLibcxxHeaders = downloadLibcxxHeaders;
async function downloadLibcxxObjects(outDir, electronVersion, targetArch = 'x64') {
if (await fs.pathExists(path.resolve(outDir, 'libc++.a')))
if (await fs.pathExists(path.resolve(outDir, 'libc++.a'))) {
return;
if (!await fs.pathExists(outDir))
}
if (!await fs.pathExists(outDir)) {
await fs.mkdirp(outDir);
}
d(`downloading libcxx-objects-linux-${targetArch}`);
const objects = await (0, get_1.downloadArtifact)({
version: electronVersion,
Expand Down
21 changes: 17 additions & 4 deletions build/linux/libcxx-fetcher.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

// Can be removed once https://github.com/electron/electron-rebuild/pull/703 is available.

'use strict';
Expand All @@ -12,8 +17,12 @@ import { downloadArtifact } from '@electron/get';
const d = debug('libcxx-fetcher');

export async function downloadLibcxxHeaders(outDir: string, electronVersion: string, lib_name: string): Promise<void> {
if (await fs.pathExists(path.resolve(outDir, 'include'))) return;
if (!await fs.pathExists(outDir)) await fs.mkdirp(outDir);
if (await fs.pathExists(path.resolve(outDir, 'include'))) {
return;
}
if (!await fs.pathExists(outDir)) {
await fs.mkdirp(outDir);
}

d(`downloading ${lib_name}_headers`);
const headers = await downloadArtifact({
Expand All @@ -27,8 +36,12 @@ export async function downloadLibcxxHeaders(outDir: string, electronVersion: str
}

export async function downloadLibcxxObjects(outDir: string, electronVersion: string, targetArch: string = 'x64'): Promise<void> {
if (await fs.pathExists(path.resolve(outDir, 'libc++.a'))) return;
if (!await fs.pathExists(outDir)) await fs.mkdirp(outDir);
if (await fs.pathExists(path.resolve(outDir, 'libc++.a'))) {
return;
}
if (!await fs.pathExists(outDir)) {
await fs.mkdirp(outDir);
}

d(`downloading libcxx-objects-linux-${targetArch}`);
const objects = await downloadArtifact({
Expand Down
5 changes: 5 additions & 0 deletions extensions/search-result/syntaxes/generateTMLanguage.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/

// @ts-check

const mappings = [
Expand Down
Loading

0 comments on commit cab9713

Please sign in to comment.