Skip to content

Commit cbc2309

Browse files
authored
Also run dprint action for js, ts and json (iotaledger#1131)
1 parent af78f22 commit cbc2309

21 files changed

+127
-124
lines changed

.github/workflows/format.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ on:
1212
- '.github/workflows/format.yml'
1313
- '**.rs'
1414
- '**.toml'
15+
- '**.ts'
16+
- '**.js'
17+
- '**.json'
1518

1619
jobs:
1720
format:

bindings/wasm/build/replace_paths.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ const path = require("path");
1111

1212
function replace(tsconfig, dist, mode) {
1313
// Read tsconfig file.
14-
const tsconfigPath = path.join(__dirname, '..', tsconfig);
14+
const tsconfigPath = path.join(__dirname, "..", tsconfig);
1515
console.log(`\n using ${tsconfigPath}`);
16-
let data = JSON.parse(fs.readFileSync(path.join(__dirname, '..', tsconfig), "utf8"));
16+
let data = JSON.parse(fs.readFileSync(path.join(__dirname, "..", tsconfig), "utf8"));
1717
let a = data.compilerOptions.paths;
1818
let keys = Object.keys(a);
1919

@@ -29,13 +29,13 @@ function replace(tsconfig, dist, mode) {
2929
let fileData = fs.readFileSync(file, "utf8");
3030
for (let key of keys) {
3131
let value = a[key][1] ?? a[key][0];
32-
32+
3333
const absoluteIncludePath = path.resolve(path.dirname(tsconfigPath), value);
3434
if (mode == "resolve" && fs.existsSync(absoluteIncludePath)) {
3535
const absoluteFilePath = path.resolve(path.dirname(file));
3636
console.log(`\t calculating path from ${absoluteFilePath} to ${absoluteIncludePath}`);
3737
// replace `\` with `/` to convert windows paths to node compatible imports
38-
value = path.relative(absoluteFilePath, absoluteIncludePath).replace(/\\/g, '/');
38+
value = path.relative(absoluteFilePath, absoluteIncludePath).replace(/\\/g, "/");
3939
}
4040

4141
console.log(`\t replace ${key} with ${value}`);
@@ -46,9 +46,10 @@ function replace(tsconfig, dist, mode) {
4646
}
4747

4848
const readdirSync = (p, a = []) => {
49-
if (fs.statSync(p).isDirectory())
50-
fs.readdirSync(p).map(f => readdirSync(a[a.push(path.join(p, f)) - 1], a))
51-
return a
52-
}
49+
if (fs.statSync(p).isDirectory()) {
50+
fs.readdirSync(p).map(f => readdirSync(a[a.push(path.join(p, f)) - 1], a));
51+
}
52+
return a;
53+
};
5354

54-
replace(process.argv[2], process.argv[3], process.argv[4]);
55+
replace(process.argv[2], process.argv[3], process.argv[4]);

bindings/wasm/cypress.config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ export default defineConfig({
66
requestTimeout: 10000,
77
defaultCommandTimeout: 60000,
88
retries: {
9-
runMode: 3
9+
runMode: 3,
1010
},
1111
e2e: {
1212
supportFile: false,
13-
}
13+
},
1414
});
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { setup } from '../../support/setup';
21
import { createIdentity } from "../../../examples/dist/web/0_basic/0_create_did";
2+
import { setup } from "../../support/setup";
33

44
describe(
5-
"createIdentity",
6-
() => {
7-
it("Create Identity", async () => {
8-
await setup(createIdentity);
9-
});
10-
}
5+
"createIdentity",
6+
() => {
7+
it("Create Identity", async () => {
8+
await setup(createIdentity);
9+
});
10+
},
1111
);
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { setup } from '../../support/setup';
21
import { updateIdentity } from "../../../examples/dist/web/0_basic/1_update_did";
2+
import { setup } from "../../support/setup";
33

44
describe(
5-
"updateIdentity",
6-
() => {
7-
it("Update Identity", async () => {
8-
await setup(updateIdentity)
9-
});
10-
}
5+
"updateIdentity",
6+
() => {
7+
it("Update Identity", async () => {
8+
await setup(updateIdentity);
9+
});
10+
},
1111
);
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { setup } from '../../support/setup';
21
import { resolveIdentity } from "../../../examples/dist/web/0_basic/2_resolve_did";
2+
import { setup } from "../../support/setup";
33

44
describe(
5-
"resolveIdentity",
6-
() => {
7-
it("Resolve Identity", async () => {
8-
await setup(resolveIdentity)
9-
});
10-
}
5+
"resolveIdentity",
6+
() => {
7+
it("Resolve Identity", async () => {
8+
await setup(resolveIdentity);
9+
});
10+
},
1111
);
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { setup } from '../../support/setup';
21
import { deactivateIdentity } from "../../../examples/dist/web/0_basic/3_deactivate_did";
2+
import { setup } from "../../support/setup";
33

44
describe(
5-
"deactivateIdentity",
6-
() => {
7-
it("Deactivate Identity", async () => {
8-
await setup(deactivateIdentity)
9-
});
10-
}
5+
"deactivateIdentity",
6+
() => {
7+
it("Deactivate Identity", async () => {
8+
await setup(deactivateIdentity);
9+
});
10+
},
1111
);
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { setup } from '../../support/setup';
21
import { deleteIdentity } from "../../../examples/dist/web/0_basic/4_delete_did";
2+
import { setup } from "../../support/setup";
33

44
describe(
5-
"deleteIdentity",
6-
() => {
7-
it("Delete Identity", async () => {
8-
await setup(deleteIdentity)
9-
});
10-
}
5+
"deleteIdentity",
6+
() => {
7+
it("Delete Identity", async () => {
8+
await setup(deleteIdentity);
9+
});
10+
},
1111
);
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { setup } from '../../support/setup';
21
import { createVC } from "../../../examples/dist/web/0_basic/5_create_vc";
2+
import { setup } from "../../support/setup";
33

44
describe(
5-
"createVC",
6-
() => {
7-
it("Create Credential", async () => {
8-
await setup(createVC)
9-
});
10-
}
5+
"createVC",
6+
() => {
7+
it("Create Credential", async () => {
8+
await setup(createVC);
9+
});
10+
},
1111
);
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { setup } from '../../support/setup';
21
import { createVP } from "../../../examples/dist/web/0_basic/6_create_vp";
2+
import { setup } from "../../support/setup";
33

44
describe(
5-
"createVP",
6-
() => {
7-
it("Create Presentation", async () => {
8-
await setup(createVP)
9-
});
10-
}
5+
"createVP",
6+
() => {
7+
it("Create Presentation", async () => {
8+
await setup(createVP);
9+
});
10+
},
1111
);

0 commit comments

Comments
 (0)