Skip to content

Commit bbef9a6

Browse files
committed
typescript: inline types
1 parent 4d1e994 commit bbef9a6

File tree

180 files changed

+691
-609
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+691
-609
lines changed

.eslintrc.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ module.exports = {
1414
plugins: ['ember-internal', 'import', 'qunit', 'disable-features'],
1515
rules: {
1616
'no-console': 'error',
17+
'import/no-duplicates': ['error', { 'prefer-inline': true }],
18+
'import/consistent-type-specifier-style': ['error', 'prefer-inline'],
1719
'no-implicit-coercion': 'error',
1820
'no-new-wrappers': 'error',
1921
'no-unused-vars': 'error',
@@ -56,7 +58,11 @@ module.exports = {
5658
'@typescript-eslint/no-empty-function': 'off',
5759
'@typescript-eslint/no-this-alias': 'off',
5860
'@typescript-eslint/no-var-requires': 'warn',
59-
'@typescript-eslint/consistent-type-imports': 'error',
61+
// '@typescript-eslint/consistent-type-imports': 'error',
62+
'@typescript-eslint/consistent-type-imports': [
63+
'error',
64+
{ fixStyle: 'inline-type-imports' },
65+
],
6066

6167
// TODO: Enable and fix these rules
6268
// Typescript provides better types with these rules enabled

packages/@ember/-internals/container/lib/container.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import type {
2-
InternalFactory,
3-
FactoryClass,
4-
InternalOwner,
5-
RegisterOptions,
6-
FactoryManager,
7-
FullName,
1+
import {
2+
type InternalFactory,
3+
type FactoryClass,
4+
type InternalOwner,
5+
type RegisterOptions,
6+
type FactoryManager,
7+
type FullName,
8+
setOwner,
89
} from '@ember/-internals/owner';
9-
import { setOwner } from '@ember/-internals/owner';
10+
1011
import { dictionary } from '@ember/-internals/utils';
1112
import { assert } from '@ember/debug';
1213
import { DEBUG } from '@glimmer/env';
13-
import type { DebugRegistry } from './registry';
14+
import { type DebugRegistry } from './registry';
1415
import type Registry from './registry';
1516

1617
interface LeakTracking {

packages/@ember/-internals/container/lib/registry.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import type {
2-
FactoryClass,
3-
FullName,
4-
InternalFactory,
5-
KnownForTypeResult,
6-
RegisterOptions,
7-
Resolver,
1+
import {
2+
type FactoryClass,
3+
type FullName,
4+
type InternalFactory,
5+
type KnownForTypeResult,
6+
type RegisterOptions,
7+
type Resolver,
88
} from '@ember/-internals/owner';
99
import { dictionary, intern } from '@ember/-internals/utils';
1010
import { assert, deprecate } from '@ember/debug';
11-
import type { set } from '@ember/object';
11+
import { type set } from '@ember/object';
1212
import { DEBUG } from '@glimmer/env';
13-
import type { ContainerOptions, LazyInjection } from './container';
14-
import Container from './container';
13+
14+
import Container, { type ContainerOptions, type LazyInjection } from './container';
1515

1616
export interface Injection {
1717
property: string;

packages/@ember/-internals/glimmer/lib/component-managers/curly.ts

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,30 @@ import { addChildView, setElementView, setViewElement } from '@ember/-internals/
99
import { assert, debugFreeze } from '@ember/debug';
1010
import { _instrumentStart } from '@ember/instrumentation';
1111
import { DEBUG } from '@glimmer/env';
12-
import type {
13-
Bounds,
14-
CapturedArguments,
15-
CompilableProgram,
16-
Destroyable,
17-
ElementOperations,
18-
Environment,
19-
InternalComponentCapabilities,
20-
Option,
21-
PreparedArguments,
22-
TemplateFactory,
23-
VMArguments,
24-
WithCreateInstance,
25-
WithDynamicLayout,
26-
WithDynamicTagName,
12+
import {
13+
type Bounds,
14+
type CapturedArguments,
15+
type CompilableProgram,
16+
type Destroyable,
17+
type ElementOperations,
18+
type Environment,
19+
type InternalComponentCapabilities,
20+
type Option,
21+
type PreparedArguments,
22+
type TemplateFactory,
23+
type VMArguments,
24+
type WithCreateInstance,
25+
type WithDynamicLayout,
26+
type WithDynamicTagName,
2727
} from '@glimmer/interfaces';
28-
import type { Reference } from '@glimmer/reference';
29-
import { childRefFor, createComputeRef, createPrimitiveRef, valueForRef } from '@glimmer/reference';
28+
import {
29+
type Reference,
30+
childRefFor,
31+
createComputeRef,
32+
createPrimitiveRef,
33+
valueForRef,
34+
} from '@glimmer/reference';
35+
3036
import { reifyPositional } from '@glimmer/runtime';
3137
import { EMPTY_ARRAY, unwrapTemplate } from '@glimmer/util';
3238
import {
@@ -38,9 +44,9 @@ import {
3844
validateTag,
3945
valueForTag,
4046
} from '@glimmer/validator';
41-
import type { SimpleElement } from '@simple-dom/interface';
47+
import { type SimpleElement } from '@simple-dom/interface';
4248
import type Component from '../component';
43-
import type { DynamicScope } from '../renderer';
49+
import { type DynamicScope } from '../renderer';
4450
import type RuntimeResolver from '../resolver';
4551
import { isTemplateFactory } from '../template';
4652
import {

packages/@ember/-internals/glimmer/lib/component-managers/mount.ts

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
1-
import type { InternalOwner } from '@ember/-internals/owner';
1+
import { type InternalOwner } from '@ember/-internals/owner';
22
import { generateControllerFactory } from '@ember/routing/-internals';
33
import { assert } from '@ember/debug';
44
import EngineInstance from '@ember/engine/instance';
55
import { associateDestroyableChild } from '@glimmer/destroyable';
6-
import type {
7-
CapturedArguments,
8-
ComponentDefinition,
9-
CustomRenderNode,
10-
Destroyable,
11-
Environment,
12-
InternalComponentCapabilities,
13-
Option,
14-
TemplateFactory,
15-
VMArguments,
16-
WithCreateInstance,
17-
WithCustomDebugRenderTree,
18-
WithDynamicLayout,
19-
WithSubOwner,
6+
import {
7+
type CapturedArguments,
8+
type ComponentDefinition,
9+
type CustomRenderNode,
10+
type Destroyable,
11+
type Environment,
12+
type InternalComponentCapabilities,
13+
type Option,
14+
type TemplateFactory,
15+
type VMArguments,
16+
type WithCreateInstance,
17+
type WithCustomDebugRenderTree,
18+
type WithDynamicLayout,
19+
type WithSubOwner,
2020
} from '@glimmer/interfaces';
2121
import { capabilityFlagsFrom } from '@glimmer/manager';
22-
import type { Reference } from '@glimmer/reference';
23-
import { createConstRef, valueForRef } from '@glimmer/reference';
22+
import { type Reference, createConstRef, valueForRef } from '@glimmer/reference';
23+
2424
import { unwrapTemplate } from '@glimmer/util';
2525
import type RuntimeResolver from '../resolver';
2626

packages/@ember/-internals/glimmer/lib/component-managers/outlet.ts

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,34 @@
11
import { ENV } from '@ember/-internals/environment';
2-
import type { InternalOwner } from '@ember/-internals/owner';
2+
import { type InternalOwner } from '@ember/-internals/owner';
33
import { guidFor } from '@ember/-internals/utils';
44
import { assert } from '@ember/debug';
55
import EngineInstance from '@ember/engine/instance';
66
import { _instrumentStart } from '@ember/instrumentation';
7-
import type {
8-
CapturedArguments,
9-
CompilableProgram,
10-
ComponentDefinition,
11-
CustomRenderNode,
12-
Destroyable,
13-
Environment,
14-
InternalComponentCapabilities,
15-
InternalComponentCapability,
16-
Option,
17-
Template,
18-
VMArguments,
19-
WithCreateInstance,
20-
WithCustomDebugRenderTree,
21-
WithDynamicTagName,
7+
import {
8+
type CapturedArguments,
9+
type CompilableProgram,
10+
type ComponentDefinition,
11+
type CustomRenderNode,
12+
type Destroyable,
13+
type Environment,
14+
type InternalComponentCapabilities,
15+
type InternalComponentCapability,
16+
type Option,
17+
type Template,
18+
type VMArguments,
19+
type WithCreateInstance,
20+
type WithCustomDebugRenderTree,
21+
type WithDynamicTagName,
2222
} from '@glimmer/interfaces';
2323
import { capabilityFlagsFrom } from '@glimmer/manager';
24-
import type { Reference } from '@glimmer/reference';
25-
import { createConstRef, valueForRef } from '@glimmer/reference';
24+
import { type Reference, createConstRef, valueForRef } from '@glimmer/reference';
25+
2626
import { EMPTY_ARGS } from '@glimmer/runtime';
2727
import { unwrapTemplate } from '@glimmer/util';
2828

29-
import type { SimpleElement } from '@simple-dom/interface';
30-
import type { DynamicScope } from '../renderer';
31-
import type { OutletState } from '../utils/outlet';
29+
import { type SimpleElement } from '@simple-dom/interface';
30+
import { type DynamicScope } from '../renderer';
31+
import { type OutletState } from '../utils/outlet';
3232
import type OutletView from '../views/outlet';
3333

3434
function instrumentationPayload(def: OutletDefinitionState) {

packages/@ember/-internals/glimmer/lib/component-managers/root.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@ import { getFactoryFor } from '@ember/-internals/container';
22
import { assert } from '@ember/debug';
33
import { _instrumentStart } from '@ember/instrumentation';
44
import { DEBUG } from '@glimmer/env';
5-
import type {
6-
ComponentDefinition,
7-
Environment,
8-
InternalComponentCapabilities,
9-
Option,
10-
Owner,
11-
VMArguments,
5+
import {
6+
type ComponentDefinition,
7+
type Environment,
8+
type InternalComponentCapabilities,
9+
type Option,
10+
type Owner,
11+
type VMArguments,
1212
} from '@glimmer/interfaces';
1313
import { capabilityFlagsFrom } from '@glimmer/manager';
1414
import { CONSTANT_TAG, consumeTag } from '@glimmer/validator';
1515
import type Component from '../component';
16-
import type { DynamicScope } from '../renderer';
16+
import { type DynamicScope } from '../renderer';
1717
import ComponentStateBucket from '../utils/curly-component-state-bucket';
1818
import CurlyComponentManager, {
1919
DIRTY_TAG,

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { get, PROPERTY_DID_CHANGE } from '@ember/-internals/metal';
2-
import type { PropertyDidChange } from '@ember/-internals/metal/lib/property_events';
2+
import { type PropertyDidChange } from '@ember/-internals/metal/lib/property_events';
33
import { getOwner } from '@ember/-internals/owner';
44
import { TargetActionSupport } from '@ember/-internals/runtime';
55
import {
@@ -14,12 +14,12 @@ import {
1414
} from '@ember/-internals/views';
1515
import { assert } from '@ember/debug';
1616
import { DEBUG } from '@glimmer/env';
17-
import type { Environment, Template, TemplateFactory } from '@glimmer/interfaces';
17+
import { type Environment, type Template, type TemplateFactory } from '@glimmer/interfaces';
1818
import { setInternalComponentManager } from '@glimmer/manager';
1919
import { isUpdatableRef, updateRef } from '@glimmer/reference';
2020
import { normalizeProperty } from '@glimmer/runtime';
21-
import type { DirtyableTag } from '@glimmer/validator';
22-
import { createTag, dirtyTag } from '@glimmer/validator';
21+
import { type DirtyableTag, createTag, dirtyTag } from '@glimmer/validator';
22+
2323
import { Namespace } from '@simple-dom/interface';
2424
import {
2525
ARGS,

packages/@ember/-internals/glimmer/lib/components/abstract-input.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
import { tracked } from '@ember/-internals/metal';
22
import { assert } from '@ember/debug';
33
import { action } from '@ember/object';
4-
import type { Reference } from '@glimmer/reference';
5-
import { isConstRef, isUpdatableRef, updateRef, valueForRef } from '@glimmer/reference';
6-
import type { EventListener } from './internal';
7-
import InternalComponent from './internal';
4+
import {
5+
type Reference,
6+
isConstRef,
7+
isUpdatableRef,
8+
updateRef,
9+
valueForRef,
10+
} from '@glimmer/reference';
11+
12+
import InternalComponent, { type EventListener } from './internal';
813

914
const UNINITIALIZED: unknown = Object.freeze({});
1015

packages/@ember/-internals/glimmer/lib/components/internal.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
1-
import type { InternalOwner } from '@ember/-internals/owner';
2-
import { setOwner } from '@ember/-internals/owner';
1+
import { type InternalOwner, setOwner } from '@ember/-internals/owner';
2+
33
import { guidFor } from '@ember/-internals/utils';
44
import { assert } from '@ember/debug';
5-
import type {
6-
CapturedArguments,
7-
Destroyable,
8-
DynamicScope,
9-
Environment,
10-
InternalComponentCapabilities,
11-
InternalComponentManager,
12-
TemplateFactory,
13-
VMArguments,
14-
WithCreateInstance,
5+
import {
6+
type CapturedArguments,
7+
type Destroyable,
8+
type DynamicScope,
9+
type Environment,
10+
type InternalComponentCapabilities,
11+
type InternalComponentManager,
12+
type TemplateFactory,
13+
type VMArguments,
14+
type WithCreateInstance,
1515
} from '@glimmer/interfaces';
1616
import { setComponentTemplate, setInternalComponentManager } from '@glimmer/manager';
17-
import type { Reference } from '@glimmer/reference';
18-
import { createConstRef, isConstRef, valueForRef } from '@glimmer/reference';
17+
import { type Reference, createConstRef, isConstRef, valueForRef } from '@glimmer/reference';
18+
1919
import { untrack } from '@glimmer/validator';
2020

2121
function NOOP(): void {}

0 commit comments

Comments
 (0)