Skip to content

Commit a173a42

Browse files
committed
style: correct eslint errors
1 parent 287fa2f commit a173a42

File tree

4 files changed

+4
-124
lines changed

4 files changed

+4
-124
lines changed

packages/use-i18n/src/__tests__/__snapshots__/formatUnit.ts.snap

Lines changed: 0 additions & 114 deletions
Original file line numberDiff line numberDiff line change
@@ -116,120 +116,6 @@ exports[`formatUnit should work with { unit: 'zettabyte' } 1`] = `"12,56 Zo"`;
116116

117117
exports[`formatUnit should work with { unit: 'zettabyte-humanized' } 1`] = `"0 Zo"`;
118118

119-
exports[`formatUnit should work with large values { unit: 'bit' } 1`] = `"13 876 876 883 167 813 000 000 000 b"`;
120-
121-
exports[`formatUnit should work with large values { unit: 'bit-humanized' } 1`] = `"13 876 876 883 167 813 000 000 000 b"`;
122-
123-
exports[`formatUnit should work with large values { unit: 'bit-per-second' } 1`] = `"13 876 876 883 167 813 000 000 000 bps"`;
124-
125-
exports[`formatUnit should work with large values { unit: 'bit-per-second-humanized' } 1`] = `"13 876 876 883 167 813 000 000 000 bps"`;
126-
127-
exports[`formatUnit should work with large values { unit: 'bits-humanized' } 1`] = `"13,88 Yb"`;
128-
129-
exports[`formatUnit should work with large values { unit: 'bits-per-second-humanized' } 1`] = `"13,88 Ybps"`;
130-
131-
exports[`formatUnit should work with large values { unit: 'byte' } 1`] = `"13 876 876 883 167 813 000 000 000 o"`;
132-
133-
exports[`formatUnit should work with large values { unit: 'byte-humanized' } 1`] = `"13 876 876 883 167 813 000 000 000 o"`;
134-
135-
exports[`formatUnit should work with large values { unit: 'bytes-humanized' } 1`] = `"13,88 Yo"`;
136-
137-
exports[`formatUnit should work with large values { unit: 'exabit' } 1`] = `"13 876 876 883 167 813 000 000 000 Eb"`;
138-
139-
exports[`formatUnit should work with large values { unit: 'exabit-humanized' } 1`] = `"13 876 876,88 Eb"`;
140-
141-
exports[`formatUnit should work with large values { unit: 'exabit-per-second' } 1`] = `"13 876 876 883 167 813 000 000 000 Ebps"`;
142-
143-
exports[`formatUnit should work with large values { unit: 'exabit-per-second-humanized' } 1`] = `"13 876 876,88 Ebps"`;
144-
145-
exports[`formatUnit should work with large values { unit: 'exabyte' } 1`] = `"13 876 876 883 167 813 000 000 000 Eo"`;
146-
147-
exports[`formatUnit should work with large values { unit: 'exabyte-humanized' } 1`] = `"13 876 876,88 Eo"`;
148-
149-
exports[`formatUnit should work with large values { unit: 'gigabit' } 1`] = `"13 876 876 883 167 813 000 000 000 Gb"`;
150-
151-
exports[`formatUnit should work with large values { unit: 'gigabit-humanized' } 1`] = `"13 876 876 883 167 814 Gb"`;
152-
153-
exports[`formatUnit should work with large values { unit: 'gigabit-per-second' } 1`] = `"13 876 876 883 167 813 000 000 000 Gbps"`;
154-
155-
exports[`formatUnit should work with large values { unit: 'gigabit-per-second-humanized' } 1`] = `"13 876 876 883 167 814 Gbps"`;
156-
157-
exports[`formatUnit should work with large values { unit: 'gigabyte' } 1`] = `"13 876 876 883 167 813 000 000 000 Go"`;
158-
159-
exports[`formatUnit should work with large values { unit: 'gigabyte-humanized' } 1`] = `"13 876 876 883 167 814 Go"`;
160-
161-
exports[`formatUnit should work with large values { unit: 'kilobit' } 1`] = `"13 876 876 883 167 813 000 000 000 Kb"`;
162-
163-
exports[`formatUnit should work with large values { unit: 'kilobit-humanized' } 1`] = `"13 876 876 883 167 812 000 000 Kb"`;
164-
165-
exports[`formatUnit should work with large values { unit: 'kilobit-per-second' } 1`] = `"13 876 876 883 167 813 000 000 000 Kbps"`;
166-
167-
exports[`formatUnit should work with large values { unit: 'kilobit-per-second-humanized' } 1`] = `"13 876 876 883 167 812 000 000 Kbps"`;
168-
169-
exports[`formatUnit should work with large values { unit: 'kilobyte' } 1`] = `"13 876 876 883 167 813 000 000 000 Ko"`;
170-
171-
exports[`formatUnit should work with large values { unit: 'kilobyte-humanized' } 1`] = `"13 876 876 883 167 812 000 000 Ko"`;
172-
173-
exports[`formatUnit should work with large values { unit: 'megabit' } 1`] = `"13 876 876 883 167 813 000 000 000 Mb"`;
174-
175-
exports[`formatUnit should work with large values { unit: 'megabit-humanized' } 1`] = `"13 876 876 883 167 812 000 Mb"`;
176-
177-
exports[`formatUnit should work with large values { unit: 'megabit-per-second' } 1`] = `"13 876 876 883 167 813 000 000 000 Mbps"`;
178-
179-
exports[`formatUnit should work with large values { unit: 'megabit-per-second-humanized' } 1`] = `"13 876 876 883 167 812 000 Mbps"`;
180-
181-
exports[`formatUnit should work with large values { unit: 'megabyte' } 1`] = `"13 876 876 883 167 813 000 000 000 Mo"`;
182-
183-
exports[`formatUnit should work with large values { unit: 'megabyte-humanized' } 1`] = `"13 876 876 883 167 812 000 Mo"`;
184-
185-
exports[`formatUnit should work with large values { unit: 'petabit' } 1`] = `"13 876 876 883 167 813 000 000 000 Pb"`;
186-
187-
exports[`formatUnit should work with large values { unit: 'petabit-humanized' } 1`] = `"13 876 876 883,17 Pb"`;
188-
189-
exports[`formatUnit should work with large values { unit: 'petabit-per-second' } 1`] = `"13 876 876 883 167 813 000 000 000 Pbps"`;
190-
191-
exports[`formatUnit should work with large values { unit: 'petabit-per-second-humanized' } 1`] = `"13 876 876 883,17 Pbps"`;
192-
193-
exports[`formatUnit should work with large values { unit: 'petabyte' } 1`] = `"13 876 876 883 167 813 000 000 000 Po"`;
194-
195-
exports[`formatUnit should work with large values { unit: 'petabyte-humanized' } 1`] = `"13 876 876 883,17 Po"`;
196-
197-
exports[`formatUnit should work with large values { unit: 'terabit' } 1`] = `"13 876 876 883 167 813 000 000 000 Tb"`;
198-
199-
exports[`formatUnit should work with large values { unit: 'terabit-humanized' } 1`] = `"13 876 876 883 167,81 Tb"`;
200-
201-
exports[`formatUnit should work with large values { unit: 'terabit-per-second' } 1`] = `"13 876 876 883 167 813 000 000 000 Tbps"`;
202-
203-
exports[`formatUnit should work with large values { unit: 'terabit-per-second-humanized' } 1`] = `"13 876 876 883 167,81 Tbps"`;
204-
205-
exports[`formatUnit should work with large values { unit: 'terabyte' } 1`] = `"13 876 876 883 167 813 000 000 000 To"`;
206-
207-
exports[`formatUnit should work with large values { unit: 'terabyte-humanized' } 1`] = `"13 876 876 883 167,81 To"`;
208-
209-
exports[`formatUnit should work with large values { unit: 'yottabit' } 1`] = `"13 876 876 883 167 813 000 000 000 Yb"`;
210-
211-
exports[`formatUnit should work with large values { unit: 'yottabit-humanized' } 1`] = `"13,88 Yb"`;
212-
213-
exports[`formatUnit should work with large values { unit: 'yottabit-per-second' } 1`] = `"13 876 876 883 167 813 000 000 000 Ybps"`;
214-
215-
exports[`formatUnit should work with large values { unit: 'yottabit-per-second-humanized' } 1`] = `"13,88 Ybps"`;
216-
217-
exports[`formatUnit should work with large values { unit: 'yottabyte' } 1`] = `"13 876 876 883 167 813 000 000 000 Yo"`;
218-
219-
exports[`formatUnit should work with large values { unit: 'yottabyte-humanized' } 1`] = `"13,88 Yo"`;
220-
221-
exports[`formatUnit should work with large values { unit: 'zettabit' } 1`] = `"13 876 876 883 167 813 000 000 000 Zb"`;
222-
223-
exports[`formatUnit should work with large values { unit: 'zettabit-humanized' } 1`] = `"13 876,88 Zb"`;
224-
225-
exports[`formatUnit should work with large values { unit: 'zettabit-per-second' } 1`] = `"13 876 876 883 167 813 000 000 000 Zbps"`;
226-
227-
exports[`formatUnit should work with large values { unit: 'zettabit-per-second-humanized' } 1`] = `"13 876,88 Zbps"`;
228-
229-
exports[`formatUnit should work with large values { unit: 'zettabyte' } 1`] = `"13 876 876 883 167 813 000 000 000 Zo"`;
230-
231-
exports[`formatUnit should work with large values { unit: 'zettabyte-humanized' } 1`] = `"13 876,88 Zo"`;
232-
233119
exports[`formatUnit should work with locale en and { unit: 'bit' } 1`] = `"12.56 b"`;
234120

