Skip to content

Commit 0a81ce0

Browse files
feat: add typescript via tsx #1275
PR URL: #1275 Reviewed-by: OpenINF-bot <openinfbot@open.inf.is> Thanks: @isaacs --------- Signed-off-by: Derek Lewis <dereknongeneric@open.inf.is>
1 parent 66dd1bc commit 0a81ce0

35 files changed

Lines changed: 409 additions & 210 deletions

β€Ž.github/workflows/lint-and-test.ymlβ€Ž

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ jobs:
4242
- '**/Dockerfile'
4343
html:
4444
- '**/*.html'
45-
js:
46-
- '**/*.js'
47-
- '**/*.mjs'
45+
ts:
46+
- '**/*.ts'
47+
- '**/*.mts'
4848
json:
4949
- '**/*.json'
5050
- '**/*.json5'
@@ -77,9 +77,9 @@ jobs:
7777
if: ${{ steps.filter.outputs.html == 'true' }}
7878
run: nps verify.html
7979

80-
- name: Verify JavaScript
81-
if: ${{ steps.filter.outputs.js == 'true' || steps.filter.outputs.json == 'true' }}
82-
run: nps verify.js
80+
- name: Verify TypeScript
81+
if: ${{ steps.filter.outputs.ts == 'true' || steps.filter.outputs.json == 'true' }}
82+
run: nps verify.ts
8383

8484
- name: Verify JSON
8585
if: ${{ steps.filter.outputs.json == 'true' }}
@@ -107,5 +107,5 @@ jobs:
107107

108108
# Only run tests if the PR touches behavior-related files.
109109
- name: Test
110-
if: ${{ steps.filter.outputs.js == 'true' || steps.filter.outputs.json == 'true' }}
110+
if: ${{ steps.filter.outputs.ts == 'true' || steps.filter.outputs.json == 'true' }}
111111
run: nps test

β€Žbiome.jsoncβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"formatter": {
2424
"jsxQuoteStyle": "double",
2525
"quoteProperties": "asNeeded",
26-
"trailingComma": "es5",
26+
"trailingCommas": "es5",
2727
"semicolons": "always",
2828
"arrowParentheses": "always",
2929
"bracketSpacing": true,
File renamed without changes.
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,7 @@ const scripts = [
2323
];
2424

2525
for (const element of scripts) {
26-
try {
27-
exitCode = await exec(element);
28-
} catch (p) {
29-
exitCode = p.exitCode;
30-
}
26+
exitCode = await exec(element);
3127

3228
if (exitCode !== 0) process.exitCode = exitCode;
3329
}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ let exitCode = 0;
1818
const scripts = [`dprint fmt ${DockerfileFiles.join(' ')}`];
1919

2020
for (const element of scripts) {
21-
try {
22-
exitCode = await exec(element);
23-
} catch (p) {
24-
exitCode = p.exitCode;
25-
}
21+
exitCode = await exec(element);
2622

2723
if (exitCode !== 0) process.exitCode = exitCode;
2824
}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,7 @@ let exitCode = 0;
1818
const scripts = [`prettier --write ${HTMLFiles.join(' ')}`];
1919

2020
for (const element of scripts) {
21-
try {
22-
exitCode = await exec(element);
23-
} catch (p) {
24-
exitCode = p.exitCode;
25-
}
21+
exitCode = await exec(element);
2622

2723
if (exitCode !== 0) process.exitCode = exitCode;
2824
}
Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,7 @@ let exitCode = 0;
2020
const scripts = [`biome check --apply ${JSONFiles.join(' ')}`];
2121

2222
for (const element of scripts) {
23-
try {
24-
exitCode = await exec(element);
25-
} catch (p) {
26-
exitCode = p.exitCode;
27-
}
23+
exitCode = await exec(element);
2824

2925
if (exitCode !== 0) process.exitCode = exitCode;
3026
}

0 commit comments

Comments
Β (0)