Skip to content

Commit de03798

Browse files
committed
Disable @typescript-eslint/no-empty-object-type at the site of
complaints. I don't know enough to make any changes but the directives are better than blocking an upgrade.
1 parent 4680ca3 commit de03798

File tree

8 files changed

+22
-0
lines changed

8 files changed

+22
-0
lines changed

packages/@ember/-internals/glimmer/lib/components/link-to.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import LinkToTemplate from '../templates/link-to';
1616
import InternalComponent, { type OpaqueInternalComponentConstructor, opaquify } from './internal';
1717
import { type Opaque } from '@ember/-internals/utility-types';
1818

19+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
1920
const EMPTY_ARRAY: {}[] = [];
2021
const EMPTY_QUERY_PARAMS = {};
2122

@@ -32,6 +33,7 @@ function isPresent<T>(value: Maybe<T>): value is T {
3233

3334
interface QueryParams {
3435
isQueryParams: true;
36+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
3537
values: Nullable<{}>;
3638
}
3739

@@ -434,6 +436,7 @@ class _LinkTo extends InternalComponent {
434436
}
435437

436438
// TODO: not sure why generateURL takes {}[] instead of unknown[]
439+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
437440
private get models(): {}[] {
438441
if ('models' in this.args.named) {
439442
let models = this.named('models');
@@ -445,6 +448,7 @@ class _LinkTo extends InternalComponent {
445448

446449
return models;
447450
} else if ('model' in this.args.named) {
451+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
448452
return [this.named('model') as {}];
449453
} else {
450454
return EMPTY_ARRAY;
@@ -623,11 +627,13 @@ let descriptorFor = (target: object, property: string): Nullable<PropertyDescrip
623627
superModelsDescriptor && typeof superModelsDescriptor.get === 'function'
624628
);
625629

630+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
626631
let superModelsGetter = superModelsDescriptor.get as (this: _LinkTo) => {}[];
627632

628633
Object.defineProperty(prototype, 'models', {
629634
configurable: true,
630635
enumerable: false,
636+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
631637
get: function models(this: _LinkTo): {}[] {
632638
let models = superModelsGetter.call(this);
633639

@@ -648,11 +654,13 @@ let descriptorFor = (target: object, property: string): Nullable<PropertyDescrip
648654
superQueryDescriptor && typeof superQueryDescriptor.get === 'function'
649655
);
650656

657+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
651658
let superQueryGetter = superQueryDescriptor.get as (this: _LinkTo) => {};
652659

653660
Object.defineProperty(prototype, 'query', {
654661
configurable: true,
655662
enumerable: false,
663+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
656664
get: function query(this: _LinkTo): {} {
657665
if ('query' in this.args.named) {
658666
let qp = superQueryGetter.call(this);

packages/@ember/-internals/glimmer/lib/helper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export const RECOMPUTE_TAG = Symbol('RECOMPUTE_TAG');
1919
// Signature type utilities
2020
type GetOr<T, K, Else> = K extends keyof T ? T[K] : Else;
2121

22+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
2223
type Args<S> = GetOr<S, 'Args', {}>;
2324

2425
type DefaultPositional = unknown[];

packages/@ember/routing/lib/dsl.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ let uuid = 0;
99
export interface RouteOptions {
1010
path?: string;
1111
resetNamespace?: boolean;
12+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
1213
serialize?: (model: {}, params: string[]) => { [key: string]: unknown | undefined };
1314
overrideNameAssertion?: boolean;
1415
}
@@ -49,6 +50,7 @@ export interface DSLImplOptions {
4950

5051
export default class DSLImpl implements DSL {
5152
parent: string | null;
53+
// eslint-disable-next-line @typescript-eslint/no-wrapper-object-types
5254
matches: Array<Object | undefined>;
5355
enableLoadingSubstates: boolean;
5456
explicitIndex = false;
@@ -128,6 +130,7 @@ export default class DSLImpl implements DSL {
128130
url: string,
129131
name: string,
130132
callback?: MatchCallback,
133+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
131134
serialize?: (model: {}, params: string[]) => { [key: string]: unknown | undefined }
132135
): void {
133136
let parts = name.split('.');

packages/@ember/routing/lib/engines.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ export interface EngineInfo {
77

88
export interface EngineRouteInfo extends EngineInfo {
99
localFullName: string;
10+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
1011
serializeMethod?: (model: {}, params: string[]) => { [key: string]: unknown | undefined };
1112
}

packages/@ember/routing/lib/generate_controller.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,12 @@ import { DEBUG } from '@glimmer/env';
1616
@private
1717
*/
1818

19+
/* eslint-disable @typescript-eslint/no-empty-object-type */
1920
export function generateControllerFactory(
2021
owner: Owner,
2122
controllerName: string
2223
): InternalFactory<{}> {
24+
/* eslint-enable @typescript-eslint/no-empty-object-type */
2325
let factoryManager = owner.factoryFor('controller:basic');
2426
assert(
2527
'[BUG] unexpectedly missing a factoryManager for `controller:basic`',
@@ -46,6 +48,7 @@ export function generateControllerFactory(
4648

4749
owner.register(fullName, Factory);
4850

51+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
4952
return owner.factoryFor(fullName) as InternalFactory<{}>;
5053
}
5154

packages/@ember/routing/lib/utils.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ function _calculateCacheValuePrefix(prefix: string, part: string) {
137137
/*
138138
Stolen from Controller
139139
*/
140+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
140141
export function calculateCacheKey(prefix: string, parts: string[] = [], values: {} | null): string {
141142
let suffixes = '';
142143
for (let part of parts) {

packages/@ember/routing/route.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -720,6 +720,7 @@ class Route<Model = unknown> extends EmberObject.extend(ActionHandler, Evented)
720720
721721
@property _optionsForQueryParam
722722
*/
723+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
723724
_optionsForQueryParam(qp: QueryParam): {} {
724725
const queryParams = get(this, 'queryParams');
725726
return (
@@ -2097,6 +2098,7 @@ Route.reopen({
20972098
@returns {boolean}
20982099
@private
20992100
*/
2101+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
21002102
queryParamsDidChange<T>(this: Route<T>, changed: {}, _totalPresent: unknown, removed: {}) {
21012103
// SAFETY: Since `_qp` is protected we can't infer the type
21022104
let qpMap = (get(this, '_qp') as Route<T>['_qp']).map;
@@ -2120,6 +2122,7 @@ Route.reopen({
21202122
finalizeQueryParamChange<T>(
21212123
this: Route<T>,
21222124
params: Record<string, string | null | undefined>,
2125+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
21232126
finalParams: {}[],
21242127
transition: Transition
21252128
) {

packages/@ember/routing/router.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export interface QueryParam {
109109
type: string;
110110
route: Route;
111111
parts?: string[];
112+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
112113
values: {} | null;
113114
scopedPropertyName: string;
114115
scope: string;
@@ -1068,6 +1069,7 @@ class EmberRouter extends EmberObject.extend(Evented) implements Evented {
10681069
targetRouteName: string,
10691070
models: ModelFor<Route>[],
10701071
queryParams: Record<string, unknown>,
1072+
// eslint-disable-next-line @typescript-eslint/no-empty-object-type
10711073
_queryParams: {}
10721074
) {
10731075
// merge in any queryParams from the active transition which could include

0 commit comments

Comments
 (0)