Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build, tsint -> eslint, package upgrades #1609

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .azure-pipelines/common/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ steps:
versionSpec: "5.2.0"

- task: NodeTool@0
displayName: "Use Node 12.x"
displayName: "Install Node.js"
inputs:
versionSpec: 12.x
versionSpec: 18.16.x

- task: Npm@1
displayName: "npm install"
Expand Down
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
gulpfile.ts
.eslintrc.js
6 changes: 6 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
"extends": "@microsoft/eslint-config-azuretools",
"rules": {
"no-restricted-imports": "off",
}
};
2 changes: 1 addition & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"recommendations": [
"ms-vscode.vscode-typescript-tslint-plugin"
"dbaeumer.vscode-eslint"
]
}
4 changes: 1 addition & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@
".vscode-test": true,
"out": true
},
"files.associations": {
"tslint.json": "jsonc"
},
"files.associations": {},
"json.schemas": [
{
"fileMatch": [
Expand Down
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
{
"type": "npm",
"script": "lint",
"problemMatcher": "$tslint5"
"problemMatcher": "$eslint-stylish"
},
{
"type": "npm",
Expand Down
3 changes: 2 additions & 1 deletion .vscodeignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
**/*.map
build
dist/test/**
.eslintignore
.eslintrc.js
grammars/**
gulp*
images/*.svg
Expand All @@ -24,7 +26,6 @@ test-results.xml
test/**
tsconfig.json
tsd.json
tslint.json
typings/**
webpack.config*
*.vsix
Expand Down
5 changes: 3 additions & 2 deletions common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@ export const isWin32: boolean = os.platform() === 'win32';
export const isCaseSensitiveFileSystem: boolean = !isWin32;

let base = __dirname;
// eslint-disable-next-line no-constant-condition
while (true) {
let test = path.join(base, "assets");
const test = path.join(base, "assets");
if (fs.existsSync(test)) {
base = test;
break;
}
base = path.dirname(base);
assert(base != '', "Could not find base project path");
assert(base !== '', "Could not find base project path");
}
export const assetsPath = base;
export const basePath = path.join(assetsPath, "..");
Expand Down
36 changes: 31 additions & 5 deletions gulpfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

// tslint:disable:no-unsafe-any no-console prefer-template no-implicit-dependencies export-name

import { gulp_webpack } from '@microsoft/vscode-azext-dev';
import * as assert from 'assert';
import * as cp from 'child_process';
import * as fse from 'fs-extra';
Expand All @@ -14,7 +15,6 @@ import * as path from 'path';
import * as process from 'process';
import * as recursiveReadDir from 'recursive-readdir';
import * as shelljs from 'shelljs';
import { gulp_webpack } from 'vscode-azureextensiondev';
import { downloadAndUnzipVSCode, resolveCliPathFromVSCodeExecutablePath } from "vscode-test";
import { DEFAULT_TESTCASE_TIMEOUT_MS, langServerDotnetVersion, languageServerFolderName } from './common';
import { getTempFilePath } from './test/support/getTempFilePath';
Expand Down Expand Up @@ -96,22 +96,48 @@ async function test(): Promise<void> {
const vscodeExecutablePath = await downloadAndUnzipVSCode();
const cliPath = resolveCliPathFromVSCodeExecutablePath(vscodeExecutablePath);

const extensionsDirs = path.resolve('.vscode-test/extensions');
console.log("extensionsDirs: " + extensionsDirs);

const extensionInstallArguments = [
"--install-extension",
"ms-dotnettools.vscode-dotnet-runtime",
`--extensions-dir=${extensionsDirs}`,
];

const extensionListArguments = [
"--list-extensions",
"--show-versions",
`--extensions-dir=${extensionsDirs}`,
];

// Install .NET Install Tool as a dependency.
let result = cp.spawnSync(cliPath, extensionInstallArguments, {
console.log("Install .NET Install Tool as a dependency...");
console.log("cliPath: " + cliPath);
console.log("extensionInstallArguments: " + extensionInstallArguments);

//gulp_installVSCodeExtension("ms-dotnettools", "vscode-dotnet-runtime");
let result = cp.spawnSync(cliPath, extensionListArguments, {
encoding: "utf-8",
stdio: "inherit",
});
console.log("result.error: " + result.error);
console.log("result.output: " + result.output);

result = cp.spawnSync(cliPath, extensionInstallArguments, {
encoding: "utf-8",
stdio: "inherit",
});
console.log("result.error: " + result.error);
console.log("result.output: " + result.output);
if (result.status !== 0) {
throw new Error("Failed to install dotnet runtime extension");
} else {
console.log(".NET Install Tool installed successfully");
}

result = cp.spawnSync('node', ['./out/test/runTest.js'], { encoding: "utf-8", stdio: 'inherit', env });
if (result.status !== 0) {
var testsResult = cp.spawnSync('node', ['./out/test/runTest.js'], { encoding: "utf-8", stdio: 'inherit', env });
console.log("Tests result: " + testsResult.status);
if (testsResult.status !== 0) {
throw new Error("Tests failed");
}
}
Expand Down
Loading