Skip to content

Commit c2fdbfd

Browse files
committed
Types linting: interfaces
1 parent eba81df commit c2fdbfd

File tree

11 files changed

+35
-29
lines changed

11 files changed

+35
-29
lines changed

packages/core-js-types/src/base/proposals/array-buffer-base64.d.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ type alphabet = 'base64' | 'base64url';
88

99
type lastChunkHandling = 'loose' | 'strict' | 'stop-before-partial';
1010

11-
type fromBase64Options = {
11+
interface fromBase64Options {
1212
alphabet?: alphabet;
1313
lastChunkHandling?: lastChunkHandling;
14-
};
14+
}
1515

16-
type toBase64Options = {
16+
interface toBase64Options {
1717
alphabet?: alphabet;
1818
omitPadding?: boolean;
19-
};
19+
}
2020

21-
type processMetadata = {
21+
interface processMetadata {
2222
read: number;
2323
written: number;
24-
};
24+
}
2525

2626
interface Uint8ArrayConstructor {
2727
/**

packages/core-js-types/src/base/proposals/iterator-joint.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// https://github.com/tc39/proposal-joint-iteration
22

3-
type ZipOptions = {
3+
interface ZipOptions {
44
mode?: 'shortest' | 'longest' | 'strict';
55

66
padding?: object;
7-
};
7+
}
88

99
interface IteratorConstructor { // @type-options no-extends
1010
/**

packages/core-js-types/src/base/proposals/iterator-range.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// https://github.com/tc39/proposal-iterator.range
22

3-
type IteratorRangeOptions<T> = {
3+
interface IteratorRangeOptions<T> {
44
step?: T;
55

66
inclusive?: boolean;
7-
};
7+
}
88

99
interface IteratorConstructor { // @type-options no-extends
1010
/**

packages/core-js-types/src/base/pure/proposals/iterator.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@
2727
// License: https://github.com/microsoft/TypeScript/blob/v5.9.3/LICENSE.txt
2828

2929
declare namespace CoreJS {
30-
type ZipOptions = {
30+
interface ZipOptions {
3131
mode?: 'shortest' | 'longest' | 'strict';
3232

3333
padding?: object;
34-
};
34+
}
3535

36-
type IteratorRangeOptions<T> = {
36+
interface IteratorRangeOptions<T> {
3737
step?: T;
3838

3939
inclusive?: boolean;
40-
};
40+
}
4141

4242
interface CoreJSPromiseLike<T> {
4343
/**

packages/core-js-types/src/ts5-2/pure/proposals/iterator.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,17 @@
2727
// License: https://github.com/microsoft/TypeScript/blob/v5.9.3/LICENSE.txt
2828

2929
declare namespace CoreJS {
30-
type ZipOptions = {
30+
interface ZipOptions {
3131
mode?: 'shortest' | 'longest' | 'strict';
3232

3333
padding?: object;
34-
};
34+
}
3535

36-
type IteratorRangeOptions<T> = {
36+
interface IteratorRangeOptions<T> {
3737
step?: T;
3838

3939
inclusive?: boolean;
40-
};
40+
}
4141

4242
interface CoreJSPromiseLike<T> {
4343
/**

tests/eslint/eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1925,7 +1925,7 @@ const ts = {
19251925
// require that function overload signatures be consecutive
19261926
'@typescript-eslint/adjacent-overload-signatures': ERROR,
19271927
// enforce type definitions to consistently use either `interface` or `type`
1928-
'@typescript-eslint/consistent-type-definitions': [OFF, 'interface'],
1928+
'@typescript-eslint/consistent-type-definitions': [ERROR, 'interface'],
19291929
// disallow extra non-null assertions
19301930
'@typescript-eslint/no-extra-non-null-assertion': ERROR,
19311931
// enforce the use of top-level import type qualifier when an import only has specifiers with inline type qualifiers

tests/type-definitions/global/proposals/array-unique.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import 'core-js/full';
22

3-
type Obj = { a: number; b: string };
3+
interface Obj {
4+
a: number;
5+
b: string
6+
}
47
const arr: Obj[] = [{ a: 1, b: 'x' }, { a: 2, b: 'y' }];
58
const arrRes: Obj[] = arr.uniqueBy();
69
const arrRes2: Obj[] = arr.uniqueBy('a');

tests/type-definitions/global/proposals/decorator-metadata.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import 'core-js/full';
33
const rsmd1: symbol = Symbol.metadata;
44
const rsmd2: typeof Symbol.metadata = Symbol.metadata;
55

6-
type T = {
6+
interface T {
77
[Symbol.metadata]?: object;
8-
};
8+
}
99

1010
const obj: T = {};
1111
obj[Symbol.metadata] = { foo: 1 };

tests/type-definitions/pure/proposals/array-unique.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import arrayUniqueBy from '@core-js/pure/full/array/unique-by';
22

3-
type Obj = { a: number; b: string };
3+
interface Obj {
4+
a: number;
5+
b: string
6+
}
47
const arr: Obj[] = [{ a: 1, b: 'x' }, { a: 2, b: 'y' }];
58
const arrRes: Obj[] = arrayUniqueBy(arr);
69
const arrRes2: Obj[] = arrayUniqueBy(arr, 'a');

tests/type-definitions/pure/proposals/decorator-metadata.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import metadata from '@core-js/pure/full/symbol/metadata';
33
const rsmd1: symbol = metadata;
44
const rsmd2: typeof metadata = metadata;
55

6-
type T = {
6+
interface T {
77
[metadata]?: object;
8-
};
8+
}
99

1010
const obj: T = {};
1111
obj[metadata] = { foo: 1 };

0 commit comments

Comments
 (0)