lint: Add proper linting for react
This commit is contained in:
committed by
Andrew Eisenberg
parent
db6aadbf93
commit
bb28dafc43
152
common/config/rush/pnpm-lock.yaml
generated
152
common/config/rush/pnpm-lock.yaml
generated
@@ -44,6 +44,7 @@ dependencies:
|
||||
classnames: 2.2.6
|
||||
css-loader: 3.1.0_webpack@4.42.0
|
||||
eslint: 6.8.0
|
||||
eslint-plugin-react: 7.19.0_eslint@6.8.0
|
||||
fs-extra: 8.1.0
|
||||
glob: 7.1.6
|
||||
glob-promise: 3.4.0_glob@7.1.6
|
||||
@@ -101,6 +102,13 @@ packages:
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-PX4y5xQUvy0fnEVHrYOarRPXVWafSjTW9T0Hab8gVIawpl2Sj0ORyrygANq+KjcNlSSTw0YCLSNA8OyZ1I4yEg==
|
||||
/@babel/runtime-corejs3/7.9.2:
|
||||
dependencies:
|
||||
core-js-pure: 3.6.4
|
||||
regenerator-runtime: 0.13.5
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-HHxmgxbIzOfFlZ+tdeRKtaxWOMUoCG5Mu3wKeUmOxjYrwb3AAHgnmtCUbPPK11/raIWLIBK250t8E2BPO0p7jA==
|
||||
/@gulp-sourcemaps/identity-map/1.0.2:
|
||||
dependencies:
|
||||
acorn: 5.7.4
|
||||
@@ -1036,6 +1044,16 @@ packages:
|
||||
node: '>=0.10.0'
|
||||
resolution:
|
||||
integrity: sha1-p5SvDAWrF1KEbudTofIRoFugxE8=
|
||||
/array-includes/3.1.1:
|
||||
dependencies:
|
||||
define-properties: 1.1.3
|
||||
es-abstract: 1.17.4
|
||||
is-string: 1.0.5
|
||||
dev: false
|
||||
engines:
|
||||
node: '>= 0.4'
|
||||
resolution:
|
||||
integrity: sha512-c2VXaCHl7zPsvpkFsw4nxvFie4fh1ur9bpcgsVkIjqn0H/Xwdg+7fv3n2r/isyS8EBj5b06M9kHyZuIr4El6WQ==
|
||||
/array-initial/1.1.0:
|
||||
dependencies:
|
||||
array-slice: 1.1.0
|
||||
@@ -1773,6 +1791,11 @@ packages:
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-7cjuUME+p+S3HZlbllgsn2CDwS+5eCCX16qBgNC4jgSTf49qR1VKy/Zhl400m0IQXl/bPGEVqncgUUMjrr4s8A==
|
||||
/core-js-pure/3.6.4:
|
||||
dev: false
|
||||
requiresBuild: true
|
||||
resolution:
|
||||
integrity: sha512-epIhRLkXdgv32xIUFaaAry2wdxZYBi6bgM7cB136dzzXXa+dFyRLTZeLUJxnd8ShrmyVXBub63n2NHo2JAt8Cw==
|
||||
/core-util-is/1.0.2:
|
||||
dev: false
|
||||
resolution:
|
||||
@@ -2079,6 +2102,14 @@ packages:
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-kqag/Nl+f3GwyK25fhUMYj81BUOrZ9IuJsjIcDE5icNM9FJHAVm3VcUDxdLPoQtTuUylWm6ZIknYJwwaPxsUzg==
|
||||
/doctrine/2.1.0:
|
||||
dependencies:
|
||||
esutils: 2.0.3
|
||||
dev: false
|
||||
engines:
|
||||
node: '>=0.10.0'
|
||||
resolution:
|
||||
integrity: sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==
|
||||
/doctrine/3.0.0:
|
||||
dependencies:
|
||||
esutils: 2.0.3
|
||||
@@ -2323,6 +2354,28 @@ packages:
|
||||
node: '>=0.8.0'
|
||||
resolution:
|
||||
integrity: sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
|
||||
/eslint-plugin-react/7.19.0_eslint@6.8.0:
|
||||
dependencies:
|
||||
array-includes: 3.1.1
|
||||
doctrine: 2.1.0
|
||||
eslint: 6.8.0
|
||||
has: 1.0.3
|
||||
jsx-ast-utils: 2.2.3
|
||||
object.entries: 1.1.1
|
||||
object.fromentries: 2.0.2
|
||||
object.values: 1.1.1
|
||||
prop-types: 15.7.2
|
||||
resolve: 1.15.1
|
||||
semver: 6.3.0
|
||||
string.prototype.matchall: 4.0.2
|
||||
xregexp: 4.3.0
|
||||
dev: false
|
||||
engines:
|
||||
node: '>=4'
|
||||
peerDependencies:
|
||||
eslint: ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0
|
||||
resolution:
|
||||
integrity: sha512-SPT8j72CGuAP+JFbT0sJHOB80TX/pu44gQ4vXH/cq+hQTiY2PuZ6IHkqXJV6x1b28GDdo1lbInjKUrrdUf0LOQ==
|
||||
/eslint-scope/4.0.3:
|
||||
dependencies:
|
||||
esrecurse: 4.2.1
|
||||
@@ -3397,6 +3450,16 @@ packages:
|
||||
node: '>=6.0.0'
|
||||
resolution:
|
||||
integrity: sha512-5fJMWEmikSYu0nv/flMc475MhGbB7TSPd/2IpFV4I4rMklboCH2rQjYY5kKiYGHqUF9gvaambupcJFFG9dvReg==
|
||||
/internal-slot/1.0.2:
|
||||
dependencies:
|
||||
es-abstract: 1.17.4
|
||||
has: 1.0.3
|
||||
side-channel: 1.0.2
|
||||
dev: false
|
||||
engines:
|
||||
node: '>= 0.4'
|
||||
resolution:
|
||||
integrity: sha512-2cQNfwhAfJIkU4KZPkDI+Gj5yNNnbqi40W9Gge6dfnk4TocEVm00B3bdiL+JINrbGJil2TeHvM4rETGzk/f/0g==
|
||||
/interpret/1.2.0:
|
||||
dev: false
|
||||
engines:
|
||||
@@ -3630,6 +3693,12 @@ packages:
|
||||
node: '>=0.10.0'
|
||||
resolution:
|
||||
integrity: sha1-EtSj3U5o4Lec6428hBc66A2RykQ=
|
||||
/is-string/1.0.5:
|
||||
dev: false
|
||||
engines:
|
||||
node: '>= 0.4'
|
||||
resolution:
|
||||
integrity: sha512-buY6VNRjhQMiF1qWDouloZlQbRhDPCebwxSjxMjxgemYT46YMd2NR0/H+fBhEfWX4A/w9TBJ+ol+okqJKFE6vQ==
|
||||
/is-subdir/1.1.1:
|
||||
dependencies:
|
||||
better-path-resolve: 1.0.0
|
||||
@@ -3765,6 +3834,15 @@ packages:
|
||||
graceful-fs: 4.2.3
|
||||
resolution:
|
||||
integrity: sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=
|
||||
/jsx-ast-utils/2.2.3:
|
||||
dependencies:
|
||||
array-includes: 3.1.1
|
||||
object.assign: 4.1.0
|
||||
dev: false
|
||||
engines:
|
||||
node: '>=4.0'
|
||||
resolution:
|
||||
integrity: sha512-EdIHFMm+1BPynpKOpdPqiOsvnIrInRGJD7bzPZdPkjitQEqpdpUuFpq4T0npZFKTiB3RhWFdGN+oqOJIdhDhQA==
|
||||
/just-debounce/1.0.0:
|
||||
dev: false
|
||||
resolution:
|
||||
@@ -4607,6 +4685,28 @@ packages:
|
||||
node: '>=0.10.0'
|
||||
resolution:
|
||||
integrity: sha1-On+GgzS0B96gbaFtiNXNKeQ1/s8=
|
||||
/object.entries/1.1.1:
|
||||
dependencies:
|
||||
define-properties: 1.1.3
|
||||
es-abstract: 1.17.4
|
||||
function-bind: 1.1.1
|
||||
has: 1.0.3
|
||||
dev: false
|
||||
engines:
|
||||
node: '>= 0.4'
|
||||
resolution:
|
||||
integrity: sha512-ilqR7BgdyZetJutmDPfXCDffGa0/Yzl2ivVNpbx/g4UeWrCdRnFDUBrKJGLhGieRHDATnyZXWBeCb29k9CJysQ==
|
||||
/object.fromentries/2.0.2:
|
||||
dependencies:
|
||||
define-properties: 1.1.3
|
||||
es-abstract: 1.17.4
|
||||
function-bind: 1.1.1
|
||||
has: 1.0.3
|
||||
dev: false
|
||||
engines:
|
||||
node: '>= 0.4'
|
||||
resolution:
|
||||
integrity: sha512-r3ZiBH7MQppDJVLx6fhD618GKNG40CZYH9wgwdhKxBDDbQgjeWGGd4AtkZad84d291YxvWe7bJGuE65Anh0dxQ==
|
||||
/object.getownpropertydescriptors/2.1.0:
|
||||
dependencies:
|
||||
define-properties: 1.1.3
|
||||
@@ -4642,6 +4742,17 @@ packages:
|
||||
node: '>=0.10.0'
|
||||
resolution:
|
||||
integrity: sha1-b+NI8qx/oPlcpiEiZZkJaCW7A60=
|
||||
/object.values/1.1.1:
|
||||
dependencies:
|
||||
define-properties: 1.1.3
|
||||
es-abstract: 1.17.4
|
||||
function-bind: 1.1.1
|
||||
has: 1.0.3
|
||||
dev: false
|
||||
engines:
|
||||
node: '>= 0.4'
|
||||
resolution:
|
||||
integrity: sha512-WTa54g2K8iu0kmS/us18jEmdv1a4Wi//BZ/DTVYEcH0XhLM5NYdpDHja3gt57VrZLcNAO2WGA+KpWsDBaHt6eA==
|
||||
/once/1.4.0:
|
||||
dependencies:
|
||||
wrappy: 1.0.2
|
||||
@@ -5399,6 +5510,10 @@ packages:
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==
|
||||
/regenerator-runtime/0.13.5:
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-ZS5w8CpKFinUzOwW3c83oPeVXoNsrLsaCoLtJvAClH135j/R77RuymhiSErhm2lKcwSCIpmvIWSbDkIfAqKQlA==
|
||||
/regex-not/1.0.2:
|
||||
dependencies:
|
||||
extend-shallow: 3.0.2
|
||||
@@ -5408,6 +5523,15 @@ packages:
|
||||
node: '>=0.10.0'
|
||||
resolution:
|
||||
integrity: sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==
|
||||
/regexp.prototype.flags/1.3.0:
|
||||
dependencies:
|
||||
define-properties: 1.1.3
|
||||
es-abstract: 1.17.4
|
||||
dev: false
|
||||
engines:
|
||||
node: '>= 0.4'
|
||||
resolution:
|
||||
integrity: sha512-2+Q0C5g951OlYlJz6yu5/M33IcsESLlLfsyIaLJaG4FA2r4yP8MvVMJUUP/fVBkSpbbbZlS5gynbEWLipiiXiQ==
|
||||
/regexpp/2.0.1:
|
||||
dev: false
|
||||
engines:
|
||||
@@ -5715,6 +5839,13 @@ packages:
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-mRz/m/JVscCrkMyPqHc/bczi3OQHkLTqXHEFu0zDhK/qfv3UcOA4SVmRCLmos4bhjr9ekVQubj/R7waKapmiQg==
|
||||
/side-channel/1.0.2:
|
||||
dependencies:
|
||||
es-abstract: 1.17.4
|
||||
object-inspect: 1.7.0
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-7rL9YlPHg7Ancea1S96Pa8/QWb4BtXL/TZvS6B8XFetGBeuhAsfmUspK6DokBeZ64+Kj9TCNRD/30pVz1BvQNA==
|
||||
/sigmund/1.0.1:
|
||||
dev: false
|
||||
resolution:
|
||||
@@ -5983,6 +6114,17 @@ packages:
|
||||
node: '>=8'
|
||||
resolution:
|
||||
integrity: sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==
|
||||
/string.prototype.matchall/4.0.2:
|
||||
dependencies:
|
||||
define-properties: 1.1.3
|
||||
es-abstract: 1.17.4
|
||||
has-symbols: 1.0.1
|
||||
internal-slot: 1.0.2
|
||||
regexp.prototype.flags: 1.3.0
|
||||
side-channel: 1.0.2
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-N/jp6O5fMf9os0JU3E72Qhf590RSRZU/ungsL/qJUYVTNv7hTG0P/dbPjxINVN9jpscu3nzYwKESU3P3RY5tOg==
|
||||
/string.prototype.padend/3.1.0:
|
||||
dependencies:
|
||||
define-properties: 1.1.3
|
||||
@@ -6992,6 +7134,12 @@ packages:
|
||||
node: '>=4'
|
||||
resolution:
|
||||
integrity: sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==
|
||||
/xregexp/4.3.0:
|
||||
dependencies:
|
||||
'@babel/runtime-corejs3': 7.9.2
|
||||
dev: false
|
||||
resolution:
|
||||
integrity: sha512-7jXDIFXh5yJ/orPn4SXjuVrWWoi4Cr8jfV1eHv9CixKSbU+jY4mxfrBwAuDvupPNKpMUY+FeIqsVw/JLT9+B8g==
|
||||
/xtend/4.0.2:
|
||||
dev: false
|
||||
engines:
|
||||
@@ -7256,6 +7404,7 @@ packages:
|
||||
classnames: 2.2.6
|
||||
css-loader: 3.1.0_webpack@4.42.0
|
||||
eslint: 6.8.0
|
||||
eslint-plugin-react: 7.19.0_eslint@6.8.0
|
||||
fs-extra: 8.1.0
|
||||
glob: 7.1.6
|
||||
glob-promise: 3.4.0_glob@7.1.6
|
||||
@@ -7294,7 +7443,7 @@ packages:
|
||||
dev: false
|
||||
name: '@rush-temp/vscode-codeql'
|
||||
resolution:
|
||||
integrity: sha512-PvC3L2Tp+VYm+hMzTgXfdBJPLJopSQpVsT8Ym7kdIxZj/cyTWzO3A+n7HnrH5q/B4DJSRfiDwjp73GwjGhbteQ==
|
||||
integrity: sha512-R6CO9tHF5naHATAvu28jP69lPvY3WvU2zeF41QZMU5OIieppNnoWEAlLjcRLScZxCtA70356Jzk90hK/LHvMpA==
|
||||
tarball: 'file:projects/vscode-codeql.tgz'
|
||||
version: 0.0.0
|
||||
registry: ''
|
||||
@@ -7344,6 +7493,7 @@ specifiers:
|
||||
classnames: ~2.2.6
|
||||
css-loader: ~3.1.0
|
||||
eslint: ~6.8.0
|
||||
eslint-plugin-react: ~7.19.0
|
||||
fs-extra: ^8.1.0
|
||||
glob: ^7.1.4
|
||||
glob-promise: ^3.4.0
|
||||
|
||||
@@ -27,4 +27,4 @@
|
||||
"../../test",
|
||||
"../../**/view"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,9 +3,6 @@ module.exports = {
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
sourceType: 'module',
|
||||
ecmaFeatures: {
|
||||
modules: true,
|
||||
},
|
||||
project: ['tsconfig.json', './src/**/tsconfig.json'],
|
||||
},
|
||||
plugins: ['@typescript-eslint'],
|
||||
@@ -33,6 +30,7 @@ module.exports = {
|
||||
"SwitchCase": 1,
|
||||
"FunctionDeclaration": { "body": 1, "parameters": 1 }
|
||||
}],
|
||||
"@typescript-eslint/no-throw-literal": "error"
|
||||
"@typescript-eslint/no-throw-literal": "error",
|
||||
"no-useless-escape": 0
|
||||
},
|
||||
};
|
||||
|
||||
@@ -389,7 +389,7 @@
|
||||
"update-vscode": "node ./node_modules/vscode/bin/install",
|
||||
"postinstall": "node ./node_modules/vscode/bin/install",
|
||||
"format": "tsfmt -r",
|
||||
"lint": "eslint . --ext .ts,.tsx"
|
||||
"lint": "eslint src test --ext .ts,.tsx"
|
||||
},
|
||||
"dependencies": {
|
||||
"child-process-promise": "^2.2.1",
|
||||
@@ -465,6 +465,7 @@
|
||||
"sinon-chai": "~3.5.0",
|
||||
"@types/sinon-chai": "~3.2.3",
|
||||
"proxyquire": "~2.1.3",
|
||||
"@types/proxyquire": "~1.3.28"
|
||||
"@types/proxyquire": "~1.3.28",
|
||||
"eslint-plugin-react": "~7.19.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -430,21 +430,23 @@ class DatabaseItemImpl implements DatabaseItem {
|
||||
*/
|
||||
function eventFired<T>(event: vscode.Event<T>, timeoutMs = 1000): Promise<T | undefined> {
|
||||
return new Promise((res, _rej) => {
|
||||
let timeout: NodeJS.Timeout | undefined;
|
||||
let disposable: vscode.Disposable | undefined;
|
||||
function dispose() {
|
||||
if (timeout !== undefined) clearTimeout(timeout);
|
||||
if (disposable !== undefined) disposable.dispose();
|
||||
}
|
||||
disposable = event(e => {
|
||||
res(e);
|
||||
dispose();
|
||||
});
|
||||
timeout = setTimeout(() => {
|
||||
const timeout = setTimeout(() => {
|
||||
logger.log(`Waiting for event ${event} timed out after ${timeoutMs}ms`);
|
||||
res(undefined);
|
||||
dispose();
|
||||
}, timeoutMs);
|
||||
const disposable = event(e => {
|
||||
res(e);
|
||||
dispose();
|
||||
});
|
||||
function dispose() {
|
||||
if (timeout !== undefined) {
|
||||
clearTimeout(timeout);
|
||||
}
|
||||
if (disposable !== undefined) {
|
||||
disposable.dispose();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ export class QLTestDirectory extends QLTestNode {
|
||||
private createChildDirectory(name: string): QLTestDirectory {
|
||||
const existingChild = this._children.find((child) => child.name === name);
|
||||
if (existingChild !== undefined) {
|
||||
return <QLTestDirectory>existingChild;
|
||||
return existingChild as QLTestDirectory;
|
||||
}
|
||||
else {
|
||||
const newChild = new QLTestDirectory(path.join(this.path, name), name);
|
||||
@@ -87,6 +87,7 @@ export class QLTestFile extends QLTestNode {
|
||||
}
|
||||
|
||||
public finish(): void {
|
||||
/**/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -70,6 +70,16 @@ function getQuickQueriesDir(ctx: ExtensionContext): string {
|
||||
return queriesPath;
|
||||
}
|
||||
|
||||
|
||||
function updateQuickQueryDir(queriesDir: string, index: number, len: number) {
|
||||
workspace.updateWorkspaceFolders(
|
||||
index,
|
||||
len,
|
||||
{ uri: Uri.file(queriesDir), name: QUICK_QUERY_WORKSPACE_FOLDER_NAME }
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Show a buffer the user can enter a simple query into.
|
||||
*/
|
||||
@@ -79,14 +89,6 @@ export async function displayQuickQuery(ctx: ExtensionContext, cliServer: CodeQL
|
||||
const workspaceFolders = workspace.workspaceFolders || [];
|
||||
const queriesDir = await getQuickQueriesDir(ctx);
|
||||
|
||||
function updateQuickQueryDir(index: number, len: number) {
|
||||
workspace.updateWorkspaceFolders(
|
||||
index,
|
||||
len,
|
||||
{ uri: Uri.file(queriesDir), name: QUICK_QUERY_WORKSPACE_FOLDER_NAME }
|
||||
);
|
||||
}
|
||||
|
||||
// If there is already a quick query open, don't clobber it, just
|
||||
// show it.
|
||||
const existing = workspace.textDocuments.find(doc => path.basename(doc.uri.fsPath) === QUICK_QUERY_QUERY_NAME);
|
||||
@@ -107,16 +109,16 @@ export async function displayQuickQuery(ctx: ExtensionContext, cliServer: CodeQL
|
||||
if (workspace.workspaceFile === undefined) {
|
||||
const makeMultiRoot = await helpers.showBinaryChoiceDialog('Quick query requires multiple folders in the workspace. Reload workspace as multi-folder workspace?');
|
||||
if (makeMultiRoot) {
|
||||
updateQuickQueryDir(workspaceFolders.length, 0);
|
||||
updateQuickQueryDir(queriesDir, workspaceFolders.length, 0);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const index = workspaceFolders.findIndex(folder => folder.name === QUICK_QUERY_WORKSPACE_FOLDER_NAME)
|
||||
if (index === -1)
|
||||
updateQuickQueryDir(workspaceFolders.length, 0);
|
||||
updateQuickQueryDir(queriesDir, workspaceFolders.length, 0);
|
||||
else
|
||||
updateQuickQueryDir(index, 1);
|
||||
updateQuickQueryDir(queriesDir, index, 1);
|
||||
|
||||
// We're going to infer which qlpack to use from the current database
|
||||
const dbItem = await databaseUI.getDatabaseItem();
|
||||
|
||||
@@ -165,7 +165,7 @@ export class QLTestAdapter extends DisposableObject implements TestAdapter {
|
||||
}
|
||||
|
||||
private discoverTests(): void {
|
||||
this._tests.fire(<TestLoadStartedEvent>{ type: 'started' });
|
||||
this._tests.fire({ type: 'started' } as TestLoadStartedEvent);
|
||||
|
||||
const testDirectories = this.qlTestDiscovery.testDirectories;
|
||||
const children = testDirectories.map(
|
||||
@@ -178,10 +178,10 @@ export class QLTestAdapter extends DisposableObject implements TestAdapter {
|
||||
children
|
||||
};
|
||||
|
||||
this._tests.fire(<TestLoadFinishedEvent>{
|
||||
this._tests.fire({
|
||||
type: 'finished',
|
||||
suite: children.length > 0 ? testSuite : undefined
|
||||
});
|
||||
} as TestLoadFinishedEvent);
|
||||
}
|
||||
|
||||
public async run(tests: string[]): Promise<void> {
|
||||
@@ -194,17 +194,16 @@ export class QLTestAdapter extends DisposableObject implements TestAdapter {
|
||||
|
||||
this.runningTask = this.track(new CancellationTokenSource());
|
||||
|
||||
this._testStates.fire(<TestRunStartedEvent>{ type: 'started', tests: tests });
|
||||
|
||||
const testAdapter = this;
|
||||
this._testStates.fire({ type: 'started', tests: tests } as TestRunStartedEvent);
|
||||
|
||||
try {
|
||||
await this.runTests(tests, this.runningTask.token);
|
||||
}
|
||||
catch (e) {
|
||||
/**/
|
||||
}
|
||||
testAdapter._testStates.fire(<TestRunFinishedEvent>{ type: 'finished' });
|
||||
testAdapter.clearTask();
|
||||
this._testStates.fire({ type: 'finished' } as TestRunFinishedEvent);
|
||||
this.clearTask();
|
||||
}
|
||||
|
||||
private clearTask(): void {
|
||||
|
||||
@@ -6,6 +6,8 @@ import { DisposableObject, UIService } from 'semmle-vscode-utils';
|
||||
import { TestHub, TestController, TestAdapter, TestRunStartedEvent, TestRunFinishedEvent, TestEvent, TestSuiteEvent } from 'vscode-test-adapter-api';
|
||||
import { QLTestAdapter, getExpectedFile, getActualFile } from './test-adapter';
|
||||
|
||||
type VSCodeTestEvent = TestRunStartedEvent | TestRunFinishedEvent | TestSuiteEvent | TestEvent;
|
||||
|
||||
/**
|
||||
* Test event listener. Currently unused, but left in to keep the plumbing hooked up for future use.
|
||||
*/
|
||||
@@ -16,7 +18,8 @@ class QLTestListener extends DisposableObject {
|
||||
this.push(adapter.testStates(this.onTestStatesEvent, this));
|
||||
}
|
||||
|
||||
private onTestStatesEvent(_e: TestRunStartedEvent | TestRunFinishedEvent | TestSuiteEvent | TestEvent): void {
|
||||
private onTestStatesEvent(_e: VSCodeTestEvent): void {
|
||||
/**/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,8 +1,13 @@
|
||||
module.exports = {
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
},
|
||||
env: {
|
||||
browser: true
|
||||
},
|
||||
extends: [
|
||||
"plugin:react/recommended"
|
||||
],
|
||||
settings: {
|
||||
react: {
|
||||
version: 'detect'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ export class PathTable extends React.Component<PathTableProps, PathTableState> {
|
||||
const text = result.message.text || '[no text]';
|
||||
const msg: JSX.Element[] =
|
||||
result.relatedLocations === undefined ?
|
||||
[<span>{text}</span>] :
|
||||
[<span key="0">{text}</span>] :
|
||||
renderRelatedLocations(text, result.relatedLocations);
|
||||
|
||||
const currentResultExpanded = this.state.expanded[expansionIndex];
|
||||
|
||||
@@ -3,6 +3,6 @@ module.exports = {
|
||||
mocha: true
|
||||
},
|
||||
parserOptions: {
|
||||
project: 'tsconfig.json',
|
||||
project: './test/tsconfig.json',
|
||||
},
|
||||
}
|
||||
|
||||
8
extensions/ql-vscode/test/tsconfig.json
Normal file
8
extensions/ql-vscode/test/tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"include": [
|
||||
"**/*.ts"
|
||||
],
|
||||
"compilerOptions": {
|
||||
"noEmit": true
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user