Skip to content
This repository was archived by the owner on Sep 17, 2021. It is now read-only.

Commit e7f3112

Browse files
committed
Adding tripple equal rule
1 parent 6a3f732 commit e7f3112

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/extension.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ export function activate(context: vscode.ExtensionContext) {
4646
},
4747

4848
resolveDebugConfiguration(folder: vscode.WorkspaceFolder | undefined, config: vscode.DebugConfiguration, token?: vscode.CancellationToken): vscode.ProviderResult<vscode.DebugConfiguration> {
49-
if (config && config.type == debuggerType) {
49+
if (config && config.type === debuggerType) {
5050
const targetUri: string = utils.getUrlFromConfig(folder, config);
51-
if (config.request && config.request.localeCompare('attach', 'en', { sensitivity: 'base' }) == 0) {
51+
if (config.request && config.request.localeCompare('attach', 'en', { sensitivity: 'base' }) === 0) {
5252
attach(context, /* viaConfig= */ true, targetUri);
5353
telemetryReporter.sendTelemetryEvent('launch/command/attach');
54-
} else if (config.request && config.request.localeCompare('launch', 'en', { sensitivity: 'base' }) == 0) {
54+
} else if (config.request && config.request.localeCompare('launch', 'en', { sensitivity: 'base' }) === 0) {
5555
launch(context, targetUri, config.chromePath);
5656
telemetryReporter.sendTelemetryEvent('launch/command/launch');
5757
}
@@ -86,7 +86,7 @@ async function launch(context: vscode.ExtensionContext, launchUrl?: string, chro
8686

8787
const target = JSON.parse(await utils.getURL(`http://${hostname}:${port}/json/new?${launchUrl}`));
8888

89-
if (!target || !target.webSocketDebuggerUrl || target.webSocketDebuggerUrl == '') {
89+
if (!target || !target.webSocketDebuggerUrl || target.webSocketDebuggerUrl === '') {
9090
vscode.window.showErrorMessage(`Could not find the launched Chrome tab: (${launchUrl}).`);
9191
telemetryReporter.sendTelemetryEvent('launch/error/tab_not_found', telemetryProps);
9292
attach(context, viaConfig, defaultUrl);
@@ -117,7 +117,7 @@ async function attach(context: vscode.ExtensionContext, viaConfig: boolean, targ
117117

118118
let targetWebsocketUrl = '';
119119
if (typeof targetUrl === 'string' && targetUrl.length > 0 && targetUrl !== defaultUrl) {
120-
const matches = items.filter(i => targetUrl.localeCompare(i.description, 'en', { sensitivity: 'base' }) == 0);
120+
const matches = items.filter(i => targetUrl.localeCompare(i.description, 'en', { sensitivity: 'base' }) === 0);
121121
if (matches && matches.length > 0 ) {
122122
targetWebsocketUrl = matches[0].detail;
123123
} else {

tslint.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
"no-internal-module": true,
6363
"no-trailing-whitespace": true,
6464
"no-null-keyword": true,
65-
"prefer-const": true
65+
"prefer-const": true,
66+
"triple-equals": true
6667
}
6768
}

0 commit comments

Comments
 (0)