am-i-done 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
// @expect
|
|
1
|
+
// @expect 8
|
|
2
2
|
execSync(`git log ${ref}`);
|
|
3
3
|
exec( `rm -rf ${dir}`, cb);
|
|
4
4
|
execSync("rm -rf " + dir);
|
|
5
5
|
spawn("sh", ["-c", `ls ${dir}`]);
|
|
6
6
|
Bun.spawn(["bash", "-c", "cat " + file]);
|
|
7
7
|
execFile("/bin/sh", ["-c", `echo ${x}`]);
|
|
8
|
+
cp.execSync(`rm -rf ${dir}`);
|
|
9
|
+
child_process.exec("ls " + dir);
|
|
@@ -5,10 +5,11 @@ export default {
|
|
|
5
5
|
type: "pattern",
|
|
6
6
|
category: "conventions",
|
|
7
7
|
// A command string built from a value, by interpolation or `+`, handed to `exec`/`execSync`, or to
|
|
8
|
-
// a shell's `-c` through `spawn`, `execFile` or `Bun.spawn`.
|
|
9
|
-
//
|
|
8
|
+
// a shell's `-c` through `spawn`, `execFile` or `Bun.spawn`. `exec` as a method is someone else's
|
|
9
|
+
// (`db.exec`, `regex.exec`) unless the receiver is child_process by a usual name. A string built
|
|
10
|
+
// earlier and passed by name is beyond a pattern.
|
|
10
11
|
pattern:
|
|
11
|
-
|
|
12
|
+
/(?:(?<![.\w$])|(?<=\b(?:child_process|childProcess|cp)\.))(?:exec|execSync)\s*\(\s*(?:`[^`]*\$\{|["'][^"'\n]*["']\s*\+)|\b(?:spawn|spawnSync|execFile|execFileSync|Bun\.spawn|Bun\.spawnSync)\s*\(\s*\[?\s*["'](?:\/bin\/)?(?:ba|z|da)?sh["']\s*,\s*\[?\s*["']-c["']\s*,\s*(?:`[^`]*\$\{|["'][^"'\n]*["']\s*\+)/g,
|
|
12
13
|
scope: "all",
|
|
13
14
|
scold: "A value interpolated into a shell command string runs as shell if it contains shell syntax.",
|
|
14
15
|
guidance: [
|