Skip to content

Commit 926e13c

Browse files
committed
did npm run format:all once
1 parent 5e8c790 commit 926e13c

File tree

46 files changed

+177
-202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+177
-202
lines changed

.github/workflows/get_artifact_dir_name.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ const { dirName: artifactDirName } = require("../../cli/bin_path.js");
66
// Pass artifactDirName to subsequent GitHub actions
77
fs.appendFileSync(
88
process.env.GITHUB_ENV,
9-
`artifact_dir_name=${artifactDirName}${os.EOL}`
9+
`artifact_dir_name=${artifactDirName}${os.EOL}`,
1010
);

.github/workflows/prepare_package_upload.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ const commitHashShort = commitHash.substring(0, 7);
99

1010
fs.renameSync(
1111
`rescript-${version}.tgz`,
12-
`rescript-${version}-${commitHashShort}.tgz`
12+
`rescript-${version}-${commitHashShort}.tgz`,
1313
);
1414
fs.renameSync(
1515
`packages/std/rescript-std-${version}.tgz`,
16-
`rescript-std-${version}-${commitHashShort}.tgz`
16+
`rescript-std-${version}-${commitHashShort}.tgz`,
1717
);
1818

1919
// Pass information to subsequent GitHub actions
2020
fs.appendFileSync(
2121
process.env.GITHUB_ENV,
22-
`rescript_version=${version}-${commitHashShort}${os.EOL}`
22+
`rescript_version=${version}-${commitHashShort}${os.EOL}`,
2323
);

