Skip to content

Commit a41d9f0

Browse files
committed
Do some linting
1 parent 7ee1fb1 commit a41d9f0

File tree

8 files changed

+19
-12
lines changed

8 files changed

+19
-12
lines changed

.eslintrc

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{
2-
"extends": ["pythoncoderas-combo"]
2+
"extends": ["pythoncoderas-combo"],
3+
"rules": {
4+
"camelcase": "off",
5+
"no-param-reassign": "off"
6+
}
37
}

package-lock.json

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
"chai": "^4.3.6",
3939
"chai-as-promised": "^7.1.1",
4040
"eslint": "^8.17.0",
41-
"eslint-config-prettier": "^8.5.0",
4241
"eslint-config-pythoncoderas-combo": "^1.0.1",
4342
"mocha": "^10.0.0",
4443
"prettier": "^2.6.2",

src/handler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ async function spawn(command: string, args?: string[], options?: object) {
1717
return childProcess;
1818
}
1919

20-
// eslint-disable-next-line no-undef -- NodeJS is a fake namespace by TypeScript.
20+
2121
function terminateSpawnCache(signal: NodeJS.Signals = "SIGTERM") {
2222
for (const childProcess of spawnedProcesses.keys()) {
2323
childProcess.kill(signal);
@@ -118,7 +118,7 @@ export default async function handler(script: string, flags: CliFlags) {
118118
);
119119
} finally {
120120
if (flags.terminate ?? true) {
121-
// eslint-disable-next-line no-undef -- NodeJS is a fake namespace by TypeScript.
121+
122122
terminateSpawnCache(flags.signal as NodeJS.Signals);
123123
}
124124

src/template.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
import { Template } from "./types";
21
import { Sade } from "sade";
2+
import { Template } from "./types";
33
import templates from "./templates";
44

55
function generateCLIFromTemplate(sade: Sade, template: Template): Sade {
66
const argString: string = template.arguments
7-
? " " +
7+
? ` ${
88
template.arguments
99
.map((arg) => (typeof arg === "string" ? { name: arg } : arg))
1010
.map((arg) => `<${arg.name}>`)
11-
.join(" ")
11+
.join(" ")}`
1212
: "";
1313
sade = sade.command(
1414
`template ${template.name}${argString}`,
@@ -37,5 +37,6 @@ export default function main(sade: Sade): Sade {
3737
for (const template of templates) {
3838
sade = generateCLIFromTemplate(sade, template);
3939
}
40+
4041
return sade;
4142
}

src/templates/cp.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
import { writeFile } from "fs/promises";
12
import { GenerateTemplateCliFlags, Template } from "../types";
23
import { getOutputPath } from "../utils";
3-
import { writeFile } from "fs/promises";
44

55
export default class CpTemplate implements Template {
66
readonly name = "copy";
7+
78
readonly description =
89
"A template to copy a signle source file to multiple repositories and commit the changes.";
10+
911
readonly aliases = ["cp"];
1012

1113
readonly defaultFileName = "cp.sh";

src/types.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ export interface Template {
2727
defaultFileName: string;
2828

2929
arguments?: (string | { name: string; description?: string })[];
30+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3031
flags?: (string | { name: string; description?: string; value?: any })[];
32+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3133
handler: (...args: any[]) => any;
3234
}
3335

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { ChildProcess } from "child_process";
2-
import { GenerateTemplateCliFlags, RepoOwner, Template } from "./types";
32
import { mkdtemp } from "fs/promises";
43
import { tmpdir } from "os";
4+
import { GenerateTemplateCliFlags, RepoOwner, Template } from "./types";
55

66
export function getRepoAndOwner(
77
input: string,

0 commit comments

Comments
 (0)