Skip to content

Commit dfe5b0d

Browse files
committed
fix: use accurate type comparisons and remove unused reject parameters
1 parent e52839f commit dfe5b0d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/debugger/RemoteDebuggerCommandService.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export function observeAttachDebugTargets(): ConnectableObservable<Array<PythonD
5656
}
5757

5858
function isPortUsed(port: number): Promise<boolean> {
59-
const tryConnectPromise = new Promise((resolve, reject) => {
59+
const tryConnectPromise = new Promise((resolve) => {
6060
const client = new net.Socket()
6161
client
6262
.once("connect", () => {
@@ -134,7 +134,7 @@ function handleJsonRequest(body, res) {
134134
const port = Number(body.port)
135135
getLogger().info("Remote debug target attach request", body)
136136
const target = attachReady.get(port)
137-
if (target != null) {
137+
if (target !== undefined) {
138138
debugRequests.next({
139139
type,
140140
command,

lib/main.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class PythonLanguageClient extends AutoLanguageClient {
7878

7979
onSpawnError(err) {
8080
const description =
81-
err.code == "ENOENT"
81+
err.code === "ENOENT"
8282
? `No Python interpreter found at \`${this.python}\`.`
8383
: `Could not spawn the Python interpreter \`${this.python}\`.`
8484
atom.notifications.addError("`ide-python` could not launch your Python runtime.", {
@@ -88,7 +88,7 @@ class PythonLanguageClient extends AutoLanguageClient {
8888
}
8989

9090
onSpawnClose(code, signal) {
91-
if (code !== 0 && signal == null) {
91+
if (code !== 0 && signal === null) {
9292
atom.notifications.addError("Unable to start the Python language server.", {
9393
dismissable: true,
9494
buttons: [
@@ -124,7 +124,7 @@ class PythonLanguageClient extends AutoLanguageClient {
124124
}
125125

126126
createTimeoutPromise(milliseconds) {
127-
return new Promise((resolve, reject) => {
127+
return new Promise((resolve) => {
128128
const timeout = setTimeout(() => {
129129
clearTimeout(timeout)
130130
this.logger.error(`Server failed to shutdown in ${milliseconds}ms, forcing termination`)

0 commit comments

Comments
 (0)