Skip to content

Commit ef286dc

Browse files
chore: add ESLint rule to enforce variable+property naming
1 parent aa1a39e commit ef286dc

File tree

8 files changed

+22
-22
lines changed

8 files changed

+22
-22
lines changed

eslint.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ export default [
7171
],
7272

7373
curly: ["error", "all"],
74+
camelcase: [
75+
"error",
76+
{ properties: "always", ignoreImports: true, ignoreGlobals: true },
77+
],
7478
},
7579
},
7680
];

src/commands/app/exec.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as child_process from "child_process";
1+
import { spawnSync } from "child_process";
22
import { Args, Flags } from "@oclif/core";
33
import { ExtendedBaseCommand } from "../../lib/basecommands/ExtendedBaseCommand.js";
44
import { sshConnectionFlags } from "../../lib/resources/ssh/flags.js";
@@ -82,13 +82,9 @@ export default class Exec extends ExtendedBaseCommand<typeof Exec> {
8282

8383
this.debug("running ssh %o, with command %o", sshArgs, wrappedExecCommand);
8484

85-
const result = child_process.spawnSync(
86-
"/usr/bin/ssh",
87-
[...sshArgs, wrappedExecCommand],
88-
{
89-
stdio: "inherit",
90-
},
91-
);
85+
const result = spawnSync("/usr/bin/ssh", [...sshArgs, wrappedExecCommand], {
86+
stdio: "inherit",
87+
});
9288

9389
if (result.status !== 0) {
9490
this.error(`Command failed with exit code ${result.status}`);

src/commands/app/ssh.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as child_process from "child_process";
1+
import { spawnSync } from "child_process";
22
import { appInstallationArgs } from "../../lib/resources/app/flags.js";
33
import { Flags } from "@oclif/core";
44
import { ExtendedBaseCommand } from "../../lib/basecommands/ExtendedBaseCommand.js";
@@ -80,7 +80,7 @@ export default class Ssh extends ExtendedBaseCommand<typeof Ssh> {
8080
);
8181
}
8282

83-
child_process.spawnSync("/usr/bin/ssh", [...args, cmd], {
83+
spawnSync("/usr/bin/ssh", [...args, cmd], {
8484
stdio: "inherit",
8585
});
8686
}

src/commands/container/exec.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as child_process from "child_process";
1+
import { spawnSync } from "child_process";
22
import { Args, Flags } from "@oclif/core";
33
import { ExtendedBaseCommand } from "../../lib/basecommands/ExtendedBaseCommand.js";
44
import { getSSHConnectionForContainer } from "../../lib/resources/ssh/container.js";
@@ -100,13 +100,9 @@ export default class Exec extends ExtendedBaseCommand<typeof Exec> {
100100

101101
this.debug("running ssh %o, with command %o", sshArgs, wrappedExecCommand);
102102

103-
const result = child_process.spawnSync(
104-
"/usr/bin/ssh",
105-
[...sshArgs, wrappedExecCommand],
106-
{
107-
stdio: "inherit",
108-
},
109-
);
103+
const result = spawnSync("/usr/bin/ssh", [...sshArgs, wrappedExecCommand], {
104+
stdio: "inherit",
105+
});
110106

111107
if (result.status !== 0) {
112108
this.error(`Command failed with exit code ${result.status}`);

src/commands/container/ssh.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as child_process from "child_process";
1+
import { spawnSync } from "child_process";
22
import { Args, Flags } from "@oclif/core";
33
import { ExtendedBaseCommand } from "../../lib/basecommands/ExtendedBaseCommand.js";
44
import { getSSHConnectionForContainer } from "../../lib/resources/ssh/container.js";
@@ -69,7 +69,7 @@ export default class Ssh extends ExtendedBaseCommand<typeof Ssh> {
6969

7070
this.debug("running ssh %o, with command %o", args, cmd);
7171

72-
child_process.spawnSync("/usr/bin/ssh", [...args, cmd], {
72+
spawnSync("/usr/bin/ssh", [...args, cmd], {
7373
stdio: "inherit",
7474
});
7575
}

src/commands/ddev/init.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,7 @@ export class Init extends ExecRenderBaseCommand<typeof Init, void> {
199199
(e) => e.startsWith("MITTWALD_API_TOKEN="),
200200
);
201201
if (!alreadyContainsAPIToken) {
202+
// eslint-disable-next-line camelcase
202203
parsed.web_environment = [
203204
...(parsed.web_environment ?? []),
204205
`MITTWALD_API_TOKEN=${token}`,
@@ -208,6 +209,7 @@ export class Init extends ExecRenderBaseCommand<typeof Init, void> {
208209
} catch (err) {
209210
if (isNotFound(err)) {
210211
const config: Partial<DDEVConfig> = {
212+
// eslint-disable-next-line camelcase
211213
web_environment: [`MITTWALD_API_TOKEN=${token}`],
212214
};
213215

src/commands/project/ssh.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as child_process from "child_process";
1+
import { spawnSync } from "child_process";
22
import { projectArgs } from "../../lib/resources/project/flags.js";
33
import { ExtendedBaseCommand } from "../../lib/basecommands/ExtendedBaseCommand.js";
44
import { sshConnectionFlags } from "../../lib/resources/ssh/flags.js";
@@ -27,7 +27,7 @@ export default class Ssh extends ExtendedBaseCommand<typeof Ssh> {
2727

2828
this.log("connecting to %o as %o", host, user);
2929

30-
child_process.spawnSync("/usr/bin/ssh", ["-l", user, host], {
30+
spawnSync("/usr/bin/ssh", ["-l", user, host], {
3131
stdio: "inherit",
3232
});
3333
}

src/lib/ddev/config_builder.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
/* eslint-disable camelcase */
2+
13
import type { MittwaldAPIV2 } from "@mittwald/api-client";
24
import { assertStatus, MittwaldAPIV2Client } from "@mittwald/api-client";
35
import {

0 commit comments

Comments
 (0)