Skip to content

Commit c62858a

Browse files
committed
Run prettier against new files
…so copilot can focus on more meaningful feedback
1 parent 4d4c908 commit c62858a

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
"geo-tz": "^8.1.4",
4444
"make-fetch-happen": "^15.0.3",
4545
"moment": "^2.30.1",
46+
"prettier": "^3.7.4",
4647
"sort-object-keys": "^2.0.1",
4748
"tsdown": "^0.19.0-beta.3",
4849
"typescript": "^5.9.3",

tools/datum.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export function resolveEpoch({
6767
function computeDatumsFromTimeline(
6868
times: Date[],
6969
heights: number[],
70-
tidalDayHours: number
70+
tidalDayHours: number,
7171
): Datums {
7272
if (!times.length || times.length !== heights.length) {
7373
throw new Error('times and heights must be non-empty and of equal length')
@@ -189,7 +189,7 @@ export function computeDatums(
189189
stepHours = 1,
190190
tidalDayHours = 24.8333333,
191191
...tidePredictorOptions
192-
}: DatumsOptions = {}
192+
}: DatumsOptions = {},
193193
): TidalDatumsResult {
194194
const { start, end, lengthYears } = resolveEpoch(epochSpec)
195195

tools/import-ticon.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const metaPath = join(__dirname, '..', 'tmp', 'TICON-4', 'meta.csv')
1616
const dataPath = join(__dirname, '..', 'tmp', 'TICON-4', 'data.csv')
1717
const metadata = indexBy(
1818
parseCSV<TiconMetaRow>(await readFile(metaPath, 'utf-8')),
19-
'FILE NAME'
19+
'FILE NAME',
2020
)
2121
const data = await readFile(dataPath, 'utf-8')
2222

@@ -33,16 +33,14 @@ type TiconMetaRow = {
3333
* one JSON file with all its harmonic constituents aggregated.
3434
*/
3535
async function main() {
36-
const stations = Object.values(groupBy(parseCSV<TiconRow>(data), (r) => r.tide_gauge_name))
36+
const stations = Object.values(
37+
groupBy(parseCSV<TiconRow>(data), (r) => r.tide_gauge_name),
38+
)
3739

3840
let created = 0
3941

4042
for (const rows of stations) {
41-
await save(
42-
normalize(
43-
convertStation(rows)
44-
)
45-
)
43+
await save(normalize(convertStation(rows)))
4644
created++
4745
process.stdout.write('.')
4846
}
@@ -72,8 +70,8 @@ interface TiconRow {
7270
}
7371

7472
function dayMonthYearToDate(date: string) {
75-
const [ day, month, year ] = date.split('/').map((v) => parseInt(v, 10))
76-
if(!day || !month || !year) {
73+
const [day, month, year] = date.split('/').map((v) => parseInt(v, 10))
74+
if (!day || !month || !year) {
7775
throw new Error(`Invalid date: ${date}`)
7876
}
7977
return new Date(Date.UTC(year, month - 1, day, 0, 0, 0))
@@ -83,7 +81,7 @@ function dayMonthYearToDate(date: string) {
8381
* Convert a TICON-4 station to our JSON schema format
8482
*/
8583
function convertStation(rows: TiconRow[]): Station {
86-
if(!rows[0]) {
84+
if (!rows[0]) {
8785
throw new Error('No rows to convert')
8886
}
8987

0 commit comments

Comments
 (0)