235121
exports[`formatUnit should work with locale en and { unit: 'bit-humanized' } 1`] = `"13 b"`;

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,6 @@ const tests = [
4141
'fr',
4242
12,
4343
]),
44-
...Object.keys(supportedUnits).map(unit => [
45-
'should work with large values',
46-
{ unit },
47-
'fr',
48-
13876876883167813487687341,
49-
]),
5044
]
5145

5246
describe('formatUnit', () => {

packages/use-i18n/src/formatters.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ function createFastMemoizeCache<V>(): Cache<string, V> {
5252
}
5353

5454
const baseFormatters: BaseFormatters = {
55-
getDateTimeFormat: memoize((...args) => new Intl.DateTimeFormat(...args), {
55+
getDateTimeFormat: memoize((...args: ConstructorParameters<typeof Intl.DateTimeFormat>) => new Intl.DateTimeFormat(...args), {
5656
cache: createFastMemoizeCache<Intl.DateTimeFormat>(),
5757
strategy: strategies.variadic,
5858
}),
@@ -62,11 +62,11 @@ const baseFormatters: BaseFormatters = {
6262
cache: createFastMemoizeCache<IntlListFormat>(),
6363
strategy: strategies.variadic,
6464
}),
65-
getNumberFormat: memoize((...args) => new Intl.NumberFormat(...args), {
65+
getNumberFormat: memoize((...args: ConstructorParameters<typeof Intl.NumberFormat>) => new Intl.NumberFormat(...args), {
6666
cache: createFastMemoizeCache<Intl.NumberFormat>(),
6767
strategy: strategies.variadic,
6868
}),
69-
getPluralRules: memoize((...args) => new Intl.PluralRules(...args), {
69+
getPluralRules: memoize((...args: ConstructorParameters<typeof Intl.PluralRules>) => new Intl.PluralRules(...args), {
7070
cache: createFastMemoizeCache<Intl.PluralRules>(),
7171
strategy: strategies.variadic,
7272
}),

packages/use-query-params/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const useQueryParams = (): {
4141
)
4242

4343
const stringyFormat = useCallback(
44-
(params): string =>
44+
(params: Record<string, unknown>): string =>
4545
stringify(params, {
4646
arrayFormat: 'comma',
4747
skipEmptyString: true,

0 commit comments

Comments
 (0)