Skip to content

Commit 93df790

Browse files
authored
fix: correct last typescript errors + add ci check (#578)
1 parent c686059 commit 93df790

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,18 @@ name: CI
33
on: push
44

55
jobs:
6+
typecheck:
7+
runs-on: ubuntu-20.04
8+
steps:
9+
- uses: actions/[email protected]
10+
- name: Use Node.js
11+
uses: actions/[email protected]
12+
with:
13+
node-version: 17
14+
cache: 'yarn'
15+
- run: yarn
16+
- run: yarn run build
17+
- run: yarn run tsc --noEmit
618
lint:
719
runs-on: ubuntu-20.04
820
steps:

packages/use-i18n/src/__tests__/formatDate.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@ const tests = [
2727
'2020-02-13T15:28:00.000Z',
2828
])
2929
]),
30-
].flat()
30+
].flat() as [FormatDateOptions, string, string, Date | string | number][]
3131

3232
describe('formatDate', () => {
3333
test.each(tests)('should work with format "%s", for date = "%s" and locale "%s"', (format, _, locale, date) => {
3434
expect(
35-
formatDate(locale as string, date, format as FormatDateOptions),
35+
formatDate(locale, date, format),
3636
).toMatchSnapshot()
3737
})
3838

3939
test.each(locales)('should work with custom format and locale %s', (locale) => {
40-
const format = {
40+
const format: FormatDateOptions = {
4141
day: "numeric",
4242
era: "short",
4343
hour: "2-digit",

0 commit comments

Comments
 (0)