cli/rescript_arg.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ function parse_exn(
112112
annofun,
113113
start = 0,
114114
// first 3 are [node, rescript, subcommand]
115-
finish = argv.length
115+
finish = argv.length,
116116
) {
117117
var current = start;
118118
var list = [];

cli/rescript_bsb.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,7 +363,7 @@ Please pick a different one using the \`-ws [host:]port\` flag from bsb.`);
363363
function outputError(error, highlight) {
364364
if (isTtyError && highlight) {
365365
process.stderr.write(
366-
error.replace(highlight, "\x1b[1;31m" + highlight + "\x1b[0m")
366+
error.replace(highlight, "\x1b[1;31m" + highlight + "\x1b[0m"),
367367
);
368368
} else {
369369
process.stderr.write(error);
@@ -408,7 +408,7 @@ Please pick a different one using the \`-ws [host:]port\` flag from bsb.`);
408408
// it could fail due to other issues like .bsb.lock
409409
else {
410410
dlog(
411-
`Acquire lock failed, do the build later ${depth} : ${reasonsToRebuild}`
411+
`Acquire lock failed, do the build later ${depth} : ${reasonsToRebuild}`,
412412
);
413413
const waitTime = Math.pow(2, depth) * 40;
414414
setTimeout(() => {

cli/rescript_convert.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ function handleOneFile(file, bsc_exe) {
5959
console.error(`Error when converting ${file}`);
6060
console.log(stderr);
6161
}
62-
}
62+
},
6363
);
6464
}
6565
/**
@@ -91,7 +91,7 @@ function main(argv, rescript_exe, bsc_exe) {
9191
["info", "-list-files"],
9292
{
9393
encoding: "utf-8",
94-
}
94+
},
9595
);
9696
if (output.status !== 0) {
9797
console.error(output.stdout);

cli/rescript_format.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ async function formatFiles(files, bsc_exe, isSupportedFile, checkFormatting) {
9292
}
9393
}
9494
return null;
95-
})
95+
}),
9696
);
9797
} catch (err) {
9898
console.error(err);
@@ -103,7 +103,7 @@ async function formatFiles(files, bsc_exe, isSupportedFile, checkFormatting) {
103103
console.error("The file listed above needs formatting");
104104
} else {
105105
console.error(
106-
`The ${incorrectlyFormattedFiles} files listed above need formatting`
106+
`The ${incorrectlyFormattedFiles} files listed above need formatting`,
107107
);
108108
}
109109
process.exit(3);
@@ -135,7 +135,7 @@ async function main(argv, rescript_exe, bsc_exe) {
135135
// Require: -all or path to a file
136136
if (check.val && !format_project && files.length == 0) {
137137
console.error(
138-
"format check require path to a file or use `-all` to check the whole project"
138+
"format check require path to a file or use `-all` to check the whole project",
139139
);
140140
process.exit(2);
141141
}
@@ -152,7 +152,7 @@ async function main(argv, rescript_exe, bsc_exe) {
152152
["info", "-list-files"],
153153
{
154154
encoding: "utf-8",
155-
}
155+
},
156156
);
157157
if (output.status !== 0) {
158158
console.error(output.stdout);
@@ -173,7 +173,7 @@ async function main(argv, rescript_exe, bsc_exe) {
173173
os.tmpdir(),
174174
"rescript_" +
175175
crypto.randomBytes(8).toString("hex") +
176-
path.parse(use_stdin).base
176+
path.parse(use_stdin).base,
177177
);
178178
(async function () {
179179
var content = await readStdin();
@@ -191,7 +191,7 @@ async function main(argv, rescript_exe, bsc_exe) {
191191
console.error(stderr);
192192
process.exit(2);
193193
}
194-
}
194+
},
195195
);
196196
})();
197197
} else {

cli/rescript_postinstall.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,31 +7,31 @@ const { bsc_exe, ninja_exe } = require("./bin_path");
77
function checkNinja() {
88
if (!fs.existsSync(ninja_exe)) {
99
throw new Error(
10-
`No ninja binary found for this platform. ${ninja_exe} does not exist.`
10+
`No ninja binary found for this platform. ${ninja_exe} does not exist.`,
1111
);
1212
}
1313

1414
try {
1515
return String(child_process.execFileSync(ninja_exe, ["--version"])).trim();
1616
} catch (e) {
1717
throw new Error(
18-
`Error getting ninja version. The ninja binary at ${ninja_exe} may not be compatible with this platform: ${e}`
18+
`Error getting ninja version. The ninja binary at ${ninja_exe} may not be compatible with this platform: ${e}`,
1919
);
2020
}
2121
}
2222

2323
function checkCompiler() {
2424
if (!fs.existsSync(bsc_exe)) {
2525
throw new Error(
26-
`No ReScript compiler binary found for this platform. ${bsc_exe} does not exist.`
26+
`No ReScript compiler binary found for this platform. ${bsc_exe} does not exist.`,
2727
);
2828
}
2929

3030
try {
3131
return String(child_process.execFileSync(bsc_exe, ["-v"])).trim();
3232
} catch (e) {
3333
throw new Error(
34-
`Error getting ReScript compiler version. The compiler binary at ${bsc_exe} may not be compatible with this platform: ${e}`
34+
`Error getting ReScript compiler version. The compiler binary at ${bsc_exe} may not be compatible with this platform: ${e}`,
3535
);
3636
}
3737
}

jscomp/build_tests/cli_compile_status/input.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ assert.match(
1212
out.stdout,
1313
new RegExp(`>>>> Start compiling
1414
Dependency Finished
15-
>>>> Finish compiling \\d+ mseconds`)
15+
>>>> Finish compiling \\d+ mseconds`),
1616
);
1717

1818
// Shows compile time for `rescript` command
@@ -24,7 +24,7 @@ assert.match(
2424
out.stdout,
2525
new RegExp(`>>>> Start compiling
2626
Dependency Finished
27-
>>>> Finish compiling \\d+ mseconds`)
27+
>>>> Finish compiling \\d+ mseconds`),
2828
);
2929

3030
// Doesn't show compile time for `rescript build -verbose` command
@@ -38,6 +38,6 @@ out = child_process.spawnSync(`../../../rescript`, ["build", "-verbose"], {
3838
assert.match(
3939
out.stdout,
4040
new RegExp(
41-
`Package stack: test \nDependency Finished\nninja.exe -C lib/bs \n`
42-
)
41+
`Package stack: test \nDependency Finished\nninja.exe -C lib/bs \n`,
42+
),
4343
);

jscomp/build_tests/cmd/input.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function evalCode(code) {
3535
encoding: "utf8",
3636
shell: true,
3737
cwd: __dirname,
38-
}
38+
},
3939
);
4040

4141
return bsc_exe;
@@ -51,10 +51,10 @@ test(react);
5151

5252
assert.ok(
5353
evalCode(react + foo_react).stdout.match(/require/g).length === 2,
54-
"foo react twice "
54+
"foo react twice ",
5555
);
5656

5757
assert.ok(
5858
evalCode(foo_react).stdout.match(/require/g).length === 1,
59-
"foo react one"
59+
"foo react one",
6060
);

jscomp/build_tests/deprecated-package-specs/input.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@ const { rescript_exe } = require("#cli/bin_path");
55
const out = child_process.spawnSync(rescript_exe, { encoding: "utf8" });
66
assert.match(
77
out.stderr,
8-
/deprecated: Option "es6-global" is deprecated\. Use "esmodule" instead\./
8+
/deprecated: Option "es6-global" is deprecated\. Use "esmodule" instead\./,
99
);

jscomp/build_tests/duplicated_symlinked_packages/a/bsconfig.json

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,15 @@
22
"name": "a",
33
"version": "0.1.0",
44
"sources": {
5-
"dir" : "src",
6-
"subdirs" : true
5+
"dir": "src",
6+
"subdirs": true
77
},
88
"package-specs": {
99
"module": "commonjs",
1010
"in-source": true
1111
},
1212
"suffix": ".bs.js",
13-
"bs-dependencies": [
14-
"c",
15-
"z"
16-
],
17-
"warnings": {"error" : "+101"},
13+
"bs-dependencies": ["c", "z"],
14+
"warnings": { "error": "+101" },
1815
"namespace": true
1916
}

jscomp/build_tests/duplicated_symlinked_packages/b/bsconfig.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22
"name": "b",
33
"version": "0.1.0",
44
"sources": {
5-
"dir" : "src",
6-
"subdirs" : true
5+
"dir": "src",
6+
"subdirs": true
77
},
88
"package-specs": {
99
"module": "commonjs",
1010
"in-source": true
1111
},
1212
"suffix": ".bs.js",
13-
"bs-dependencies": [
14-
"c"
15-
],
16-
"warnings": {"error" : "+101"},
13+
"bs-dependencies": ["c"],
14+
"warnings": { "error": "+101" },
1715
"namespace": true
1816
}

jscomp/build_tests/duplicated_symlinked_packages/c/bsconfig.json

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22
"name": "c",
33
"version": "0.1.0",
44
"sources": {
5-
"dir" : "src",
6-
"subdirs" : true
5+
"dir": "src",
6+
"subdirs": true
77
},
88
"package-specs": {
99
"module": "commonjs",
1010
"in-source": true
1111
},
1212
"suffix": ".bs.js",
13-
"bs-dependencies": [
14-
15-
],
16-
"warnings": {"error" : "+101"},
13+
"bs-dependencies": [],
14+
"warnings": { "error": "+101" },
1715
"namespace": true
1816
}

jscomp/build_tests/duplicated_symlinked_packages/input.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ child_process.exec(rescript_exe, { cwd: __dirname }, (err, stdout, stderr) => {
1919
fs.writeFileSync(expectedFilePath, actualErrorOutput);
2020
} else {
2121
const expectedErrorOutput = postProcessErrorOutput(
22-
fs.readFileSync(expectedFilePath, { encoding: "utf-8" })
22+
fs.readFileSync(expectedFilePath, { encoding: "utf-8" }),
2323
);
2424
if (expectedErrorOutput !== actualErrorOutput) {
2525
console.error(`The old and new error output aren't the same`);

jscomp/build_tests/in_source/input.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ assert.throws(
1616
return true;
1717
}
1818
return false;
19-
}
19+
},
2020
);
2121

2222
// assert.throws(()=>{

jscomp/build_tests/scoped_ppx/input.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ var output = cp.execSync(`${rescript_exe} build -- -t commands src/hello.ast`, {
99
});
1010
assert(
1111
/-ppx '.*\/test\.js -hello' -ppx '.*\/test\.js -heyy' -ppx .*test\.js/.test(
12-
output
13-
)
12+
output,
13+
),
1414
);

jscomp/build_tests/super_errors/input.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function postProcessErrorOutput(output) {
1919
output = output.trimRight();
2020
output = output.replace(
2121
/\/[^ ]+?jscomp\/build_tests\/super_errors\//g,
22-
"/.../"
22+
"/.../",
2323
);
2424
return output;
2525
}
@@ -43,11 +43,11 @@ fixtures.forEach(fileName => {
4343
fs.writeFileSync(expectedFilePath, actualErrorOutput);
4444
} else {
4545
const expectedErrorOutput = postProcessErrorOutput(
46-
fs.readFileSync(expectedFilePath, { encoding: "utf-8" })
46+
fs.readFileSync(expectedFilePath, { encoding: "utf-8" }),
4747
);
4848
if (expectedErrorOutput !== actualErrorOutput) {
4949
console.error(
50-
`The old and new error output for the test ${fullFilePath} aren't the same`
50+
`The old and new error output for the test ${fullFilePath} aren't the same`,
5151
);
5252
console.error("\n=== Old:");
5353
console.error(expectedErrorOutput);
Lines changed: 21 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
11
{
2-
"name": "a",
3-
"namespace": true,
4-
"sources": [
5-
{
6-
"dir": "src"
7-
},
8-
{
9-
"dir": "tests",
10-
"type": "dev"
11-
}
12-
],
13-
"package-specs": {
14-
"module": "commonjs",
15-
"in-source": false
2+
"name": "a",
3+
"namespace": true,
4+
"sources": [
5+
{
6+
"dir": "src"
167
},
17-
"warnings": {
18-
"error": true
19-
},
20-
"suffix": ".mjs",
21-
"bs-dependencies": [
22-
"b"
23-
],
24-
"pinned-dependencies": [
25-
"b"
26-
]
27-
}
8+
{
9+
"dir": "tests",
10+
"type": "dev"
11+
}
12+
],
13+
"package-specs": {
14+
"module": "commonjs",
15+
"in-source": false
16+
},
17+
"warnings": {
18+
"error": true
19+
},
20+
"suffix": ".mjs",
21+
"bs-dependencies": ["b"],
22+
"pinned-dependencies": ["b"]
23+
}

jscomp/build_tests/transitive_pinned_dependency1/input.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ var fs = require("fs");
55
var { rescript_exe } = require("#cli/bin_path");
66

77
console.log(
8-
child_process.execSync(rescript_exe, { encoding: "utf8", cwd: "./a" })
8+
child_process.execSync(rescript_exe, { encoding: "utf8", cwd: "./a" }),
99
);
1010

1111
assert(
1212
fs.existsSync("./node_modules/c/lib/js/tests/test.mjs"),
13-
"dev files of module 'c' were not built by 'a' even though 'c' is a transitive pinned dependency of 'a' through 'b'"
13+
"dev files of module 'c' were not built by 'a' even though 'c' is a transitive pinned dependency of 'a' through 'b'",
1414
);

0 commit comments

Comments
 (0)