language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/component-managers/root.ts
@@ -1,8 +1,5 @@ import { ComponentCapabilities } from '@glimmer/interfaces'; -import { - Arguments, - ComponentDefinition -} from '@glimmer/runtime'; +import { Arguments, ComponentDefinition } from '@glimmer/runtime'; import { FACTORY_FOR } from 'container'; import { DEBUG } from 'ember-env-flags'; import { _instrumentStart } from 'ember-metal'; @@ -34,10 +31,12 @@ class RootComponentManager extends CurlyComponentManager { }; } - create(environment: Environment, - _state: DefinitionState, - _args: Arguments | null, - dynamicScope: DynamicScope) { + create( + environment: Environment, + _state: DefinitionState, + _args: Arguments | null, + dynamicScope: DynamicScope + ) { let component = this.component; if (DEBUG) { @@ -81,7 +80,7 @@ export const ROOT_CAPABILITIES: ComponentCapabilities = { createCaller: true, dynamicScope: true, updateHook: true, - createInstance: false + createInstance: false, }; export class RootComponentDefinition implements ComponentDefinition {
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/component-managers/template-only.ts
@@ -1,6 +1,11 @@ import { ComponentCapabilities } from '@glimmer/interfaces'; import { CONSTANT_TAG } from '@glimmer/reference'; -import { ComponentDefinition, Invocation, NULL_REFERENCE, WithStaticLayout } from '@glimmer/runtime'; +import { + ComponentDefinition, + Invocation, + NULL_REFERENCE, + WithStaticLayout, +} from '@glimmer/runtime'; import { OwnedTemplateMeta } from 'ember-views'; import RuntimeResolver from '../resolver'; import { OwnedTemplate } from '../template'; @@ -16,15 +21,16 @@ const CAPABILITIES: ComponentCapabilities = { createCaller: true, dynamicScope: true, updateHook: true, - createInstance: true + createInstance: true, }; -export default class TemplateOnlyComponentManager extends AbstractManager<null, OwnedTemplate> implements WithStaticLayout<null, OwnedTemplate, OwnedTemplateMeta, RuntimeResolver> { +export default class TemplateOnlyComponentManager extends AbstractManager<null, OwnedTemplate> + implements WithStaticLayout<null, OwnedTemplate, OwnedTemplateMeta, RuntimeResolver> { getLayout(template: OwnedTemplate): Invocation { const layout = template.asLayout(); return { handle: layout.compile(), - symbolTable: layout.symbolTable + symbolTable: layout.symbolTable, }; } @@ -51,8 +57,8 @@ export default class TemplateOnlyComponentManager extends AbstractManager<null, const MANAGER = new TemplateOnlyComponentManager(); -export class TemplateOnlyComponentDefinition implements ComponentDefinition<OwnedTemplate, TemplateOnlyComponentManager> { +export class TemplateOnlyComponentDefinition + implements ComponentDefinition<OwnedTemplate, TemplateOnlyComponentManager> { manager = MANAGER; - constructor(public state: OwnedTemplate) { - } + constructor(public state: OwnedTemplate) {} }
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/component.ts
@@ -1,13 +1,7 @@ import { DirtyableTag } from '@glimmer/reference'; -import { - normalizeProperty, - SVG_NAMESPACE -} from '@glimmer/runtime'; +import { normalizeProperty, SVG_NAMESPACE } from '@glimmer/runtime'; import { assert } from 'ember-debug'; -import { - get, - PROPERTY_DID_CHANGE, -} from 'ember-metal'; +import { get, PROPERTY_DID_CHANGE } from 'ember-metal'; import { TargetActionSupport } from 'ember-runtime'; import { getOwner, symbol } from 'ember-utils'; import { @@ -562,7 +556,8 @@ const Component = CoreView.extend( ClassNamesSupport, TargetActionSupport, ActionSupport, - ViewMixin, { + ViewMixin, + { isComponent: true, init() { @@ -576,21 +571,23 @@ const Component = CoreView.extend( assert( // tslint:disable-next-line:max-line-length `You can not define a function that handles DOM events in the \`${this}\` tagless component since it doesn't have any DOM element.`, - this.tagName !== '' || !this.renderer._destinedForDOM || !(() => { - let eventDispatcher = getOwner(this).lookup<any | undefined>('event_dispatcher:main'); - let events = (eventDispatcher && eventDispatcher._finalEvents) || {}; - - // tslint:disable-next-line:forin - for (let key in events) { - let methodName = events[key]; - - if (typeof this[methodName] === 'function') { - return true; // indicate that the assertion should be triggered + this.tagName !== '' || + !this.renderer._destinedForDOM || + !(() => { + let eventDispatcher = getOwner(this).lookup<any | undefined>('event_dispatcher:main'); + let events = (eventDispatcher && eventDispatcher._finalEvents) || {}; + + // tslint:disable-next-line:forin + for (let key in events) { + let methodName = events[key]; + + if (typeof this[methodName] === 'function') { + return true; // indicate that the assertion should be triggered + } } - } - return false; - } - )()); + return false; + })() + ); }, rerender() { @@ -599,7 +596,9 @@ const Component = CoreView.extend( }, [PROPERTY_DID_CHANGE](key: string) { - if (this[IS_DISPATCHING_ATTRS]) { return; } + if (this[IS_DISPATCHING_ATTRS]) { + return; + } let args = this[ARGS]; let reference = args && args[key]; @@ -905,7 +904,7 @@ const Component = CoreView.extend( @default null @public */ - }, + } ); Component.toString = () => '@ember/component'; @@ -915,4 +914,4 @@ Component.reopenClass({ positionalParams: [], }); -export default Component; \ No newline at end of file +export default Component;
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/components/checkbox.ts
@@ -57,7 +57,7 @@ const Checkbox = EmberComponent.extend({ }, change() { - set(this, 'checked', this.element.checked); + set(this, 'checked', this.element.checked); }, });
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/components/link-to.ts
@@ -298,14 +298,8 @@ import { assert, warn } from 'ember-debug'; import { DEBUG } from 'ember-env-flags'; -import { - computed, - flaggedInstrument, - get, -} from 'ember-metal'; -import { - inject, -} from 'ember-runtime'; +import { computed, flaggedInstrument, get } from 'ember-metal'; +import { inject } from 'ember-runtime'; import { isSimpleClick } from 'ember-views'; import EmberComponent, { HAS_BLOCK } from '../component'; import layout from '../templates/link-to'; @@ -532,11 +526,15 @@ const LinkComponent = EmberComponent.extend({ }), _isActive(routerState: any) { - if (get(this, 'loading')) { return false; } + if (get(this, 'loading')) { + return false; + } let currentWhen = get(this, 'current-when'); - if (typeof currentWhen === 'boolean') { return currentWhen; } + if (typeof currentWhen === 'boolean') { + return currentWhen; + } let isCurrentWhenSpecified = !!currentWhen; currentWhen = currentWhen || get(this, 'qualifiedRouteName'); @@ -547,7 +545,15 @@ const LinkComponent = EmberComponent.extend({ let resolvedQueryParams = get(this, 'resolvedQueryParams'); for (let i = 0; i < currentWhen.length; i++) { - if (routing.isActiveForRoute(models, resolvedQueryParams, currentWhen[i], routerState, isCurrentWhenSpecified)) { + if ( + routing.isActiveForRoute( + models, + resolvedQueryParams, + currentWhen[i], + routerState, + isCurrentWhenSpecified + ) + ) { return true; } } @@ -573,35 +579,51 @@ const LinkComponent = EmberComponent.extend({ return this.get('_active') ? get(this, 'activeClass') : false; }), - _active: computed('_routing.currentState', 'attrs.params', function computeLinkToComponentActive(this: any) { + _active: computed('_routing.currentState', 'attrs.params', function computeLinkToComponentActive( + this: any + ) { let currentState = get(this, '_routing.currentState'); - if (!currentState) { return false; } + if (!currentState) { + return false; + } return this._isActive(currentState); }), - willBeActive: computed('_routing.targetState', function computeLinkToComponentWillBeActive(this: any) { + willBeActive: computed('_routing.targetState', function computeLinkToComponentWillBeActive( + this: any + ) { let routing = get(this, '_routing'); let targetState = get(routing, 'targetState'); - if (get(routing, 'currentState') === targetState) { return; } + if (get(routing, 'currentState') === targetState) { + return; + } return this._isActive(targetState); }), - transitioningIn: computed('active', 'willBeActive', function computeLinkToComponentTransitioningIn(this: any) { - if (get(this, 'willBeActive') === true && !get(this, '_active')) { - return 'ember-transitioning-in'; - } else { - return false; + transitioningIn: computed( + 'active', + 'willBeActive', + function computeLinkToComponentTransitioningIn(this: any) { + if (get(this, 'willBeActive') === true && !get(this, '_active')) { + return 'ember-transitioning-in'; + } else { + return false; + } } - }), - - transitioningOut: computed('active', 'willBeActive', function computeLinkToComponentTransitioningOut(this: any) { - if (get(this, 'willBeActive') === false && get(this, '_active')) { - return 'ember-transitioning-out'; - } else { - return false; + ), + + transitioningOut: computed( + 'active', + 'willBeActive', + function computeLinkToComponentTransitioningOut(this: any) { + if (get(this, 'willBeActive') === false && get(this, '_active')) { + return 'ember-transitioning-out'; + } else { + return false; + } } - }), + ), /** Event handler that invokes the link, activating the associated route. @@ -611,7 +633,9 @@ const LinkComponent = EmberComponent.extend({ @private */ _invoke(this: any, event: Event): boolean { - if (!isSimpleClick(event)) { return true; } + if (!isSimpleClick(event)) { + return true; + } let preventDefault = get(this, 'preventDefault'); let targetAttribute = get(this, 'target'); @@ -622,15 +646,23 @@ const LinkComponent = EmberComponent.extend({ } } - if (get(this, 'bubbles') === false) { event.stopPropagation(); } + if (get(this, 'bubbles') === false) { + event.stopPropagation(); + } - if (this._isDisabled) { return false; } + if (this._isDisabled) { + return false; + } if (get(this, 'loading')) { // tslint:disable-next-line:max-line-length - warn('This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.', false, { - id: 'ember-glimmer.link-to.inactive-loading-state' - }); + warn( + 'This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.', + false, + { + id: 'ember-glimmer.link-to.inactive-loading-state', + } + ); return false; } @@ -649,43 +681,67 @@ const LinkComponent = EmberComponent.extend({ }; // tslint:disable-next-line:max-line-length - flaggedInstrument('interaction.link-to', payload, this._generateTransition(payload, qualifiedRouteName, models, queryParams, shouldReplace)); + flaggedInstrument( + 'interaction.link-to', + payload, + this._generateTransition(payload, qualifiedRouteName, models, queryParams, shouldReplace) + ); return false; }, - _generateTransition(payload: any, qualifiedRouteName: string, models: any[], queryParams: any[], shouldReplace: boolean) { + _generateTransition( + payload: any, + qualifiedRouteName: string, + models: any[], + queryParams: any[], + shouldReplace: boolean + ) { let routing = get(this, '_routing'); return () => { - payload.transition = routing.transitionTo(qualifiedRouteName, models, queryParams, shouldReplace); + payload.transition = routing.transitionTo( + qualifiedRouteName, + models, + queryParams, + shouldReplace + ); }; }, queryParams: null, - qualifiedRouteName: computed('targetRouteName', '_routing.currentState', - function computeLinkToComponentQualifiedRouteName(this: any) { - let params = get(this, 'params'); - let paramsLength = params.length; - let lastParam = params[paramsLength - 1]; - if (lastParam && lastParam.isQueryParams) { - paramsLength--; - } - let onlyQueryParamsSupplied = (this[HAS_BLOCK] ? paramsLength === 0 : paramsLength === 1); - if (onlyQueryParamsSupplied) { - return get(this, '_routing.currentRouteName'); + qualifiedRouteName: computed( + 'targetRouteName', + '_routing.currentState', + function computeLinkToComponentQualifiedRouteName(this: any) { + let params = get(this, 'params'); + let paramsLength = params.length; + let lastParam = params[paramsLength - 1]; + if (lastParam && lastParam.isQueryParams) { + paramsLength--; + } + let onlyQueryParamsSupplied = this[HAS_BLOCK] ? paramsLength === 0 : paramsLength === 1; + if (onlyQueryParamsSupplied) { + return get(this, '_routing.currentRouteName'); + } + return get(this, 'targetRouteName'); } - return get(this, 'targetRouteName'); - }), + ), - resolvedQueryParams: computed('queryParams', function computeLinkToComponentResolvedQueryParams(this: any) { + resolvedQueryParams: computed('queryParams', function computeLinkToComponentResolvedQueryParams( + this: any + ) { let resolvedQueryParams = {}; let queryParams = get(this, 'queryParams'); - if (!queryParams) { return resolvedQueryParams; } + if (!queryParams) { + return resolvedQueryParams; + } let values = queryParams.values; for (let key in values) { - if (!values.hasOwnProperty(key)) { continue; } + if (!values.hasOwnProperty(key)) { + continue; + } resolvedQueryParams[key] = values[key]; } @@ -703,12 +759,16 @@ const LinkComponent = EmberComponent.extend({ @private */ href: computed('models', 'qualifiedRouteName', function computeLinkToComponentHref(this: any) { - if (get(this, 'tagName') !== 'a') { return; } + if (get(this, 'tagName') !== 'a') { + return; + } let qualifiedRouteName = get(this, 'qualifiedRouteName'); let models = get(this, 'models'); - if (get(this, 'loading')) { return get(this, 'loadingHref'); } + if (get(this, 'loading')) { + return get(this, 'loadingHref'); + } let routing = get(this, '_routing'); let queryParams = get(this, 'queryParams.values'); @@ -729,27 +789,38 @@ const LinkComponent = EmberComponent.extend({ routing.generateURL(qualifiedRouteName, models, queryParams); } catch (e) { // tslint:disable-next-line:max-line-length - assert('You attempted to define a `{{link-to "' + qualifiedRouteName + '"}}` but did not pass the parameters required for generating its dynamic segments. ' + e.message); + assert( + 'You attempted to define a `{{link-to "' + + qualifiedRouteName + + '"}}` but did not pass the parameters required for generating its dynamic segments. ' + + e.message + ); } } return routing.generateURL(qualifiedRouteName, models, queryParams); }), - loading: computed('_modelsAreLoaded', 'qualifiedRouteName', function computeLinkToComponentLoading(this: any) { - let qualifiedRouteName = get(this, 'qualifiedRouteName'); - let modelsAreLoaded = get(this, '_modelsAreLoaded'); + loading: computed( + '_modelsAreLoaded', + 'qualifiedRouteName', + function computeLinkToComponentLoading(this: any) { + let qualifiedRouteName = get(this, 'qualifiedRouteName'); + let modelsAreLoaded = get(this, '_modelsAreLoaded'); - if (!modelsAreLoaded || qualifiedRouteName === null || qualifiedRouteName === undefined) { - return get(this, 'loadingClass'); + if (!modelsAreLoaded || qualifiedRouteName === null || qualifiedRouteName === undefined) { + return get(this, 'loadingClass'); + } } - }), + ), _modelsAreLoaded: computed('models', function computeLinkToComponentModelsAreLoaded(this: any) { let models = get(this, 'models'); for (let i = 0; i < models.length; i++) { let model = models[i]; - if (model === null || model === undefined) { return false; } + if (model === null || model === undefined) { + return false; + } } return true; @@ -789,7 +860,10 @@ const LinkComponent = EmberComponent.extend({ params = params.slice(); } - assert('You must provide one or more parameters to the link-to component.', params && params.length); + assert( + 'You must provide one or more parameters to the link-to component.', + params && params.length + ); let disabledWhen = get(this, 'disabledWhen'); if (disabledWhen !== undefined) {
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/components/text_field.ts
@@ -29,7 +29,7 @@ function canSetTypeOfInput(type: string) { // ignored } - return inputTypes[type] = inputTypeTestElement.type === type; + return (inputTypes[type] = inputTypeTestElement.type === type); } /**
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/dom.ts
@@ -3,9 +3,6 @@ export { DOMChanges, DOMTreeConstruction, clientBuilder, - rehydrationBuilder + rehydrationBuilder, } from '@glimmer/runtime'; -export { - NodeDOMTreeConstruction, - serializeBuilder -} from '@glimmer/node'; +export { NodeDOMTreeConstruction, serializeBuilder } from '@glimmer/node';
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/environment.ts
@@ -1,27 +1,17 @@ -import { - OpaqueIterable, VersionedReference, -} from '@glimmer/reference'; +import { OpaqueIterable, VersionedReference } from '@glimmer/reference'; import { ElementBuilder, Environment as GlimmerEnvironment, SimpleDynamicAttribute, } from '@glimmer/runtime'; -import { - Destroyable, Opaque, -} from '@glimmer/util'; +import { Destroyable, Opaque } from '@glimmer/util'; import { warn } from 'ember-debug'; import { DEBUG } from 'ember-env-flags'; import { OWNER, Owner } from 'ember-utils'; -import { - constructStyleDeprecationMessage, - lookupComponent, -} from 'ember-views'; +import { constructStyleDeprecationMessage, lookupComponent } from 'ember-views'; import DebugStack from './utils/debug-stack'; import createIterable from './utils/iterable'; -import { - ConditionalReference, - UpdatableReference, -} from './utils/references'; +import { ConditionalReference, UpdatableReference } from './utils/references'; import { isHTMLSafe } from './utils/string'; import installPlatformSpecificProtocolForURL from './protocol-for-url'; @@ -121,30 +111,49 @@ export default class Environment extends GlimmerEnvironment { if (DEBUG) { class StyleAttributeManager extends SimpleDynamicAttribute { set(dom: ElementBuilder, value: Opaque, env: GlimmerEnvironment): void { - warn(constructStyleDeprecationMessage(value), (() => { - if (value === null || value === undefined || isHTMLSafe(value)) { - return true; - } - return false; - })(), { id: 'ember-htmlbars.style-xss-warning' }); + warn( + constructStyleDeprecationMessage(value), + (() => { + if (value === null || value === undefined || isHTMLSafe(value)) { + return true; + } + return false; + })(), + { id: 'ember-htmlbars.style-xss-warning' } + ); super.set(dom, value, env); } update(value: Opaque, env: GlimmerEnvironment): void { - warn(constructStyleDeprecationMessage(value), (() => { - if (value === null || value === undefined || isHTMLSafe(value)) { - return true; - } - return false; - })(), { id: 'ember-htmlbars.style-xss-warning' }); + warn( + constructStyleDeprecationMessage(value), + (() => { + if (value === null || value === undefined || isHTMLSafe(value)) { + return true; + } + return false; + })(), + { id: 'ember-htmlbars.style-xss-warning' } + ); super.update(value, env); } } - Environment.prototype.attributeFor = function (element, attribute: string, isTrusting: boolean, _namespace?) { + Environment.prototype.attributeFor = function( + element, + attribute: string, + isTrusting: boolean, + _namespace? + ) { if (attribute === 'style' && !isTrusting) { return StyleAttributeManager; } - return GlimmerEnvironment.prototype.attributeFor.call(this, element, attribute, isTrusting, _namespace); + return GlimmerEnvironment.prototype.attributeFor.call( + this, + element, + attribute, + isTrusting, + _namespace + ); }; }
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/helper.ts
@@ -37,9 +37,9 @@ export interface HelperInstance { } export function isHelperFactory(helper: any | undefined | null): helper is HelperFactory { - return typeof helper === 'object' && - helper !== null && - helper.class && helper.class.isHelperFactory; + return ( + typeof helper === 'object' && helper !== null && helper.class && helper.class.isHelperFactory + ); } export function isSimpleHelper(helper: HelperFactory): helper is SimpleHelperFactory {
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/helpers/-normalize-class.ts
@@ -3,7 +3,10 @@ import { String as StringUtils } from 'ember-runtime'; import { InternalHelperReference } from '../utils/references'; function normalizeClass({ positional }: any) { - let classNameParts = positional.at(0).value().split('.'); + let classNameParts = positional + .at(0) + .value() + .split('.'); let className = classNameParts[classNameParts.length - 1]; let value = positional.at(1).value();
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/helpers/action.ts
@@ -6,12 +6,7 @@ import { Arguments, VM } from '@glimmer/runtime'; import { Opaque } from '@glimmer/util'; import { assert } from 'ember-debug'; import { DEBUG } from 'ember-env-flags'; -import { - flaggedInstrument, - get, - isNone, - join, -} from 'ember-metal'; +import { flaggedInstrument, get, isNone, join } from 'ember-metal'; import { ACTION, INVOKE, UnboundReference } from '../utils/references'; /** @@ -300,15 +295,19 @@ export default function(_vm: VM, args: Arguments): UnboundReference<Function> { return new UnboundReference(fn); } -function NOOP(args: Arguments) { return args; } +function NOOP(args: Arguments) { + return args; +} -function makeArgsProcessor(valuePathRef: VersionedPathReference<Opaque> | false, - actionArgsRef: Array<VersionedPathReference<Opaque>>) { +function makeArgsProcessor( + valuePathRef: VersionedPathReference<Opaque> | false, + actionArgsRef: Array<VersionedPathReference<Opaque>> +) { let mergeArgs: any; if (actionArgsRef.length > 0) { mergeArgs = (args: Arguments) => { - return actionArgsRef.map((ref) => ref.value()).concat(args); + return actionArgsRef.map(ref => ref.value()).concat(args); }; } @@ -335,40 +334,59 @@ function makeArgsProcessor(valuePathRef: VersionedPathReference<Opaque> | false, } } -function makeDynamicClosureAction(context: any, targetRef: any, actionRef: any, processArgs: any, debugKey: any) { +function makeDynamicClosureAction( + context: any, + targetRef: any, + actionRef: any, + processArgs: any, + debugKey: any +) { // We don't allow undefined/null values, so this creates a throw-away action to trigger the assertions if (DEBUG) { makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey); } return (...args: any[]) => { - return makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey)(...args); + return makeClosureAction(context, targetRef.value(), actionRef.value(), processArgs, debugKey)( + ...args + ); }; } -function makeClosureAction(context: any, target: any, action: any, processArgs: any, debugKey: any) { +function makeClosureAction( + context: any, + target: any, + action: any, + processArgs: any, + debugKey: any +) { let self: any; let fn: any; assert(`Action passed is null or undefined in (action) from ${target}.`, !isNone(action)); if (typeof action[INVOKE] === 'function') { self = action; - fn = action[INVOKE]; + fn = action[INVOKE]; } else { let typeofAction = typeof action; if (typeofAction === 'string') { self = target; - fn = target.actions && target.actions[action]; + fn = target.actions && target.actions[action]; assert(`An action named '${action}' was not found in ${target}`, fn); } else if (typeofAction === 'function') { self = context; - fn = action; + fn = action; } else { // tslint:disable-next-line:max-line-length - assert(`An action could not be made for \`${debugKey || action}\` in ${target}. Please confirm that you are using either a quoted action name (i.e. \`(action '${debugKey || 'myAction'}')\`) or a function available in ${target}.`, false); + assert( + `An action could not be made for \`${debugKey || + action}\` in ${target}. Please confirm that you are using either a quoted action name (i.e. \`(action '${debugKey || + 'myAction'}')\`) or a function available in ${target}.`, + false + ); } }
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/helpers/concat.ts
@@ -1,8 +1,4 @@ -import { - Arguments, - CapturedArguments, - VM -} from '@glimmer/runtime'; +import { Arguments, CapturedArguments, VM } from '@glimmer/runtime'; import { InternalHelperReference } from '../utils/references'; const isEmpty = (value: any): boolean => { @@ -37,7 +33,10 @@ const normalizeTextValue = (value: any): string => { @since 1.13.0 */ function concat({ positional }: CapturedArguments) { - return positional.value().map(normalizeTextValue).join(''); + return positional + .value() + .map(normalizeTextValue) + .join(''); } export default function(_vm: VM, args: Arguments) {
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/helpers/each-in.ts
@@ -2,10 +2,7 @@ @module ember */ import { Tag, VersionedPathReference } from '@glimmer/reference'; -import { - Arguments, - VM -} from '@glimmer/runtime'; +import { Arguments, VM } from '@glimmer/runtime'; import { Opaque } from '@glimmer/util'; import { symbol } from 'ember-utils';
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/helpers/get.ts
@@ -9,11 +9,7 @@ import { UpdatableTag, VersionedPathReference, } from '@glimmer/reference'; -import { - Arguments, - NULL_REFERENCE, - VM -} from '@glimmer/runtime'; +import { Arguments, NULL_REFERENCE, VM } from '@glimmer/runtime'; import { set } from 'ember-metal'; import { CachedReference, referenceFromParts, UPDATE } from '../utils/references'; @@ -69,7 +65,10 @@ export default function(_vm: VM, args: Arguments) { return GetHelperReference.create(args.positional.at(0), args.positional.at(1)); } -function referenceFromPath(source: VersionedPathReference<Opaque>, path: string): VersionedPathReference<Opaque> { +function referenceFromPath( + source: VersionedPathReference<Opaque>, + path: string +): VersionedPathReference<Opaque> { let innerReference; if (path === undefined || path === null || path === '') { innerReference = NULL_REFERENCE; @@ -89,7 +88,10 @@ class GetHelperReference extends CachedReference { public innerTag: TagWrapper<UpdatableTag>; public tag: Tag; - static create(sourceReference: VersionedPathReference<Opaque>, pathReference: PathReference<string>) { + static create( + sourceReference: VersionedPathReference<Opaque>, + pathReference: PathReference<string> + ) { if (isConst(pathReference)) { let path = pathReference.value(); return referenceFromPath(sourceReference, path); @@ -98,15 +100,18 @@ class GetHelperReference extends CachedReference { } } - constructor(sourceReference: VersionedPathReference<Opaque>, pathReference: PathReference<string>) { + constructor( + sourceReference: VersionedPathReference<Opaque>, + pathReference: PathReference<string> + ) { super(); this.sourceReference = sourceReference; this.pathReference = pathReference; this.lastPath = null; this.innerReference = NULL_REFERENCE; - let innerTag = this.innerTag = UpdatableTag.create(CONSTANT_TAG); + let innerTag = (this.innerTag = UpdatableTag.create(CONSTANT_TAG)); this.tag = combine([sourceReference.tag, pathReference.tag, innerTag]); }
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/helpers/hash.ts
@@ -1,7 +1,4 @@ -import { - Arguments, - VM -} from '@glimmer/runtime'; +import { Arguments, VM } from '@glimmer/runtime'; /** @module ember
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/helpers/if-unless.ts
@@ -2,23 +2,10 @@ @module ember */ -import { - combine, - CONSTANT_TAG, - isConst, - TagWrapper, - UpdatableTag, -} from '@glimmer/reference'; -import { - Arguments, - PrimitiveReference, - VM -} from '@glimmer/runtime'; +import { combine, CONSTANT_TAG, isConst, TagWrapper, UpdatableTag } from '@glimmer/reference'; +import { Arguments, PrimitiveReference, VM } from '@glimmer/runtime'; import { assert } from 'ember-debug'; -import { - CachedReference, - ConditionalReference, -} from '../utils/references'; +import { CachedReference, ConditionalReference } from '../utils/references'; class ConditionalHelperReference extends CachedReference { public branchTag: TagWrapper<UpdatableTag>; @@ -27,7 +14,11 @@ class ConditionalHelperReference extends CachedReference { public truthy: any; public falsy: any; - static create(_condRef: any, truthyRef: PrimitiveReference<boolean>, falsyRef: PrimitiveReference<boolean>) { + static create( + _condRef: any, + truthyRef: PrimitiveReference<boolean>, + falsyRef: PrimitiveReference<boolean> + ) { let condRef = ConditionalReference.create(_condRef); if (isConst(condRef)) { return condRef.value() ? truthyRef : falsyRef; @@ -141,8 +132,8 @@ class ConditionalHelperReference extends CachedReference { export function inlineIf(_vm: VM, { positional }: Arguments) { assert( 'The inline form of the `if` helper expects two or three arguments, e.g. ' + - '`{{if trialExpired "Expired" expiryDate}}`.', - positional.length === 3 || positional.length === 2, + '`{{if trialExpired "Expired" expiryDate}}`.', + positional.length === 3 || positional.length === 2 ); return ConditionalHelperReference.create(positional.at(0), positional.at(1), positional.at(2)); } @@ -170,8 +161,8 @@ export function inlineIf(_vm: VM, { positional }: Arguments) { export function inlineUnless(_vm: VM, { positional }: Arguments) { assert( 'The inline form of the `unless` helper expects two or three arguments, e.g. ' + - '`{{unless isFirstLogin "Welcome back!"}}`.', - positional.length === 3 || positional.length === 2, + '`{{unless isFirstLogin "Welcome back!"}}`.', + positional.length === 3 || positional.length === 2 ); return ConditionalHelperReference.create(positional.at(0), positional.at(2), positional.at(1)); }
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/helpers/loc.ts
@@ -1,4 +1,3 @@ - /** @module ember */ @@ -38,6 +37,6 @@ import { helper } from '../helper'; @see {String#loc} @public */ -export default helper(function (params) { +export default helper(function(params) { return StringUtils.loc.apply(null, params); });
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/helpers/log.ts
@@ -1,8 +1,4 @@ -import { - Arguments, - CapturedArguments, - VM -} from '@glimmer/runtime'; +import { Arguments, CapturedArguments, VM } from '@glimmer/runtime'; import { InternalHelperReference } from '../utils/references'; /** @module ember @@ -22,10 +18,10 @@ import { InternalHelperReference } from '../utils/references'; @public */ function log({ positional }: CapturedArguments) { - /* eslint-disable no-console */ - console.log(...positional.value()); - /* eslint-enable no-console */ - } + /* eslint-disable no-console */ + console.log(...positional.value()); + /* eslint-enable no-console */ +} export default function(_vm: VM, args: Arguments) { return new InternalHelperReference(log, args.capture());
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/helpers/mut.ts
@@ -1,10 +1,7 @@ /** @module ember */ -import { - Arguments, - VM -} from '@glimmer/runtime'; +import { Arguments, VM } from '@glimmer/runtime'; import { assert } from 'ember-debug'; import { symbol } from 'ember-utils'; import { INVOKE, UPDATE } from '../utils/references';
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/helpers/query-param.ts
@@ -1,11 +1,7 @@ /** @module ember */ -import { - Arguments, - CapturedArguments, - VM -} from '@glimmer/runtime'; +import { Arguments, CapturedArguments, VM } from '@glimmer/runtime'; import { assert } from 'ember-debug'; import { QueryParams } from 'ember-routing'; import { assign } from 'ember-utils'; @@ -29,7 +25,10 @@ import { InternalHelperReference } from '../utils/references'; */ function queryParams({ positional, named }: CapturedArguments) { // tslint:disable-next-line:max-line-length - assert('The `query-params` helper only accepts hash parameters, e.g. (query-params queryParamPropertyName=\'foo\') as opposed to just (query-params \'foo\')', positional.value().length === 0); + assert( + "The `query-params` helper only accepts hash parameters, e.g. (query-params queryParamPropertyName='foo') as opposed to just (query-params 'foo')", + positional.value().length === 0 + ); return new QueryParams(assign({}, named.value())); }
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/helpers/readonly.ts
@@ -1,11 +1,8 @@ /** @module ember */ -import { - Arguments, - VM, -} from '@glimmer/runtime'; -import { ReadonlyReference, } from '../utils/references'; +import { Arguments, VM } from '@glimmer/runtime'; +import { ReadonlyReference } from '../utils/references'; import { unMut } from './mut'; /**
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/helpers/unbound.ts
@@ -2,10 +2,7 @@ @module ember */ -import { - Arguments, - VM -} from '@glimmer/runtime'; +import { Arguments, VM } from '@glimmer/runtime'; import { assert } from 'ember-debug'; import { UnboundReference } from '../utils/references'; @@ -40,7 +37,7 @@ import { UnboundReference } from '../utils/references'; export default function(_vm: VM, args: Arguments) { assert( 'unbound helper cannot be called with multiple params or hash params', - args.positional.length === 1 && args.named.length === 0, + args.positional.length === 1 && args.named.length === 0 ); return UnboundReference.create(args.positional.at(0).value());
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/modifiers/action.ts
@@ -1,26 +1,17 @@ -import { - Simple -} from '@glimmer/interfaces'; -import { - RevisionTag, TagWrapper -} from '@glimmer/reference'; +import { Simple } from '@glimmer/interfaces'; +import { RevisionTag, TagWrapper } from '@glimmer/reference'; import { Arguments, CapturedNamedArguments, CapturedPositionalArguments, DynamicScope, ModifierManager, } from '@glimmer/runtime'; -import { - Destroyable -} from '@glimmer/util'; +import { Destroyable } from '@glimmer/util'; import { assert } from 'ember-debug'; import { flaggedInstrument, join } from 'ember-metal'; import { uuid } from 'ember-utils'; -import { - ActionManager, - isSimpleClick, -} from 'ember-views'; +import { ActionManager, isSimpleClick } from 'ember-views'; import { INVOKE } from '../utils/references'; const MODIFIERS = ['alt', 'shift', 'meta', 'ctrl']; @@ -80,7 +71,17 @@ export class ActionState { public eventName: any; public tag: TagWrapper<RevisionTag | null>; - constructor(element: Simple.Element, actionId: number, actionName: any, actionArgs: any[], namedArgs: CapturedNamedArguments, positionalArgs: CapturedPositionalArguments, implicitTarget: any, dom: any, tag: TagWrapper<RevisionTag | null>) { + constructor( + element: Simple.Element, + actionId: number, + actionName: any, + actionArgs: any[], + namedArgs: CapturedNamedArguments, + positionalArgs: CapturedPositionalArguments, + implicitTarget: any, + dom: any, + tag: TagWrapper<RevisionTag | null> + ) { this.element = element; this.actionId = actionId; this.actionName = actionName; @@ -167,7 +168,7 @@ export class ActionState { } else { assert( `The action '${actionName}' did not exist on ${target}`, - typeof target[actionName] === 'function', + typeof target[actionName] === 'function' ); flaggedInstrument('interaction.ember-action', payload, () => { target[actionName].apply(target, args); @@ -201,11 +202,15 @@ export default class ActionModifierManager implements ModifierManager<ActionStat actionName = actionNameRef.value(); assert( - 'You specified a quoteless path, `' + actionLabel + '`, to the ' + + 'You specified a quoteless path, `' + + actionLabel + + '`, to the ' + '{{action}} helper which did not resolve to an action name (a ' + 'string). Perhaps you meant to use a quoted actionName? (e.g. ' + - '{{action "' + actionLabel + '"}}).', - typeof actionName === 'string' || typeof actionName === 'function', + '{{action "' + + actionLabel + + '"}}).', + typeof actionName === 'string' || typeof actionName === 'function' ); } } @@ -227,7 +232,7 @@ export default class ActionModifierManager implements ModifierManager<ActionStat positional, implicitTarget, dom, - tag, + tag ); }
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/protocol-for-url.ts
@@ -51,5 +51,5 @@ function nodeProtocolForURL(url: string) { if (typeof url === 'string') { protocol = nodeURL.parse(url).protocol; } - return (protocol === null) ? ':' : protocol; + return protocol === null ? ':' : protocol; }
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/renderer.ts
@@ -14,18 +14,8 @@ import { } from '@glimmer/runtime'; import { Opaque } from '@glimmer/util'; import { assert } from 'ember-debug'; -import { - backburner, - getCurrentRunLoop, - runInTransaction, - setHasViews, -} from 'ember-metal'; -import { - fallbackViewRegistry, - getViewElement, - getViewId, - setViewElement, -} from 'ember-views'; +import { backburner, getCurrentRunLoop, runInTransaction, setHasViews } from 'ember-metal'; +import { fallbackViewRegistry, getViewElement, getViewId, setViewElement } from 'ember-views'; import RSVP from 'rsvp'; import { BOUNDS } from './component'; import { createRootOutlet } from './component-managers/outlet'; @@ -43,22 +33,28 @@ export class DynamicScope implements GlimmerDynamicScope { constructor( public view: Component | {} | null, public outletState: VersionedPathReference<OutletState | undefined>, - public rootOutletState?: VersionedPathReference<OutletState | undefined>) { - } + public rootOutletState?: VersionedPathReference<OutletState | undefined> + ) {} child() { return new DynamicScope(this.view, this.outletState, this.rootOutletState); } get(key: 'outletState'): VersionedPathReference<OutletState | undefined> { // tslint:disable-next-line:max-line-length - assert(`Using \`-get-dynamic-scope\` is only supported for \`outletState\` (you used \`${key}\`).`, key === 'outletState'); + assert( + `Using \`-get-dynamic-scope\` is only supported for \`outletState\` (you used \`${key}\`).`, + key === 'outletState' + ); return this.outletState; } set(key: 'outletState', value: VersionedPathReference<OutletState | undefined>) { // tslint:disable-next-line:max-line-length - assert(`Using \`-with-dynamic-scope\` is only supported for \`outletState\` (you used \`${key}\`).`, key === 'outletState'); + assert( + `Using \`-with-dynamic-scope\` is only supported for \`outletState\` (you used \`${key}\`).`, + key === 'outletState' + ); this.outletState = value; return value; } @@ -94,14 +90,15 @@ class RootState { this.shouldReflush = false; this.destroyed = false; - let options = this.options = { + let options = (this.options = { alwaysRevalidate: false, - }; + }); this.render = () => { let layout = template.asLayout(); let handle = layout.compile(); - let iterator = renderMain(layout['compiler'].program, + let iterator = renderMain( + layout['compiler'].program, env, self, dynamicScope, @@ -113,7 +110,7 @@ class RootState { iteratorResult = iterator.next(); } while (!iteratorResult.done); - let result = this.result = iteratorResult.value; + let result = (this.result = iteratorResult.value); // override .render function after initial render this.render = () => result.rerender(options); @@ -186,7 +183,9 @@ function loopBegin(): void { } } -function K() { /* noop */ } +function K() { + /* noop */ +} let renderSettledDeferred: RSVP.Deferred<void> | null = null; /* @@ -246,7 +245,7 @@ export abstract class Renderer { private _env: Environment; private _rootTemplate: any; private _viewRegistry: { - [viewId: string]: Opaque, + [viewId: string]: Opaque; }; private _destinedForDOM: boolean; private _destroyed: boolean; @@ -256,7 +255,13 @@ export abstract class Renderer { private _removedRoots: RootState[]; private _builder: IBuilder; - constructor(env: Environment, rootTemplate: OwnedTemplate, _viewRegistry = fallbackViewRegistry, destinedForDOM = false, builder = clientBuilder) { + constructor( + env: Environment, + rootTemplate: OwnedTemplate, + _viewRegistry = fallbackViewRegistry, + destinedForDOM = false, + builder = clientBuilder + ) { this._env = env; this._rootTemplate = rootTemplate; this._viewRegistry = _viewRegistry; @@ -284,10 +289,19 @@ export abstract class Renderer { _appendDefinition( root: OutletView | Component, definition: CurriedComponentDefinition, - target: Simple.Element) { + target: Simple.Element + ) { let self = new UnboundReference(definition); let dynamicScope = new DynamicScope(null, UNDEFINED_REFERENCE); - let rootState = new RootState(root, this._env, this._rootTemplate, self, target, dynamicScope, this._builder); + let rootState = new RootState( + root, + this._env, + this._rootTemplate, + self, + target, + dynamicScope, + this._builder + ); this._renderRoot(rootState); } @@ -297,7 +311,10 @@ export abstract class Renderer { register(view: any) { let id = getViewId(view); - assert('Attempted to register a view with an id already in use: ' + id, !this._viewRegistry[id]); + assert( + 'Attempted to register a view with an id already in use: ' + id, + !this._viewRegistry[id] + ); this._viewRegistry[id] = view; } @@ -323,7 +340,9 @@ export abstract class Renderer { cleanupRootFor(view: Opaque) { // no need to cleanup roots if we have already been destroyed - if (this._destroyed) { return; } + if (this._destroyed) { + return; + } let roots = this._roots; @@ -496,17 +515,39 @@ export abstract class Renderer { } export class InertRenderer extends Renderer { - static create({ env, rootTemplate, _viewRegistry, builder }: {env: Environment, rootTemplate: OwnedTemplate, _viewRegistry: any, builder: any}) { + static create({ + env, + rootTemplate, + _viewRegistry, + builder, + }: { + env: Environment; + rootTemplate: OwnedTemplate; + _viewRegistry: any; + builder: any; + }) { return new this(env, rootTemplate, _viewRegistry, false, builder); } getElement(_view: Opaque): Simple.Element | undefined { - throw new Error('Accessing `this.element` is not allowed in non-interactive environments (such as FastBoot).'); + throw new Error( + 'Accessing `this.element` is not allowed in non-interactive environments (such as FastBoot).' + ); } } export class InteractiveRenderer extends Renderer { - static create({ env, rootTemplate, _viewRegistry, builder}: {env: Environment, rootTemplate: OwnedTemplate, _viewRegistry: any, builder: any}) { + static create({ + env, + rootTemplate, + _viewRegistry, + builder, + }: { + env: Environment; + rootTemplate: OwnedTemplate; + _viewRegistry: any; + builder: any; + }) { return new this(env, rootTemplate, _viewRegistry, true, builder); }
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/resolver.ts
@@ -2,25 +2,16 @@ import { ComponentDefinition, Opaque, Option, - RuntimeResolver as IRuntimeResolver + RuntimeResolver as IRuntimeResolver, } from '@glimmer/interfaces'; import { LazyCompiler, Macros, PartialDefinition } from '@glimmer/opcode-compiler'; -import { - ComponentManager, - getDynamicVar, - Helper, - ModifierManager, -} from '@glimmer/runtime'; +import { ComponentManager, getDynamicVar, Helper, ModifierManager } from '@glimmer/runtime'; import { privatize as P } from 'container'; import { assert } from 'ember-debug'; import { ENV } from 'ember-environment'; import { _instrumentStart } from 'ember-metal'; import { LookupOptions, Owner, setOwner } from 'ember-utils'; -import { - lookupComponent, - lookupPartial, - OwnedTemplateMeta, -} from 'ember-views'; +import { lookupComponent, lookupPartial, OwnedTemplateMeta } from 'ember-views'; import { EMBER_MODULE_UNIFICATION, GLIMMER_CUSTOM_COMPONENT_MANAGER } from 'ember/features'; import CompileTimeLookup from './compile-time-lookup'; import { CurlyComponentDefinition } from './component-managers/curly'; @@ -60,12 +51,12 @@ function instrumentationPayload(name: string) { function makeOptions(moduleName: string, namespace?: string): LookupOptions { return { source: moduleName !== undefined ? `template:${moduleName}` : undefined, - namespace + namespace, }; } const BUILTINS_HELPERS = { - 'if': inlineIf, + if: inlineIf, action, concat, get, @@ -75,7 +66,7 @@ const BUILTINS_HELPERS = { 'query-params': queryParams, readonly, unbound, - 'unless': inlineUnless, + unless: inlineUnless, '-class': classHelper, '-each-in': eachIn, '-input-type': inputTypeHelper, @@ -116,11 +107,7 @@ export default class RuntimeResolver implements IRuntimeResolver<OwnedTemplateMe constructor() { let macros = new Macros(); populateMacros(macros); - this.compiler = new LazyCompiler<OwnedTemplateMeta>( - new CompileTimeLookup(this), - this, - macros - ); + this.compiler = new LazyCompiler<OwnedTemplateMeta>(new CompileTimeLookup(this), this, macros); } /*** IRuntimeResolver ***/ @@ -131,7 +118,9 @@ export default class RuntimeResolver implements IRuntimeResolver<OwnedTemplateMe lookupComponentDefinition(name: string, meta: OwnedTemplateMeta): Option<ComponentDefinition> { let handle = this.lookupComponentHandle(name, meta); if (handle === null) { - assert(`Could not find component named "${name}" (no component or template with that name was found)`); + assert( + `Could not find component named "${name}" (no component or template with that name was found)` + ); return null; } return this.resolve(handle); @@ -233,7 +222,8 @@ export default class RuntimeResolver implements IRuntimeResolver<OwnedTemplateMe const options: LookupOptions = makeOptions(moduleName, namespace); - const factory = owner.factoryFor(`helper:${name}`, options) || owner.factoryFor(`helper:${name}`); + const factory = + owner.factoryFor(`helper:${name}`, options) || owner.factoryFor(`helper:${name}`); if (!isHelperFactory(factory)) { return null; @@ -255,7 +245,7 @@ export default class RuntimeResolver implements IRuntimeResolver<OwnedTemplateMe private _lookupPartial(name: string, meta: OwnedTemplateMeta): PartialDefinition { const template = lookupPartial(name, meta.owner); - const partial = new PartialDefinition( name, lookupPartial(name, meta.owner)); + const partial = new PartialDefinition(name, lookupPartial(name, meta.owner)); if (template) { return partial; @@ -277,42 +267,54 @@ export default class RuntimeResolver implements IRuntimeResolver<OwnedTemplateMe let namespace = undefined; let namespaceDelimiterOffset = _name.indexOf('::'); if (namespaceDelimiterOffset !== -1) { - name = _name.slice(namespaceDelimiterOffset+2); + name = _name.slice(namespaceDelimiterOffset + 2); namespace = _name.slice(0, namespaceDelimiterOffset); } - return {name, namespace}; + return { name, namespace }; } - private _lookupComponentDefinition(_name: string, meta: OwnedTemplateMeta): Option<ComponentDefinition> { + private _lookupComponentDefinition( + _name: string, + meta: OwnedTemplateMeta + ): Option<ComponentDefinition> { let name = _name; let namespace = undefined; if (EMBER_MODULE_UNIFICATION) { const parsed = this._parseNameForNamespace(_name); name = parsed.name; namespace = parsed.namespace; } - let { layout, component } = lookupComponent(meta.owner, name, makeOptions(meta.moduleName, namespace)); + let { layout, component } = lookupComponent( + meta.owner, + name, + makeOptions(meta.moduleName, namespace) + ); if (layout && !component && ENV._TEMPLATE_ONLY_GLIMMER_COMPONENTS) { return new TemplateOnlyComponentDefinition(layout); } - let manager: ComponentManager<ComponentStateBucket, DefinitionState> | CustomComponentManager<CustomComponentState<any>> | undefined; + let manager: + | ComponentManager<ComponentStateBucket, DefinitionState> + | CustomComponentManager<CustomComponentState<any>> + | undefined; if (GLIMMER_CUSTOM_COMPONENT_MANAGER && component && component.class) { manager = getCustomComponentManager(meta.owner, component.class); } let finalizer = _instrumentStart('render.getComponentDefinition', instrumentationPayload, name); - let definition = (layout || component) ? - new CurlyComponentDefinition( - name, - manager, - component || meta.owner.factoryFor(P`component:-default`), - null, - layout - ) : null; + let definition = + layout || component + ? new CurlyComponentDefinition( + name, + manager, + component || meta.owner.factoryFor(P`component:-default`), + null, + layout + ) + : null; finalizer(); return definition;
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/setup-registry.ts
@@ -29,19 +29,26 @@ interface Registry { } export function setupApplicationRegistry(registry: Registry) { - registry.injection('service:-glimmer-environment', 'appendOperations', 'service:-dom-tree-construction'); + registry.injection( + 'service:-glimmer-environment', + 'appendOperations', + 'service:-dom-tree-construction' + ); registry.injection('renderer', 'env', 'service:-glimmer-environment'); registry.register('service:-dom-builder', { create({ bootOptions }: { bootOptions: { _renderMode: string } }) { let { _renderMode } = bootOptions; - switch(_renderMode) { - case 'serialize': return serializeBuilder; - case 'rehydrate': return rehydrationBuilder; - default: return clientBuilder; + switch (_renderMode) { + case 'serialize': + return serializeBuilder; + case 'rehydrate': + return rehydrationBuilder; + default: + return clientBuilder; } - } + }, }); registry.injection('service:-dom-builder', 'bootOptions', '-environment:main'); registry.injection('renderer', 'builder', 'service:-dom-builder');
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/syntax.ts
@@ -15,7 +15,12 @@ import { renderMacro } from './syntax/render'; import { hashToArgs } from './syntax/utils'; import { wrapComponentClassAttribute } from './utils/bindings'; -function refineInlineSyntax(name: string, params: Option<Core.Params>, hash: Option<Core.Hash>, builder: OpcodeBuilder<OwnedTemplateMeta>): boolean { +function refineInlineSyntax( + name: string, + params: Option<Core.Params>, + hash: Option<Core.Hash>, + builder: OpcodeBuilder<OwnedTemplateMeta> +): boolean { assert( `You attempted to overwrite the built-in helper "${name}" which is not allowed. Please rename the helper.`, !( @@ -37,7 +42,14 @@ function refineInlineSyntax(name: string, params: Option<Core.Params>, hash: Opt return false; } -function refineBlockSyntax(name: string, params: Core.Params, hash: Core.Hash, template: Option<CompilableBlock>, inverse: Option<CompilableBlock>, builder: OpcodeBuilder<OwnedTemplateMeta>) { +function refineBlockSyntax( + name: string, + params: Core.Params, + hash: Core.Hash, + template: Option<CompilableBlock>, + inverse: Option<CompilableBlock>, + builder: OpcodeBuilder<OwnedTemplateMeta> +) { if (name.indexOf('-') === -1) { return false; } @@ -50,7 +62,10 @@ function refineBlockSyntax(name: string, params: Core.Params, hash: Core.Hash, t return true; } - assert(`A component or helper named "${name}" could not be found`, builder.referrer.owner.hasRegistration(`helper:${name}`)); + assert( + `A component or helper named "${name}" could not be found`, + builder.referrer.owner.hasRegistration(`helper:${name}`) + ); assert( `Helpers may not be used in the block form, for example {{#${name}}}{{/${name}}}. Please use a component, or alternatively use the helper in combination with a built-in Ember helper, for example {{#if (${name})}}{{/if}}.`, @@ -61,7 +76,9 @@ function refineBlockSyntax(name: string, params: Core.Params, hash: Core.Hash, t return true; } let options = { source: `template:${moduleName}` }; - return owner.hasRegistration(`helper:${name}`, options) || owner.hasRegistration(`helper:${name}`); + return ( + owner.hasRegistration(`helper:${name}`, options) || owner.hasRegistration(`helper:${name}`) + ); })() );
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/syntax/-text-area.ts
@@ -5,8 +5,16 @@ import { OwnedTemplateMeta } from 'ember-views'; import { wrapComponentClassAttribute } from '../utils/bindings'; import { hashToArgs } from './utils'; -export function textAreaMacro(_name: string, params: Option<WireFormat.Core.Params>, hash: Option<WireFormat.Core.Hash>, builder: OpcodeBuilder<OwnedTemplateMeta>) { - let definition = builder.compiler['resolver'].lookupComponentDefinition('-text-area', builder.referrer); +export function textAreaMacro( + _name: string, + params: Option<WireFormat.Core.Params>, + hash: Option<WireFormat.Core.Hash>, + builder: OpcodeBuilder<OwnedTemplateMeta> +) { + let definition = builder.compiler['resolver'].lookupComponentDefinition( + '-text-area', + builder.referrer + ); wrapComponentClassAttribute(hash); builder.component.static(definition!, [params || [], hashToArgs(hash), null, null]); return true;
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/syntax/input.ts
@@ -9,7 +9,12 @@ import { OwnedTemplateMeta } from 'ember-views'; import { wrapComponentClassAttribute } from '../utils/bindings'; import { hashToArgs } from './utils'; -function buildSyntax(type: string, params: any[], hash: any, builder: OpcodeBuilder<OwnedTemplateMeta>) { +function buildSyntax( + type: string, + params: any[], + hash: any, + builder: OpcodeBuilder<OwnedTemplateMeta> +) { let definition = builder.compiler['resolver'].lookupComponentDefinition(type, builder.referrer); builder.component.static(definition!, [params, hashToArgs(hash), null, null]); return true; @@ -151,7 +156,12 @@ function buildSyntax(type: string, params: any[], hash: any, builder: OpcodeBuil @public */ -export function inputMacro(_name: string, params: Option<WireFormat.Core.Params>, hash: Option<WireFormat.Core.Hash>, builder: OpcodeBuilder<OwnedTemplateMeta>) { +export function inputMacro( + _name: string, + params: Option<WireFormat.Core.Params>, + hash: Option<WireFormat.Core.Hash>, + builder: OpcodeBuilder<OwnedTemplateMeta> +) { if (params === null) { params = []; } @@ -171,9 +181,9 @@ export function inputMacro(_name: string, params: Option<WireFormat.Core.Params> } if (typeArg === 'checkbox') { assert( - '{{input type=\'checkbox\'}} does not support setting `value=someBooleanValue`; ' + + "{{input type='checkbox'}} does not support setting `value=someBooleanValue`; " + 'you must use `checked=someBooleanValue` instead.', - keys.indexOf('value') === -1, + keys.indexOf('value') === -1 ); wrapComponentClassAttribute(hash); return buildSyntax('-checkbox', params, hash, builder);
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/syntax/let.ts
@@ -7,7 +7,7 @@ import { OwnedTemplateMeta } from 'ember-views'; @module ember */ - /** +/** The `let` helper receives one or more positional arguments and yields them out as block params. @@ -42,7 +42,13 @@ import { OwnedTemplateMeta } from 'ember-views'; @for Ember.Templates.helpers @public */ -export function blockLetMacro(params: WireFormat.Core.Params, _hash: WireFormat.Core.Hash, template: Option<CompilableBlock>, _inverse: Option<CompilableBlock>, builder: OpcodeBuilder<OwnedTemplateMeta>) { +export function blockLetMacro( + params: WireFormat.Core.Params, + _hash: WireFormat.Core.Hash, + template: Option<CompilableBlock>, + _inverse: Option<CompilableBlock>, + builder: OpcodeBuilder<OwnedTemplateMeta> +) { if (template !== null) { if (params !== null) { builder.compileParams(params);
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/syntax/mount.ts
@@ -9,7 +9,7 @@ import { CurriedComponentDefinition, curry, UNDEFINED_REFERENCE, - VM + VM, } from '@glimmer/runtime'; import * as WireFormat from '@glimmer/wire-format'; import { assert } from 'ember-debug'; @@ -18,8 +18,11 @@ import { EMBER_ENGINES_MOUNT_PARAMS } from 'ember/features'; import { MountDefinition } from '../component-managers/mount'; import Environment from '../environment'; -export function mountHelper(vm: VM, args: Arguments): VersionedPathReference<CurriedComponentDefinition | null> { - let env = vm.env as Environment; +export function mountHelper( + vm: VM, + args: Arguments +): VersionedPathReference<CurriedComponentDefinition | null> { + let env = vm.env as Environment; let nameRef = args.positional.at(0); let modelRef = args.named.has('model') ? args.named.get('model') : undefined; return new DynamicEngineReference(nameRef, env, modelRef); @@ -66,16 +69,21 @@ export function mountHelper(vm: VM, args: Arguments): VersionedPathReference<Cur @category ember-application-engines @public */ -export function mountMacro(_name: string, params: Option<WireFormat.Core.Params>, hash: Option<WireFormat.Core.Hash>, builder: OpcodeBuilder<OwnedTemplateMeta>) { +export function mountMacro( + _name: string, + params: Option<WireFormat.Core.Params>, + hash: Option<WireFormat.Core.Hash>, + builder: OpcodeBuilder<OwnedTemplateMeta> +) { if (EMBER_ENGINES_MOUNT_PARAMS) { assert( 'You can only pass a single positional argument to the {{mount}} helper, e.g. {{mount "chat-engine"}}.', - params!.length === 1, + params!.length === 1 ); } else { assert( 'You can only pass a single argument to the {{mount}} helper, e.g. {{mount "chat-engine"}}.', - params!.length === 1 && hash === null, + params!.length === 1 && hash === null ); } @@ -91,7 +99,11 @@ class DynamicEngineReference { public env: Environment; private _lastName: string | null; private _lastDef: CurriedComponentDefinition | null; - constructor(nameRef: VersionedPathReference<any | undefined | null>, env: Environment, modelRef: VersionedPathReference<Opaque> | undefined) { + constructor( + nameRef: VersionedPathReference<any | undefined | null>, + env: Environment, + modelRef: VersionedPathReference<Opaque> | undefined + ) { this.tag = nameRef.tag; this.nameRef = nameRef; this.modelRef = modelRef; @@ -111,7 +123,7 @@ class DynamicEngineReference { assert( `You used \`{{mount '${name}'}}\`, but the engine '${name}' can not be found.`, - env.owner.hasRegistration(`engine:${name}`), + env.owner.hasRegistration(`engine:${name}`) ); if (!env.owner.hasRegistration(`engine:${name}`)) { @@ -125,7 +137,7 @@ class DynamicEngineReference { } else { assert( `Invalid engine name '${name}' specified, engine name must be either a string, null or undefined.`, - name === null || name === undefined, + name === null || name === undefined ); this._lastDef = null; this._lastName = null;
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/syntax/outlet.ts
@@ -75,13 +75,19 @@ export function outletHelper(vm: VM, args: Arguments) { return new OutletComponentReference(new OutletReference(scope.outletState, nameRef)); } -export function outletMacro(_name: string, params: Option<WireFormat.Core.Params>, hash: Option<WireFormat.Core.Hash>, builder: OpcodeBuilder<OwnedTemplateMeta>) { +export function outletMacro( + _name: string, + params: Option<WireFormat.Core.Params>, + hash: Option<WireFormat.Core.Hash>, + builder: OpcodeBuilder<OwnedTemplateMeta> +) { let expr: WireFormat.Expressions.Helper = [WireFormat.Ops.Helper, '-outlet', params || [], hash]; builder.dynamicComponent(expr, [], null, false, null, null); return true; } -class OutletComponentReference implements VersionedPathReference<CurriedComponentDefinition | null> { +class OutletComponentReference + implements VersionedPathReference<CurriedComponentDefinition | null> { public tag: Tag; private definition: CurriedComponentDefinition | null; private lastState: OutletDefinitionState | null; @@ -103,15 +109,17 @@ class OutletComponentReference implements VersionedPathReference<CurriedComponen if (state !== null) { definition = curry(new OutletComponentDefinition(state)); } - return this.definition = definition; + return (this.definition = definition); } get(_key: string) { return UNDEFINED_REFERENCE; } } -function stateFor(ref: VersionedPathReference<OutletState | undefined>): OutletDefinitionState | null { +function stateFor( + ref: VersionedPathReference<OutletState | undefined> +): OutletDefinitionState | null { let outlet = ref.value(); if (outlet === undefined) return null; let render = outlet.render; @@ -134,6 +142,5 @@ function validate(state: OutletDefinitionState | null, lastState: OutletDefiniti if (lastState === null) { return false; } - return state.template === lastState.template && - state.controller === lastState.controller; + return state.template === lastState.template && state.controller === lastState.controller; }
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/syntax/render.ts
@@ -7,12 +7,7 @@ import { Option } from '@glimmer/interfaces'; import { OpcodeBuilder } from '@glimmer/opcode-compiler'; import { isConst, VersionedPathReference } from '@glimmer/reference'; -import { - Arguments, - CurriedComponentDefinition, - curry, - VM, -} from '@glimmer/runtime'; +import { Arguments, CurriedComponentDefinition, curry, VM } from '@glimmer/runtime'; import * as WireFormat from '@glimmer/wire-format'; import { assert } from 'ember-debug'; import { ENV } from 'ember-environment'; @@ -26,18 +21,30 @@ import Environment from '../environment'; import { OwnedTemplate } from '../template'; import { UnboundReference } from '../utils/references'; -export function renderHelper(vm: VM, args: Arguments): VersionedPathReference<CurriedComponentDefinition | null> { - let env = vm.env as Environment; +export function renderHelper( + vm: VM, + args: Arguments +): VersionedPathReference<CurriedComponentDefinition | null> { + let env = vm.env as Environment; let nameRef = args.positional.at(0); - assert(`The first argument of {{render}} must be quoted, e.g. {{render "sidebar"}}.`, isConst(nameRef)); + assert( + `The first argument of {{render}} must be quoted, e.g. {{render "sidebar"}}.`, + isConst(nameRef) + ); // tslint:disable-next-line:max-line-length - assert(`The second argument of {{render}} must be a path, e.g. {{render "post" post}}.`, args.positional.length === 1 || !isConst(args.positional.at(1))); + assert( + `The second argument of {{render}} must be a path, e.g. {{render "post" post}}.`, + args.positional.length === 1 || !isConst(args.positional.at(1)) + ); let templateName = nameRef.value() as string; // tslint:disable-next-line:max-line-length - assert(`You used \`{{render '${templateName}'}}\`, but '${templateName}' can not be found as a template.`, env.owner.hasRegistration(`template:${templateName}`)); + assert( + `You used \`{{render '${templateName}'}}\`, but '${templateName}' can not be found as a template.`, + env.owner.hasRegistration(`template:${templateName}`) + ); let template = env.owner.lookup<OwnedTemplate>(`template:${templateName}`); @@ -47,13 +54,19 @@ export function renderHelper(vm: VM, args: Arguments): VersionedPathReference<Cu let controllerNameRef = args.named.get('controller'); // tslint:disable-next-line:max-line-length - assert(`The controller argument for {{render}} must be quoted, e.g. {{render "sidebar" controller="foo"}}.`, isConst(controllerNameRef)); + assert( + `The controller argument for {{render}} must be quoted, e.g. {{render "sidebar" controller="foo"}}.`, + isConst(controllerNameRef) + ); // TODO should be ensuring this to string here controllerName = controllerNameRef.value() as string; // tslint:disable-next-line:max-line-length - assert(`The controller name you supplied '${controllerName}' did not resolve to a controller.`, env.owner.hasRegistration(`controller:${controllerName}`)); + assert( + `The controller name you supplied '${controllerName}' did not resolve to a controller.`, + env.owner.hasRegistration(`controller:${controllerName}`) + ); } else { controllerName = templateName; } @@ -140,12 +153,22 @@ export function renderHelper(vm: VM, args: Arguments): VersionedPathReference<Cu @public @deprecated Use a component instead */ -export function renderMacro(_name: string, params: Option<WireFormat.Core.Params>, hash: Option<WireFormat.Core.Hash>, builder: OpcodeBuilder<OwnedTemplateMeta>) { +export function renderMacro( + _name: string, + params: Option<WireFormat.Core.Params>, + hash: Option<WireFormat.Core.Hash>, + builder: OpcodeBuilder<OwnedTemplateMeta> +) { if (ENV._ENABLE_RENDER_SUPPORT === true) { // TODO needs makeComponentDefinition a helper that returns a curried definition // TODO not sure all args are for definition or component // likely the controller name should be a arg to create? - let expr: WireFormat.Expressions.Helper = [WireFormat.Ops.Helper, '-render', params || [], hash]; + let expr: WireFormat.Expressions.Helper = [ + WireFormat.Ops.Helper, + '-render', + params || [], + hash, + ]; builder.dynamicComponent(expr, null, null, false, null, null); return true; }
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/template-compiler.ts
@@ -5,5 +5,5 @@ import RuntimeResolver from './resolver'; export default { create(): Compiler { return new RuntimeResolver().compiler; - } + }, };
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/template_registry.ts
@@ -26,5 +26,5 @@ export function hasTemplate(name: string): boolean { } export function setTemplate(name: string, template: Factory): Factory { - return TEMPLATES[name] = template; + return (TEMPLATES[name] = template); }
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/utils/bindings.ts
@@ -1,19 +1,6 @@ -import { - Opaque, - Option, - Simple -} from '@glimmer/interfaces'; -import { - CachedReference, - combine, - map, - Reference, - Tag -} from '@glimmer/reference'; -import { - ElementOperations, - PrimitiveReference -} from '@glimmer/runtime'; +import { Opaque, Option, Simple } from '@glimmer/interfaces'; +import { CachedReference, combine, map, Reference, Tag } from '@glimmer/reference'; +import { ElementOperations, PrimitiveReference } from '@glimmer/runtime'; import { Core, Ops } from '@glimmer/wire-format'; import { assert } from 'ember-debug'; import { get } from 'ember-metal'; @@ -48,7 +35,7 @@ export function wrapComponentClassAttribute(hash: Core.Hash) { return; } - let [ keys, values ] = hash; + let [keys, values] = hash; let index = keys === null ? -1 : keys.indexOf('class'); if (index !== -1) { @@ -57,7 +44,7 @@ export function wrapComponentClassAttribute(hash: Core.Hash) { return; } - let [ type ] = value; + let [type] = value; if (type === Ops.Get || type === Ops.MaybeLocal) { let path = value[value.length - 1]; @@ -72,19 +59,30 @@ export const AttributeBinding = { let colonIndex = microsyntax.indexOf(':'); if (colonIndex === -1) { - assert('You cannot use class as an attributeBinding, use classNameBindings instead.', microsyntax !== 'class'); + assert( + 'You cannot use class as an attributeBinding, use classNameBindings instead.', + microsyntax !== 'class' + ); return [microsyntax, microsyntax.toLowerCase(), true]; } else { let prop = microsyntax.substring(0, colonIndex); let attribute = microsyntax.substring(colonIndex + 1); - assert('You cannot use class as an attributeBinding, use classNameBindings instead.', attribute !== 'class'); + assert( + 'You cannot use class as an attributeBinding, use classNameBindings instead.', + attribute !== 'class' + ); return [prop, attribute, false]; } }, - install(_element: Simple.Element, component: Component, parsed: [string, string, boolean], operations: ElementOperations) { + install( + _element: Simple.Element, + component: Component, + parsed: [string, string, boolean], + operations: ElementOperations + ) { let [prop, attribute, isSimple] = parsed; if (attribute === 'id') { @@ -99,9 +97,14 @@ export const AttributeBinding = { } let isPath = prop.indexOf('.') > -1; - let reference = isPath ? referenceForParts(component, prop.split('.')) : referenceForKey(component, prop); + let reference = isPath + ? referenceForParts(component, prop.split('.')) + : referenceForKey(component, prop); - assert(`Illegal attributeBinding: '${prop}' is not a valid attribute name.`, !(isSimple && isPath)); + assert( + `Illegal attributeBinding: '${prop}' is not a valid attribute name.`, + !(isSimple && isPath) + ); if (attribute === 'style') { reference = new StyleBindingReference(reference, referenceForKey(component, 'isVisible')); @@ -158,8 +161,13 @@ export const IsVisibleBinding = { }; export const ClassNameBinding = { - install(_element: Simple.Element, component: Component, microsyntax: string, operations: ElementOperations) { - let [ prop, truthy, falsy ] = microsyntax.split(':'); + install( + _element: Simple.Element, + component: Component, + microsyntax: string, + operations: ElementOperations + ) { + let [prop, truthy, falsy] = microsyntax.split(':'); let isStatic = prop === ''; if (isStatic) { @@ -215,9 +223,11 @@ class SimpleClassNameBindingReference extends CachedReference<Option<string>> { export class ColonClassNameBindingReference extends CachedReference<Option<string>> { public tag: Tag; - constructor(private inner: Reference<Opaque>, - private truthy: Option<string> = null, - private falsy: Option<string> = null) { + constructor( + private inner: Reference<Opaque>, + private truthy: Option<string> = null, + private falsy: Option<string> = null + ) { super(); this.tag = inner.tag;
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/utils/curly-component-state-bucket.ts
@@ -16,9 +16,7 @@ export interface Component { appendChild(view: {}): void; trigger(event: string): void; destroy(): void; - setProperties(props: { - [key: string]: any; - }): void; + setProperties(props: { [key: string]: any }): void; } type Finalizer = () => void; @@ -39,7 +37,12 @@ export default class ComponentStateBucket { public classRef: VersionedReference<Opaque> | null = null; public argsRevision: Revision; - constructor(public environment: Environment, public component: Component, public args: CapturedNamedArguments | null, public finalizer: Finalizer) { + constructor( + public environment: Environment, + public component: Component, + public args: CapturedNamedArguments | null, + public finalizer: Finalizer + ) { this.classRef = null; this.argsRevision = args === null ? 0 : args.tag.value(); }
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/utils/custom-component-manager.ts
@@ -10,24 +10,35 @@ export const COMPONENT_MANAGER = symbol('COMPONENT_MANAGER'); export function componentManager(obj: any, managerId: String) { if ('reopenClass' in obj) { return obj.reopenClass({ - [COMPONENT_MANAGER]: managerId + [COMPONENT_MANAGER]: managerId, }); } obj[COMPONENT_MANAGER] = managerId; return obj; } -export default function getCustomComponentManager(owner: Owner, obj: {}): CustomComponentManager<CustomComponentState<any>> | undefined { - if (!GLIMMER_CUSTOM_COMPONENT_MANAGER) { return; } +export default function getCustomComponentManager( + owner: Owner, + obj: {} +): CustomComponentManager<CustomComponentState<any>> | undefined { + if (!GLIMMER_CUSTOM_COMPONENT_MANAGER) { + return; + } - if (!obj) { return; } + if (!obj) { + return; + } let managerId = obj[COMPONENT_MANAGER]; - if (!managerId) { return; } + if (!managerId) { + return; + } - let manager = new CustomComponentManager(owner.lookup(`component-manager:${managerId}`)) as CustomComponentManager<CustomComponentState<any>>; + let manager = new CustomComponentManager( + owner.lookup(`component-manager:${managerId}`) + ) as CustomComponentManager<CustomComponentState<any>>; assert(`Could not find custom component manager '${managerId}' for ${obj}`, !!manager); return manager; -} \ No newline at end of file +}
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/utils/debug-stack.ts
@@ -6,12 +6,11 @@ let DebugStack: any; if (DEBUG) { class Element { - constructor(public name: string) { - } + constructor(public name: string) {} } - class TemplateElement extends Element { } - class EngineElement extends Element { } + class TemplateElement extends Element {} + class EngineElement extends Element {} // tslint:disable-next-line:no-shadowed-variable DebugStack = class DebugStack {
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/utils/iterable.ts
@@ -6,7 +6,7 @@ import { OpaqueIterator, Tag, UpdatableTag, - VersionedReference + VersionedReference, } from '@glimmer/reference'; import { Opaque, Option } from '@glimmer/util'; import { assert } from 'ember-debug'; @@ -20,9 +20,18 @@ const ITERATOR_KEY_GUID = 'be277757-bbbe-4620-9fcb-213ef433cca2'; // FIXME: export this from Glimmer type OpaqueIterationItem = IterationItem<Opaque, Opaque>; -type EmberIterable = AbstractIterable<Opaque, Opaque, OpaqueIterationItem, UpdatableReference, UpdatableReference>; - -export default function iterableFor(ref: VersionedReference, keyPath: string | null | undefined): EmberIterable { +type EmberIterable = AbstractIterable< + Opaque, + Opaque, + OpaqueIterationItem, + UpdatableReference, + UpdatableReference +>; + +export default function iterableFor( + ref: VersionedReference, + keyPath: string | null | undefined +): EmberIterable { if (isEachIn(ref)) { return new EachInIterable(ref, keyPath || '@key'); } else { @@ -48,7 +57,9 @@ abstract class BoundedIterator implements OpaqueIterator { next(): Option<OpaqueIterationItem> { let { length, keyFor, position } = this; - if (position >= length) { return null; } + if (position >= length) { + return null; + } let value = this.valueFor(position); let memo = this.memoFor(position); @@ -113,13 +124,13 @@ class ObjectIterator extends BoundedIterator { let { length } = keys; - for (let i=0; i<length; i++) { + for (let i = 0; i < length; i++) { values.push(get(obj, keys[i])); } if (length === 0) { return EMPTY_ITERATOR; - } else{ + } else { return new this(keys, values, length, keyFor); } } @@ -167,11 +178,15 @@ class ObjectIterator extends BoundedIterator { } interface NativeIteratorConstructor<T = Opaque> { - new(iterable: Iterator<T>, result: IteratorResult<T>, keyFor: KeyFor): NativeIterator<T>; + new (iterable: Iterator<T>, result: IteratorResult<T>, keyFor: KeyFor): NativeIterator<T>; } abstract class NativeIterator<T = Opaque> implements OpaqueIterator { - static from<T>(this: NativeIteratorConstructor<T>, iterable: Iterable<T>, keyFor: KeyFor): OpaqueIterator { + static from<T>( + this: NativeIteratorConstructor<T>, + iterable: Iterable<T>, + keyFor: KeyFor + ): OpaqueIterator { let iterator = iterable[Symbol.iterator](); let result = iterator.next(); let { value, done } = result; @@ -187,7 +202,11 @@ abstract class NativeIterator<T = Opaque> implements OpaqueIterator { private position = 0; - constructor(private iterable: Iterator<T>, private result: IteratorResult<T>, private keyFor: KeyFor) {} + constructor( + private iterable: Iterator<T>, + private result: IteratorResult<T>, + private keyFor: KeyFor + ) {} isEmpty(): false { return false; @@ -199,7 +218,9 @@ abstract class NativeIterator<T = Opaque> implements OpaqueIterator { next(): Option<OpaqueIterationItem> { let { iterable, result, position, keyFor } = this; - if (result.done) { return null; } + if (result.done) { + return null; + } let value = this.valueFor(result, position); let memo = this.memoFor(result, position); @@ -240,7 +261,7 @@ const EMPTY_ITERATOR: OpaqueIterator = { next(): null { assert('Cannot call next() on an empty iterator'); return null; - } + }, }; class EachInIterable implements EmberIterable {
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/utils/outlet.ts
@@ -65,8 +65,7 @@ export interface OutletState { export class RootOutletReference implements VersionedPathReference<OutletState> { tag = DirtyableTag.create(); - constructor(public outletState: OutletState) { - } + constructor(public outletState: OutletState) {} get(key: string): VersionedPathReference<Opaque> { return new PathReference(this, key); @@ -88,8 +87,10 @@ export class RootOutletReference implements VersionedPathReference<OutletState> export class OutletReference implements VersionedPathReference<OutletState | undefined> { tag: Tag; - constructor(public parentStateRef: VersionedPathReference<OutletState | undefined>, - public outletNameRef: Reference<string>) { + constructor( + public parentStateRef: VersionedPathReference<OutletState | undefined>, + public outletNameRef: Reference<string> + ) { this.tag = combine([parentStateRef.tag, outletNameRef.tag]); }
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/utils/references.ts
@@ -20,27 +20,10 @@ import { } from '@glimmer/runtime'; import { Option } from '@glimmer/util'; import { DEBUG } from 'ember-env-flags'; -import { - didRender, - get, - set, - tagFor, - tagForProperty, - watchKey, -} from 'ember-metal'; -import { - isProxy, - symbol, -} from 'ember-utils'; -import { - EMBER_GLIMMER_DETECT_BACKTRACKING_RERENDER, - MANDATORY_SETTER, -} from 'ember/features'; -import { - HelperFunction, - HelperInstance, - RECOMPUTE_TAG, -} from '../helper'; +import { didRender, get, set, tagFor, tagForProperty, watchKey } from 'ember-metal'; +import { isProxy, symbol } from 'ember-utils'; +import { EMBER_GLIMMER_DETECT_BACKTRACKING_RERENDER, MANDATORY_SETTER } from 'ember/features'; +import { HelperFunction, HelperInstance, RECOMPUTE_TAG } from '../helper'; import emberToBool from './to-bool'; export const UPDATE = symbol('UPDATE'); @@ -123,7 +106,11 @@ interface TwoWayFlushDetectionTag extends RevisionTag { let TwoWayFlushDetectionTag: { new (tag: Tag, key: string, ref: VersionedPathReference<Opaque>): TwoWayFlushDetectionTag; - create(tag: Tag, key: string, ref: VersionedPathReference<Opaque>): TagWrapper<TwoWayFlushDetectionTag>; + create( + tag: Tag, + key: string, + ref: VersionedPathReference<Opaque> + ): TagWrapper<TwoWayFlushDetectionTag>; }; if (EMBER_GLIMMER_DETECT_BACKTRACKING_RERENDER) { @@ -133,7 +120,11 @@ if (EMBER_GLIMMER_DETECT_BACKTRACKING_RERENDER) { public key: string; public ref: any; - static create(tag: Tag, key: string, ref: VersionedPathReference<Opaque>): TagWrapper<TwoWayFlushDetectionTag> { + static create( + tag: Tag, + key: string, + ref: VersionedPathReference<Opaque> + ): TagWrapper<TwoWayFlushDetectionTag> { return new TagWrapper((tag as any).type, new TwoWayFlushDetectionTag(tag, key, ref)); } @@ -183,7 +174,8 @@ export abstract class PropertyReference extends CachedReference { } } -export class RootPropertyReference extends PropertyReference implements VersionedPathReference<Opaque> { +export class RootPropertyReference extends PropertyReference + implements VersionedPathReference<Opaque> { public tag: Tag; private _parentValue: any; private _propertyKey: string; @@ -195,7 +187,11 @@ export class RootPropertyReference extends PropertyReference implements Versione this._propertyKey = propertyKey; if (EMBER_GLIMMER_DETECT_BACKTRACKING_RERENDER) { - this.tag = TwoWayFlushDetectionTag.create(tagForProperty(parentValue, propertyKey), propertyKey, this); + this.tag = TwoWayFlushDetectionTag.create( + tagForProperty(parentValue, propertyKey), + propertyKey, + this + ); } else { this.tag = tagForProperty(parentValue, propertyKey); } @@ -257,7 +253,7 @@ export class NestedPropertyReference extends PropertyReference { return parentValue.length; } - if (parentValueType === 'object' && parentValue !== null || parentValueType === 'function') { + if ((parentValueType === 'object' && parentValue !== null) || parentValueType === 'function') { if (MANDATORY_SETTER) { watchKey(parentValue, _propertyKey); } @@ -303,7 +299,8 @@ export class UpdatableReference extends EmberPathReference { } } -export class ConditionalReference extends GlimmerConditionalReference implements VersionedReference<boolean> { +export class ConditionalReference extends GlimmerConditionalReference + implements VersionedReference<boolean> { public objectTag: TagWrapper<UpdatableTag>; static create(reference: VersionedReference<Opaque>): VersionedReference<boolean> { if (isConst(reference)) { @@ -447,7 +444,7 @@ export class UnboundReference<T> extends ConstReference<T> { export class ReadonlyReference extends CachedReference { constructor(private inner: VersionedPathReference<Opaque>) { super(); -} + } get tag() { return this.inner.tag; @@ -466,10 +463,13 @@ export class ReadonlyReference extends CachedReference { } } -export function referenceFromParts(root: VersionedPathReference<Opaque>, parts: string[]): VersionedPathReference<Opaque> { +export function referenceFromParts( + root: VersionedPathReference<Opaque>, + parts: string[] +): VersionedPathReference<Opaque> { let reference = root; - for (let i = 0; i< parts.length; i++) { + for (let i = 0; i < parts.length; i++) { reference = reference.get(parts[i]); }
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/utils/string.ts
@@ -52,7 +52,9 @@ export function escapeExpression(string: any): string { string = '' + string; } - if (!possible.test(string)) { return string; } + if (!possible.test(string)) { + return string; + } return string.replace(badChars, escapeChar); }
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-glimmer/lib/views/outlet.ts
@@ -42,8 +42,13 @@ export default class OutletView { public ref: RootOutletReference; public state: OutletDefinitionState; - constructor(private _environment: BootEnvironment, public renderer: Renderer, public owner: Owner, public template: OwnedTemplate) { - let ref = this.ref = new RootOutletReference({ + constructor( + private _environment: BootEnvironment, + public renderer: Renderer, + public owner: Owner, + public template: OwnedTemplate + ) { + let ref = (this.ref = new RootOutletReference({ outlets: { main: undefined }, render: { owner: owner, @@ -53,13 +58,13 @@ export default class OutletView { controller: undefined, template, }, - }); + })); this.state = { ref, name: TOP_LEVEL_NAME, outlet: TOP_LEVEL_OUTLET, template, - controller: undefined + controller: undefined, }; } @@ -76,11 +81,15 @@ export default class OutletView { schedule('render', this.renderer, 'appendOutletView', this, target); } - rerender() { /**/ } + rerender() { + /**/ + } setOutletState(state: OutletState) { this.ref.update(state); } - destroy() { /**/ } + destroy() { + /**/ + } }
true
Other
emberjs
ember.js
27e61169b35fc8481de971290a630476f6c2c9b4.json
Apply prettier configuration changes to *.ts files.
packages/ember-metal/lib/tracked.ts
@@ -1,5 +1,5 @@ import { combine, CONSTANT_TAG, Tag } from '@glimmer/reference'; -import { dirty, tagFor, tagForProperty, update } from './tags'; +import { dirty, tagFor, tagForProperty, update } from './tags'; type Option<T> = T | null; type unknown = null | undefined | void | {}; @@ -96,7 +96,11 @@ class Tracker { @param dependencies Optional dependents to be tracked. */ -export function tracked(_target: object, key: string, descriptor: PropertyDescriptor): PropertyDescriptor { +export function tracked( + _target: object, + key: string, + descriptor: PropertyDescriptor +): PropertyDescriptor { if ('value' in descriptor) { return descriptorForDataProperty(key, descriptor); } else { @@ -126,17 +130,20 @@ export function getCurrentTracker(): Option<Tracker> { } export function setCurrentTracker(tracker: Tracker = new Tracker()): Tracker { - return CURRENT_TRACKER = tracker; + return (CURRENT_TRACKER = tracker); } -function descriptorForAccessor(key: string | symbol, descriptor: PropertyDescriptor): PropertyDescriptor { +function descriptorForAccessor( + key: string | symbol, + descriptor: PropertyDescriptor +): PropertyDescriptor { let get = descriptor.get as Function; let set = descriptor.set as Function; function getter(this: any) { // Swap the parent tracker for a new tracker let old = CURRENT_TRACKER; - let tracker = CURRENT_TRACKER = new Tracker(); + let tracker = (CURRENT_TRACKER = new Tracker()); // Call the getter let ret = get.call(this); @@ -164,7 +171,7 @@ function descriptorForAccessor(key: string | symbol, descriptor: PropertyDescrip enumerable: true, configurable: false, get: get && getter, - set: set && setter + set: set && setter, }; } @@ -204,7 +211,7 @@ function descriptorForDataProperty(key: string, descriptor: PropertyDescriptor) dirty(tagForProperty(this, key)); this[shadowKey] = newValue; propertyDidChange(); - } + }, }; } @@ -220,7 +227,11 @@ export function setPropertyDidChange(cb: () => void) { export class UntrackedPropertyError extends Error { static for(obj: any, key: string): UntrackedPropertyError { - return new UntrackedPropertyError(obj, key, `The property '${key}' on ${obj} was changed after being rendered. If you want to change a property used in a template after the component has rendered, mark the property as a tracked property with the @tracked decorator.`); + return new UntrackedPropertyError( + obj, + key, + `The property '${key}' on ${obj} was changed after being rendered. If you want to change a property used in a template after the component has rendered, mark the property as a tracked property with the @tracked decorator.` + ); } constructor(public target: any, public key: string, message: string) {
true
Other
emberjs
ember.js
33e89cf6bbf1dba17e03effd6097745f27411aa8.json
Add prettier configuration to tslint.
.prettierrc
@@ -1,3 +0,0 @@ -{ - "singleQuote": true -}
true
Other
emberjs
ember.js
33e89cf6bbf1dba17e03effd6097745f27411aa8.json
Add prettier configuration to tslint.
package.json
@@ -138,7 +138,9 @@ "serve-static": "^1.12.2", "simple-dom": "^0.3.0", "testem": "^1.18.4", - "tslint": "^5.9.1" + "tslint": "^5.9.1", + "tslint-config-prettier": "^1.10.0", + "tslint-plugin-prettier": "^1.3.0" }, "engines": { "node": "^4.5 || 6.* || >= 8.*"
true
Other
emberjs
ember.js
33e89cf6bbf1dba17e03effd6097745f27411aa8.json
Add prettier configuration to tslint.
tslint.json
@@ -1,5 +1,14 @@ { + "extends": [ + "tslint-config-prettier", + "tslint-plugin-prettier" + ], "rules": { + "prettier": [true, { + "singleQuote": true, + "trailingComma": "es5", + "printWidth": 100 + }], "curly": false, "no-var-keyword": true, "indent": [true, "spaces"], @@ -13,7 +22,6 @@ "no-inferrable-types": [true], "no-trailing-whitespace": true, "no-unused-expression": true, - "semicolon": [true, "always"], "triple-equals": true, "class-name": true, "no-require-imports": true,
true
Other
emberjs
ember.js
33e89cf6bbf1dba17e03effd6097745f27411aa8.json
Add prettier configuration to tslint.
yarn.lock
@@ -2799,7 +2799,7 @@ eslint-plugin-node@^6.0.1: resolve "^1.3.3" semver "^5.4.1" -eslint-plugin-prettier@^2.6.0: +eslint-plugin-prettier@^2.2.0, eslint-plugin-prettier@^2.6.0: version "2.6.0" resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.0.tgz#33e4e228bdb06142d03c560ce04ec23f6c767dd7" dependencies: @@ -6951,14 +6951,25 @@ trim-right@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" -tslib@^1.8.0: +tslib@^1.7.1, tslib@^1.8.0: version "1.9.0" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.0.tgz#e37a86fda8cbbaf23a057f473c9f4dc64e5fc2e8" tslib@^1.8.1: version "1.8.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.8.1.tgz#6946af2d1d651a7b1863b531d6e5afa41aa44eac" +tslint-config-prettier@^1.10.0: + version "1.10.0" + resolved "https://registry.yarnpkg.com/tslint-config-prettier/-/tslint-config-prettier-1.10.0.tgz#5063c413d43de4f6988c73727f65ecfc239054ec" + +tslint-plugin-prettier@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/tslint-plugin-prettier/-/tslint-plugin-prettier-1.3.0.tgz#7eb65d19ea786a859501a42491b78c5de2031a3f" + dependencies: + eslint-plugin-prettier "^2.2.0" + tslib "^1.7.1" + tslint@^5.9.1: version "5.9.1" resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.9.1.tgz#1255f87a3ff57eb0b0e1f0e610a8b4748046c9ae"
true
Other
emberjs
ember.js
dc1bb609e5fb2329ab9a171bfc021e278ab41033.json
Fix remaining linting failures. After running prettier across the codebase a few additional linting errors cropped up.
packages/ember-glimmer/tests/integration/helpers/closure-action-test.js
@@ -390,7 +390,7 @@ moduleFor( let OuterComponent = Component.extend({ third, - outerSubmit(actualFirst, actualSecond, actualThird, actualFourth) { + outerSubmit() { // eslint-disable-line no-unused-vars actualArgs = [...arguments]; }
true
Other
emberjs
ember.js
dc1bb609e5fb2329ab9a171bfc021e278ab41033.json
Fix remaining linting failures. After running prettier across the codebase a few additional linting errors cropped up.
packages/ember-metal/lib/alias.js
@@ -68,7 +68,7 @@ export class AliasedProperty extends Descriptor { } } -function AliasedProperty_readOnlySet(obj, keyName, value) { +function AliasedProperty_readOnlySet(obj, keyName) { // eslint-disable-line no-unused-vars throw new EmberError( `Cannot set read-only property '${keyName}' on object: ${inspect(obj)}`
true
Other
emberjs
ember.js
dc1bb609e5fb2329ab9a171bfc021e278ab41033.json
Fix remaining linting failures. After running prettier across the codebase a few additional linting errors cropped up.
packages/ember-metal/lib/each_proxy.js
@@ -41,7 +41,7 @@ class EachProxy { // ARRAY CHANGES // Invokes whenever the content array itself changes. - arrayWillChange(content, idx, removedCnt, addedCnt) { + arrayWillChange(content, idx, removedCnt /*, addedCnt */) { // eslint-disable-line no-unused-vars let keys = this._keys; let lim = removedCnt > 0 ? idx + removedCnt : -1;
true
Other
emberjs
ember.js
dc1bb609e5fb2329ab9a171bfc021e278ab41033.json
Fix remaining linting failures. After running prettier across the codebase a few additional linting errors cropped up.
packages/ember-routing/lib/system/route.js
@@ -1171,7 +1171,7 @@ let Route = EmberObject.extend(ActionHandler, Evented, { @since 1.0.0 @public */ - transitionTo(name, context) { + transitionTo(/* name, context */) { // eslint-disable-line no-unused-vars return this._router.transitionTo(...prefixRouteNameArg(this, arguments)); }, @@ -1829,7 +1829,7 @@ let Route = EmberObject.extend(ActionHandler, Evented, { @since 1.0.0 @public */ - setupController(controller, context, transition) { + setupController(controller, context /*, transition */) { // eslint-disable-line no-unused-vars if (controller && context !== undefined) { set(controller, 'model', context); @@ -2011,7 +2011,7 @@ let Route = EmberObject.extend(ActionHandler, Evented, { @since 1.0.0 @public */ - renderTemplate(controller, model) { + renderTemplate(/* controller, model */) { // eslint-disable-line no-unused-vars this.render(); },
true
Other
emberjs
ember.js
dc1bb609e5fb2329ab9a171bfc021e278ab41033.json
Fix remaining linting failures. After running prettier across the codebase a few additional linting errors cropped up.
packages/ember-runtime/lib/mixins/array.js
@@ -157,7 +157,7 @@ const ArrayMixin = Mixin.create(Enumerable, { @public */ '[]': computed({ - get(key) { + get() { // eslint-disable-line no-unused-vars return this; }, @@ -635,7 +635,7 @@ const ArrayMixin = Mixin.create(Enumerable, { @return {Array} filtered array @public */ - filterBy(key, value) { + filterBy() { // eslint-disable-line no-unused-vars return this.filter(iter.apply(this, arguments)); }, @@ -717,7 +717,7 @@ const ArrayMixin = Mixin.create(Enumerable, { @return {Object} found item or `undefined` @public */ - findBy(key, value) { + findBy() { // eslint-disable-line no-unused-vars return this.find(iter.apply(this, arguments)); }, @@ -781,7 +781,7 @@ const ArrayMixin = Mixin.create(Enumerable, { @since 1.3.0 @public */ - isEvery(key, value) { + isEvery() { // eslint-disable-line no-unused-vars return this.every(iter.apply(this, arguments)); }, @@ -854,7 +854,7 @@ const ArrayMixin = Mixin.create(Enumerable, { @since 1.3.0 @public */ - isAny(key, value) { + isAny() { // eslint-disable-line no-unused-vars return this.any(iter.apply(this, arguments)); },
true
Other
emberjs
ember.js
a49b00743519603c03843137a2522473a6969281.json
Add prettier configuration to eslint. This ensures that prettier usage is "enforced", but also allows nice things like `eslint --fix .` (or related in-editor fixers).
.eslintrc.js
@@ -2,15 +2,18 @@ module.exports = { root: true, extends: [ 'eslint:recommended', + 'prettier', ], plugins: [ - "ember-internal" + 'ember-internal', + 'prettier', ], rules: { 'semi': 'error', 'no-unused-vars': 'error', 'no-useless-escape': 'off', // TODO: bring this back + 'prettier/prettier': 'error', }, overrides: [ @@ -23,7 +26,7 @@ module.exports = { }, globals: { - // A safe subset of "browser:true": + // A safe subset of 'browser:true': 'window': true, 'document': true, 'setTimeout': true,
true
Other
emberjs
ember.js
a49b00743519603c03843137a2522473a6969281.json
Add prettier configuration to eslint. This ensures that prettier usage is "enforced", but also allows nice things like `eslint --fix .` (or related in-editor fixers).
.prettierrc.js
@@ -0,0 +1,7 @@ +'use strict'; + +module.exports = { + singleQuote: true, + trailingComma: 'es5', + printWidth: 100, +};
true
Other
emberjs
ember.js
a49b00743519603c03843137a2522473a6969281.json
Add prettier configuration to eslint. This ensures that prettier usage is "enforced", but also allows nice things like `eslint --fix .` (or related in-editor fixers).
package.json
@@ -113,8 +113,10 @@ "ember-cli-yuidoc": "^0.8.8", "ember-publisher": "0.0.7", "eslint": "^4.9.1", + "eslint-config-prettier": "^2.9.0", "eslint-plugin-ember-internal": "^1.1.1", "eslint-plugin-node": "^6.0.1", + "eslint-plugin-prettier": "^2.6.0", "execa": "^0.10.0", "express": "^4.16.2", "finalhandler": "^1.0.2", @@ -125,6 +127,7 @@ "html-differ": "^1.3.4", "lodash.uniq": "^4.5.0", "mocha": "^5.0.0", + "prettier": "1.11.1", "puppeteer": "^0.13.0", "qunit": "^2.5.0", "route-recognizer": "^0.3.3",
true
Other
emberjs
ember.js
a49b00743519603c03843137a2522473a6969281.json
Add prettier configuration to eslint. This ensures that prettier usage is "enforced", but also allows nice things like `eslint --fix .` (or related in-editor fixers).
yarn.lock
@@ -2777,6 +2777,12 @@ [email protected], escape-string-regexp@^1.0.0, escape-string-regexp@^1 version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" +eslint-config-prettier@^2.9.0: + version "2.9.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-2.9.0.tgz#5ecd65174d486c22dff389fe036febf502d468a3" + dependencies: + get-stdin "^5.0.1" + eslint-plugin-ember-internal@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/eslint-plugin-ember-internal/-/eslint-plugin-ember-internal-1.1.1.tgz#5327f709799eac010bfcf0dd1be8d0acbc917d34" @@ -2793,6 +2799,13 @@ eslint-plugin-node@^6.0.1: resolve "^1.3.3" semver "^5.4.1" +eslint-plugin-prettier@^2.6.0: + version "2.6.0" + resolved "https://registry.yarnpkg.com/eslint-plugin-prettier/-/eslint-plugin-prettier-2.6.0.tgz#33e4e228bdb06142d03c560ce04ec23f6c767dd7" + dependencies: + fast-diff "^1.1.1" + jest-docblock "^21.0.0" + eslint-scope@^3.7.1: version "3.7.1" resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-3.7.1.tgz#3d63c3edfda02e06e01a452ad88caacc7cdcb6e8" @@ -3128,6 +3141,10 @@ fast-deep-equal@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz#c053477817c86b51daa853c81e059b733d023614" +fast-diff@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/fast-diff/-/fast-diff-1.1.2.tgz#4b62c42b8e03de3f848460b639079920695d0154" + fast-json-stable-stringify@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz#d5142c0caee6b1189f87d3a76111064f86c8bbf2" @@ -3474,6 +3491,10 @@ get-stdin@^4.0.1: version "4.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe" +get-stdin@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" + get-stream@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14" @@ -4272,6 +4293,10 @@ [email protected]: editions "^1.1.1" textextensions "1 || 2" +jest-docblock@^21.0.0: + version "21.2.0" + resolved "https://registry.yarnpkg.com/jest-docblock/-/jest-docblock-21.2.0.tgz#51529c3b30d5fd159da60c27ceedc195faf8d414" + [email protected]: version "0.15.0" resolved "https://registry.yarnpkg.com/jmespath/-/jmespath-0.15.0.tgz#a3f222a9aae9f966f5d27c796510e28091764217" @@ -5635,6 +5660,10 @@ preserve@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" [email protected]: + version "1.11.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.11.1.tgz#61e43fc4cd44e68f2b0dfc2c38cd4bb0fccdcc75" + pretty-ms@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/pretty-ms/-/pretty-ms-3.1.0.tgz#e9cac9c76bf6ee52fe942dd9c6c4213153b12881"
true
Other
emberjs
ember.js
87b61d4a118a613576f8ac6a6b026d2f07d85081.json
Remove usage of exists-sync package. `fs.existsSync` was "un deprecated" we should use it instead...
blueprints/acceptance-test/index.js
@@ -1,9 +1,9 @@ 'use strict'; +const fs = require('fs'); const path = require('path'); const pathUtil = require('ember-cli-path-utils'); const stringUtils = require('ember-cli-string-utils'); -const existsSync = require('exists-sync'); const useTestFrameworkDetector = require('../test-framework-detector'); @@ -18,7 +18,7 @@ module.exports = useTestFrameworkDetector({ } let destroyAppExists = - existsSync(path.join(this.project.root, '/tests/helpers/destroy-app.js')); + fs.existsSync(path.join(this.project.root, '/tests/helpers/destroy-app.js')); let friendlyTestName = ['Acceptance', stringUtils.dasherize(options.entity.name).replace(/[-]/g,' ')].join(' | ');
true
Other
emberjs
ember.js
87b61d4a118a613576f8ac6a6b026d2f07d85081.json
Remove usage of exists-sync package. `fs.existsSync` was "un deprecated" we should use it instead...
blueprints/initializer-test/index.js
@@ -1,8 +1,8 @@ 'use strict'; +const fs = require('fs'); const path = require('path'); const stringUtils = require('ember-cli-string-utils'); -const existsSync = require('exists-sync'); const useTestFrameworkDetector = require('../test-framework-detector'); @@ -12,7 +12,7 @@ module.exports = useTestFrameworkDetector({ return { friendlyTestName: ['Unit', 'Initializer', options.entity.name].join(' | '), dasherizedModulePrefix: stringUtils.dasherize(options.project.config().modulePrefix), - destroyAppExists: existsSync(path.join(this.project.root, '/tests/helpers/destroy-app.js')) + destroyAppExists: fs.existsSync(path.join(this.project.root, '/tests/helpers/destroy-app.js')) }; } });
true
Other
emberjs
ember.js
87b61d4a118a613576f8ac6a6b026d2f07d85081.json
Remove usage of exists-sync package. `fs.existsSync` was "un deprecated" we should use it instead...
blueprints/instance-initializer-test/index.js
@@ -1,7 +1,7 @@ 'use strict'; +const fs = require('fs'); const path = require('path'); -const existsSync = require('exists-sync'); const stringUtils = require('ember-cli-string-utils'); const useTestFrameworkDetector = require('../test-framework-detector'); @@ -12,7 +12,7 @@ module.exports = useTestFrameworkDetector({ return { friendlyTestName: ['Unit', 'Instance Initializer', options.entity.name].join(' | '), dasherizedModulePrefix: stringUtils.dasherize(options.project.config().modulePrefix), - destroyAppExists: existsSync(path.join(this.project.root, '/tests/helpers/destroy-app.js')) + destroyAppExists: fs.existsSync(path.join(this.project.root, '/tests/helpers/destroy-app.js')) }; } });
true
Other
emberjs
ember.js
8898e795f89255d637138f6d21d6892b050dffaf.json
Remove extraneous shebang's from bin/*.js scripts.
bin/build-for-publishing.js
@@ -1,4 +1,3 @@ -#!/usr/bin/env node 'use strict'; /* eslint-env node, es6 */
true
Other
emberjs
ember.js
8898e795f89255d637138f6d21d6892b050dffaf.json
Remove extraneous shebang's from bin/*.js scripts.
bin/publish_to_s3.js
@@ -1,4 +1,3 @@ -#!/usr/bin/env node // To invoke this from the commandline you need the following to env vars to exist: //
true
Other
emberjs
ember.js
8898e795f89255d637138f6d21d6892b050dffaf.json
Remove extraneous shebang's from bin/*.js scripts.
bin/run-browserstack-tests.js
@@ -1,4 +1,3 @@ -#!/usr/bin/env node /* eslint-disable no-console */
true
Other
emberjs
ember.js
8898e795f89255d637138f6d21d6892b050dffaf.json
Remove extraneous shebang's from bin/*.js scripts.
bin/run-tests.js
@@ -1,4 +1,3 @@ -#!/usr/bin/env node /* globals QUnit */ /* eslint-disable no-console */
true
Other
emberjs
ember.js
8898e795f89255d637138f6d21d6892b050dffaf.json
Remove extraneous shebang's from bin/*.js scripts.
bin/run-travis-browser-tests.js
@@ -1,4 +1,3 @@ -#!/usr/bin/env node /* eslint-disable no-console */
true
Other
emberjs
ember.js
8898e795f89255d637138f6d21d6892b050dffaf.json
Remove extraneous shebang's from bin/*.js scripts.
bin/yarn-link-glimmer.js
@@ -1,4 +1,3 @@ -#!/usr/bin/env node "use strict"; const child_process = require("child_process");
true
Other
emberjs
ember.js
8898e795f89255d637138f6d21d6892b050dffaf.json
Remove extraneous shebang's from bin/*.js scripts.
bin/yarn-unlink-glimmer.js
@@ -1,4 +1,3 @@ -#!/usr/bin/env node "use strict"; const child_process = require("child_process");
true
Other
emberjs
ember.js
c25c3da365183764ecdb306b5b6018cf63cb22bb.json
Add missing packages to package.json. These packages are being used but were not listed as explicit dependencies. This was identified by eslint-plugin-node...
package.json
@@ -50,6 +50,7 @@ "dependencies": { "broccoli-funnel": "^2.0.1", "broccoli-merge-trees": "^2.0.0", + "chalk": "^2.3.0", "ember-cli-get-component-path-option": "^1.0.0", "ember-cli-is-package-missing": "^1.0.0", "ember-cli-normalize-entity-name": "^1.0.0", @@ -71,6 +72,7 @@ "@glimmer/reference": "^0.33.4", "@glimmer/runtime": "^0.33.4", "@types/rsvp": "^4.0.1", + "amd-name-resolver": "^1.2.0", "auto-dist-tag": "^0.1.5", "aws-sdk": "^2.46.0", "babel-plugin-check-es2015-constants": "^6.22.0", @@ -95,13 +97,13 @@ "broccoli-concat": "^3.2.2", "broccoli-debug": "^0.6.4", "broccoli-file-creator": "^1.1.1", + "broccoli-persistent-filter": "^1.4.3", "broccoli-rollup": "^2.1.0", "broccoli-source": "^1.1.0", "broccoli-string-replace": "^0.1.2", "broccoli-typescript-compiler": "^2.2.0", "broccoli-uglify-js": "^0.2.0", "broccoli-uglify-sourcemap": "^2.0.2", - "chalk": "^2.3.0", "common-tags": "^1.7.2", "dag-map": "^2.0.2", "ember-cli": "github:ember-cli/ember-cli#76175513c5e49caf5405b7304e83ddf3e799c68e", @@ -116,6 +118,7 @@ "execa": "^0.10.0", "express": "^4.16.2", "finalhandler": "^1.0.2", + "fs-extra": "^5.0.0", "git-repo-info": "^1.4.1", "github": "^0.2.3", "glob": "^7.1.2",
true
Other
emberjs
ember.js
c25c3da365183764ecdb306b5b6018cf63cb22bb.json
Add missing packages to package.json. These packages are being used but were not listed as explicit dependencies. This was identified by eslint-plugin-node...
yarn.lock
@@ -1389,7 +1389,7 @@ broccoli-middleware@^1.0.0: handlebars "^4.0.4" mime "^1.2.11" -broccoli-persistent-filter@^1.1.5, broccoli-persistent-filter@^1.1.6, broccoli-persistent-filter@^1.4.0: +broccoli-persistent-filter@^1.1.5, broccoli-persistent-filter@^1.1.6, broccoli-persistent-filter@^1.4.0, broccoli-persistent-filter@^1.4.3: version "1.4.3" resolved "https://registry.yarnpkg.com/broccoli-persistent-filter/-/broccoli-persistent-filter-1.4.3.tgz#3511bc52fc53740cda51621f58a28152d9911bc1" dependencies:
true
Other
emberjs
ember.js
a6c8453ce778a0b61951a74ac158c1c6c9ff55b5.json
Move main entry point into `lib/`. This is ultimately so that we can properly lint this file without resorting to annoying inline comments.
lib/index.js
@@ -19,15 +19,21 @@ add(paths, 'debug', 'vendor/ember/ember.debug.js'); add(paths, 'testing', 'vendor/ember/ember-testing.js'); add(paths, 'jquery', 'vendor/ember/jquery/jquery.js'); -add(absolutePaths, 'templateCompiler', __dirname + '/dist/ember-template-compiler.js'); +add(absolutePaths, 'templateCompiler', path.join(__dirname, '..', 'dist', 'ember-template-compiler.js')); module.exports = { init: function() { - this._super.init && this._super.init.apply(this, arguments); + this._super.init && this._super.init.apply(this, arguments); + if ('ember' in this.project.bowerDependencies()) { // TODO: move this to a throw soon. this.ui.writeWarnLine('Ember.js is now provided by node_module `ember-source`, please remove it from bower'); } + + // resets `this.root` to the correct location by default ember-cli + // considers `__dirname` here to be the root, but since our main entry + // point is within a subfolder we need to correct that + this.root = path.join(__dirname, '..'); }, name: 'ember-source', @@ -65,12 +71,12 @@ module.exports = { return flat.concat(jsAndMap); }, []) .filter(function(file) { - var fullPath = path.join(__dirname, 'dist', file); + var fullPath = path.join(__dirname, '..', 'dist', file); return fs.existsSync(fullPath); }); - var ember = new Funnel(__dirname + '/dist', { + var ember = new Funnel(__dirname + '../dist', { destDir: 'ember', files: emberFiles });
true
Other
emberjs
ember.js
a6c8453ce778a0b61951a74ac158c1c6c9ff55b5.json
Move main entry point into `lib/`. This is ultimately so that we can properly lint this file without resorting to annoying inline comments.
package.json
@@ -10,6 +10,7 @@ "url": "https://github.com/emberjs/ember.js/issues" }, "license": "MIT", + "main": "lib/index.js", "files": [ "build-metadata.json", "blueprints", @@ -26,8 +27,8 @@ "dist/ember.prod.js", "dist/ember.prod.map", "docs/data.json", - "vendor/ember", - "index.js" + "lib/index.js", + "vendor/ember" ], "repository": { "type": "git",
true
Other
emberjs
ember.js
a5d7e0ff7effbe9d26a38d94c8453ddf8dfe24ff.json
Fix linting errors (using new stricter settings).
bin/run-tests.js
@@ -1,5 +1,5 @@ #!/usr/bin/env node - +/* globals QUnit */ /* eslint-disable no-console */ var execa = require('execa');
true
Other
emberjs
ember.js
a5d7e0ff7effbe9d26a38d94c8453ddf8dfe24ff.json
Fix linting errors (using new stricter settings).
packages/ember-environment/lib/index.js
@@ -1,4 +1,3 @@ -/* globals module */ import global from './global'; import { defaultFalse, defaultTrue, normalizeExtendPrototypes } from './utils'; /**
true
Other
emberjs
ember.js
a5d7e0ff7effbe9d26a38d94c8453ddf8dfe24ff.json
Fix linting errors (using new stricter settings).
packages/ember-metal/lib/map.js
@@ -271,7 +271,7 @@ class Map { let guid = guidFor(key); // ensure we don't store -0 - let k = key === -0 ? 0 : key; + let k = key === -0 ? 0 : key; // eslint-disable-line no-compare-neg-zero keys.add(k, guid);
true
Other
emberjs
ember.js
a5d7e0ff7effbe9d26a38d94c8453ddf8dfe24ff.json
Fix linting errors (using new stricter settings).
packages/ember-testing/lib/adapters/qunit.js
@@ -1,3 +1,5 @@ +/* globals QUnit */ + import { inspect } from 'ember-utils'; import Adapter from './adapter'; /**
true
Other
emberjs
ember.js
a5d7e0ff7effbe9d26a38d94c8453ddf8dfe24ff.json
Fix linting errors (using new stricter settings).
packages/ember/lib/index.js
@@ -601,7 +601,6 @@ runLoadHooks('Ember'); */ export default Ember; -/* globals module */ if (IS_NODE) { module.exports = Ember; } else {
true
Other
emberjs
ember.js
a5d7e0ff7effbe9d26a38d94c8453ddf8dfe24ff.json
Fix linting errors (using new stricter settings).
packages/node-module/lib/node-module.js
@@ -1,4 +1,4 @@ -/*global enifed */ +/*global enifed, module */ enifed('node-module', ['exports'], function(_exports) { var IS_NODE = typeof module === 'object' && typeof module.require === 'function'; if (IS_NODE) { @@ -10,4 +10,4 @@ enifed('node-module', ['exports'], function(_exports) { _exports.module = null; _exports.IS_NODE = IS_NODE; } -}); \ No newline at end of file +});
true
Other
emberjs
ember.js
a5d7e0ff7effbe9d26a38d94c8453ddf8dfe24ff.json
Fix linting errors (using new stricter settings).
rollup.config.js
@@ -1,7 +1,9 @@ -import * as fs from 'fs'; -import * as path from 'path'; +'use strict'; -export default { +const fs = require('fs'); +const path = require('path'); + +module.exports = { input: 'dist/es/ember/index.js', plugins: [emberPackage()], output: {
true
Other
emberjs
ember.js
ad6f5963a6cd67aa2a64df5cb4aade6489de15e6.json
Consolidate eslint configuration.
.eslintignore
@@ -1,4 +1,6 @@ blueprints/*/*files/**/*.js +node-tests/fixtures/**/*.js +docs/ dist/ tmp/ **/*.ts
true
Other
emberjs
ember.js
ad6f5963a6cd67aa2a64df5cb4aade6489de15e6.json
Consolidate eslint configuration.
.eslintrc-browser.js
@@ -1,45 +0,0 @@ -module.exports = { - root: true, - parserOptions: { - ecmaVersion: 6, - sourceType: 'module', - }, - extends: 'eslint:recommended', - plugins: [ - "ember-internal" - ], - env: { - qunit: true, - }, - globals: { - 'expectAssertion': true, - 'expectDeprecation': true, - 'expectNoDeprecation': true, - 'expectWarning': true, - 'expectNoWarning': true, - 'ignoreAssertion': true, - 'ignoreDeprecation': true, - - // A safe subset of "browser:true": - 'window': true, - 'document': true, - 'setTimeout': true, - 'clearTimeout': true, - 'setInterval': true, - 'clearInterval': true, - 'console': true, - - 'Map': true, - 'Set': true, - 'Symbol': true, - 'WeakMap': true, - }, - rules: { - 'ember-internal/require-yuidoc-access': 'error', - 'ember-internal/no-const-outside-module-scope': 'error', - - 'semi': 'error', - 'no-unused-vars': 'error', - 'comma-dangle': 'off', - }, -};
true
Other
emberjs
ember.js
ad6f5963a6cd67aa2a64df5cb4aade6489de15e6.json
Consolidate eslint configuration.
.eslintrc-node.js
@@ -1,24 +0,0 @@ -module.exports = { - root: true, - parserOptions: { - ecmaVersion: 8, - sourceType: 'module', - }, - extends: 'eslint:recommended', - plugins: [ - "ember-internal" - ], - env: { - mocha: true, - node: true, - qunit: true - }, - globals: { - Map: false, - Set: false - }, - rules: { - 'semi': 'error', - 'no-unused-vars': 'error' - } -};
true
Other
emberjs
ember.js
ad6f5963a6cd67aa2a64df5cb4aade6489de15e6.json
Consolidate eslint configuration.
.eslintrc.js
@@ -1 +1,109 @@ -module.exports = require('./.eslintrc-node'); +module.exports = { + root: true, + extends: [ + 'eslint:recommended', + ], + plugins: [ + "ember-internal" + ], + + rules: { + 'semi': 'error', + 'no-unused-vars': 'error', + 'no-useless-escape': 'off', // TODO: bring this back + }, + + overrides: [ + { + files: [ 'packages/**/*.js' ], + + parserOptions: { + ecmaVersion: 2017, + sourceType: 'module', + }, + + globals: { + // A safe subset of "browser:true": + 'window': true, + 'document': true, + 'setTimeout': true, + 'clearTimeout': true, + 'setInterval': true, + 'clearInterval': true, + 'console': true, + 'Map': true, + 'Set': true, + 'Symbol': true, + 'WeakMap': true, + }, + + rules: { + 'ember-internal/require-yuidoc-access': 'error', + 'ember-internal/no-const-outside-module-scope': 'error', + + 'semi': 'error', + 'no-unused-vars': 'error', + 'comma-dangle': 'off', + }, + }, + { + files: [ + 'packages/*/tests/**/*.js', + 'packages/internal-test-helpers/**/*.js', + ], + env: { + qunit: true, + }, + globals: { + 'expectAssertion': true, + 'expectDeprecation': true, + 'expectNoDeprecation': true, + 'expectWarning': true, + 'expectNoWarning': true, + 'ignoreAssertion': true, + 'ignoreDeprecation': true, + }, + }, + { + files: [ + 'node-tests/**/*.js', + 'tests/node/**/*.js', + 'blueprints/**/*.js', + 'broccoli/**/*.js', + 'bin/**/*.js', + 'config/**/*.js', + 'lib/**/*.js', + 'server/**/*.js', + 'testem.travis-browsers.js', + 'testem.dist.js', + 'ember-cli-build.js', + 'd8-runner.js', + 'rollup.config.js', + ], + + parserOptions: { + ecmaVersion: 2015, + sourceType: 'script', + }, + + env: { + node: true, + es6: true, + } + }, + { + files: [ 'node-tests/**/*.js' ], + + env: { + mocha: true, + }, + }, + { + files: [ 'tests/node/**/*.js' ], + + env: { + qunit: true + }, + }, + ] +};
true
Other
emberjs
ember.js
ad6f5963a6cd67aa2a64df5cb4aade6489de15e6.json
Consolidate eslint configuration.
node-tests/fixtures/acceptance-test/.eslintrc.js
@@ -1,7 +0,0 @@ -module.exports = { - globals: { - andThen: false, - visit: false, - currentURL: false - } -}
true
Other
emberjs
ember.js
ad6f5963a6cd67aa2a64df5cb4aade6489de15e6.json
Consolidate eslint configuration.
node-tests/fixtures/util-test/.eslintrc.js
@@ -1,5 +0,0 @@ -module.exports = { - rules: { - 'no-unused-vars': 'off' - } -}
true
Other
emberjs
ember.js
ad6f5963a6cd67aa2a64df5cb4aade6489de15e6.json
Consolidate eslint configuration.
packages/.eslintrc.js
@@ -1 +0,0 @@ -module.exports = require('../.eslintrc-browser');
true
Other
emberjs
ember.js
33e64593525be8a953b1b73a67da1176148dfa2b.json
Fix incorrect merging of TS output + rootDir.
broccoli/packages.js
@@ -4,7 +4,8 @@ const { readFileSync, existsSync } = require('fs'); const path = require('path'); const Rollup = require('broccoli-rollup'); const Funnel = require('broccoli-funnel'); -const filterTypeScript = require('broccoli-typescript-compiler').filterTypeScript; +const MergeTrees = require('broccoli-merge-trees'); +const typescript = require('broccoli-typescript-compiler').typescript; const BroccoliDebug = require('broccoli-debug'); const findLib = require('./find-lib'); const findPackage = require('./find-package'); @@ -81,18 +82,22 @@ module.exports.emberTypescriptPkgES = function emberTypescriptPkg(name) { `${name}:templates-output` ); - let typescriptCompiled = filterTypeScript( - debuggedCompiledTemplatesAndTypeScript, - { - noImplicitAny: false - } - ); - - let funneled = new Funnel(typescriptCompiled, { + let nonTypeScriptContents = new Funnel(debuggedCompiledTemplatesAndTypeScript, { srcDir: 'packages', + exclude: ["**/*.ts"], }); - return debugTree(funneled, `${name}:output`); + let typescriptContents = new Funnel(debuggedCompiledTemplatesAndTypeScript, { + include: ["**/*.ts"], + }); + + let typescriptCompiled = typescript(debugTree(typescriptContents, `${name}:ts:input`)); + + let debuggedCompiledTypescript = debugTree(typescriptCompiled, `${name}:ts:output`); + + let mergedFinalOutput = new MergeTrees([nonTypeScriptContents, debuggedCompiledTypescript], { overwrite: true }); + + return debugTree(mergedFinalOutput, `${name}:output`); }; module.exports.rollupEmberGlimmerES = function(emberGlimmerES) {
true
Other
emberjs
ember.js
33e64593525be8a953b1b73a67da1176148dfa2b.json
Fix incorrect merging of TS output + rootDir.
tsconfig.json
@@ -4,7 +4,7 @@ "target": "es2017", "sourceMap": true, "outDir": "dist", - "baseUrl" : "packages", + "baseUrl": "packages", "rootDir": "packages", // Environment Configuration
true
Other
emberjs
ember.js
fe59f2dd038b87d4d9a647237216d06bbd7c21a6.json
Remove duplicate externs.d.ts.
packages/ember-metal/externs.d.ts
@@ -1,12 +0,0 @@ -declare module 'ember/features' { - export const EMBER_TEMPLATE_BLOCK_LET_HELPER: boolean | null; - export const EMBER_MODULE_UNIFICATION: boolean | null; - export const GLIMMER_CUSTOM_COMPONENT_MANAGER: boolean | null; - export const EMBER_ENGINES_MOUNT_PARAMS: boolean | null; - export const EMBER_GLIMMER_DETECT_BACKTRACKING_RERENDER: boolean | null; - export const MANDATORY_SETTER: boolean | null; -} - -declare module 'ember-env-flags' { - export const DEBUG: boolean; -}
false
Other
emberjs
ember.js
e918aed822824388d0a8212c302bf18f5ee6c796.json
Target ES2017 from typescript compilation. Further transformation (to make compatible with older browsers is done downstream of typescript...).
tsconfig.json
@@ -1,8 +1,7 @@ { "compilerOptions": { // Compilation Configuration - "target": "es2015", - "module": "es2015", + "target": "es2017", "inlineSources": true, "inlineSourceMap": true, "outDir": "dist",
false
Other
emberjs
ember.js
d607cdc3956a0824566d6871fdde65d08beff009.json
Fix eager cause of '(unknown mixin)'
packages/ember-metal/lib/meta.js
@@ -1,15 +1,13 @@ -import { - lookupDescriptor, - symbol, - toString -} from 'ember-utils'; +import { lookupDescriptor, symbol, toString } from 'ember-utils'; import { protoMethods as listenerMethods } from './meta_listeners'; import { assert } from 'ember-debug'; import { DEBUG } from 'ember-env-flags'; -import { DESCRIPTOR_TRAP, EMBER_METAL_ES5_GETTERS, MANDATORY_SETTER } from 'ember/features'; import { - removeChainWatcher -} from './chains'; + DESCRIPTOR_TRAP, + EMBER_METAL_ES5_GETTERS, + MANDATORY_SETTER +} from 'ember/features'; +import { removeChainWatcher } from './chains'; import { ENV } from 'ember-environment'; let counters; @@ -88,7 +86,9 @@ export class Meta { } destroy() { - if (this.isMetaDestroyed()) { return; } + if (this.isMetaDestroyed()) { + return; + } // remove chainWatchers to remove circular references that would prevent GC let nodes, key, nodeObject; @@ -188,7 +188,7 @@ export class Meta { } pointer = pointer.parent; } -} + } _hasInInheritedSet(key, value) { let pointer = this; @@ -207,7 +207,13 @@ export class Meta { // Implements a member that provides a lazily created map of maps, // with inheritance at both levels. writeDeps(subkey, itemkey, value) { - assert(`Cannot modify dependent keys for \`${itemkey}\` on \`${toString(this.source)}\` after it has been destroyed.`, !this.isMetaDestroyed()); + assert( + this.isMetaDestroyed() && + `Cannot modify dependent keys for \`${itemkey}\` on \`${toString( + this.source + )}\` after it has been destroyed.`, + !this.isMetaDestroyed() + ); let outerMap = this._getOrCreateOwnMap('_deps'); let innerMap = outerMap[subkey]; @@ -273,17 +279,27 @@ export class Meta { } if (calls !== undefined) { - for (let i = 0; i < calls.length; i+=2) { + for (let i = 0; i < calls.length; i += 2) { fn(calls[i], calls[i + 1]); } } } - writableTags() { return this._getOrCreateOwnMap('_tags'); } - readableTags() { return this._tags; } + writableTags() { + return this._getOrCreateOwnMap('_tags'); + } + readableTags() { + return this._tags; + } writableTag(create) { - assert(`Cannot create a new tag for \`${toString(this.source)}\` after it has been destroyed.`, !this.isMetaDestroyed()); + assert( + this.isMetaDestroyed() && + `Cannot create a new tag for \`${toString( + this.source + )}\` after it has been destroyed.`, + !this.isMetaDestroyed() + ); let ret = this._tag; if (ret === undefined) { ret = this._tag = create(this.source); @@ -296,7 +312,13 @@ export class Meta { } writableChainWatchers(create) { - assert(`Cannot create a new chain watcher for \`${toString(this.source)}\` after it has been destroyed.`, !this.isMetaDestroyed()); + assert( + this.isMetaDestroyed() && + `Cannot create a new chain watcher for \`${toString( + this.source + )}\` after it has been destroyed.`, + !this.isMetaDestroyed() + ); let ret = this._chainWatchers; if (ret === undefined) { ret = this._chainWatchers = create(this.source); @@ -309,7 +331,13 @@ export class Meta { } writableChains(create) { - assert(`Cannot create a new chains for \`${toString(this.source)}\` after it has been destroyed.`, !this.isMetaDestroyed()); + assert( + this.isMetaDestroyed() && + `Cannot create a new chains for \`${toString( + this.source + )}\` after it has been destroyed.`, + !this.isMetaDestroyed() + ); let ret = this._chains; if (ret === undefined) { if (this.parent === undefined) { @@ -327,7 +355,13 @@ export class Meta { } writeWatching(subkey, value) { - assert(`Cannot update watchers for \`${subkey}\` on \`${toString(this.source)}\` after it has been destroyed.`, !this.isMetaDestroyed()); + assert( + this.isMetaDestroyed() && + `Cannot update watchers for \`${subkey}\` on \`${toString( + this.source + )}\` after it has been destroyed.`, + !this.isMetaDestroyed() + ); let map = this._getOrCreateOwnMap('_watching'); map[subkey] = value; } @@ -337,7 +371,13 @@ export class Meta { } addMixin(mixin) { - assert(`Cannot add mixins of \`${toString(mixin)}\` on \`${toString(this.source)}\` call addMixin after it has been destroyed.`, !this.isMetaDestroyed()); + assert( + this.isMetaDestroyed() && + `Cannot add mixins of \`${toString(mixin)}\` on \`${toString( + this.source + )}\` call addMixin after it has been destroyed.`, + !this.isMetaDestroyed() + ); let set = this._getOrCreateOwnSet('_mixins'); set.add(mixin); } @@ -353,7 +393,7 @@ export class Meta { let set = pointer._mixins; if (set !== undefined) { seen = seen === undefined ? new Set() : seen; - set.forEach((mixin)=> { + set.forEach(mixin => { if (!seen.has(mixin)) { seen.add(mixin); fn(mixin); @@ -365,20 +405,35 @@ export class Meta { } writeBindings(subkey, value) { - assert('Cannot invoke `meta.writeBindings` when EmberENV._ENABLE_BINDING_SUPPORT is not set', ENV._ENABLE_BINDING_SUPPORT); - assert(`Cannot add a binding for \`${subkey}\` on \`${toString(this.source)}\` after it has been destroyed.`, !this.isMetaDestroyed()); + assert( + 'Cannot invoke `meta.writeBindings` when EmberENV._ENABLE_BINDING_SUPPORT is not set', + ENV._ENABLE_BINDING_SUPPORT + ); + assert( + this.isMetaDestroyed() && + `Cannot add a binding for \`${subkey}\` on \`${toString( + this.source + )}\` after it has been destroyed.`, + !this.isMetaDestroyed() + ); let map = this._getOrCreateOwnMap('_bindings'); map[subkey] = value; } peekBindings(subkey) { - assert('Cannot invoke `meta.peekBindings` when EmberENV._ENABLE_BINDING_SUPPORT is not set', ENV._ENABLE_BINDING_SUPPORT); + assert( + 'Cannot invoke `meta.peekBindings` when EmberENV._ENABLE_BINDING_SUPPORT is not set', + ENV._ENABLE_BINDING_SUPPORT + ); return this._findInherited('_bindings', subkey); } forEachBindings(fn) { - assert('Cannot invoke `meta.forEachBindings` when EmberENV._ENABLE_BINDING_SUPPORT is not set', ENV._ENABLE_BINDING_SUPPORT); + assert( + 'Cannot invoke `meta.forEachBindings` when EmberENV._ENABLE_BINDING_SUPPORT is not set', + ENV._ENABLE_BINDING_SUPPORT + ); let pointer = this; let seen; @@ -398,30 +453,44 @@ export class Meta { } clearBindings() { - assert('Cannot invoke `meta.clearBindings` when EmberENV._ENABLE_BINDING_SUPPORT is not set', ENV._ENABLE_BINDING_SUPPORT); - assert(`Cannot clear bindings on \`${toString(this.source)}\` after it has been destroyed.`, !this.isMetaDestroyed()); + assert( + 'Cannot invoke `meta.clearBindings` when EmberENV._ENABLE_BINDING_SUPPORT is not set', + ENV._ENABLE_BINDING_SUPPORT + ); + assert( + this.isMetaDestroyed() && + `Cannot clear bindings on \`${toString( + this.source + )}\` after it has been destroyed.`, + !this.isMetaDestroyed() + ); this._bindings = undefined; } - } for (let name in listenerMethods) { Meta.prototype[name] = listenerMethods[name]; } if (MANDATORY_SETTER) { - Meta.prototype.writeValues = function (subkey, value) { - assert(`Cannot set the value of \`${subkey}\` on \`${toString(this.source)}\` after it has been destroyed.`, !this.isMetaDestroyed()); + Meta.prototype.writeValues = function(subkey, value) { + assert( + this.isMetaDestroyed() && + `Cannot set the value of \`${subkey}\` on \`${toString( + this.source + )}\` after it has been destroyed.`, + !this.isMetaDestroyed() + ); let map = this._getOrCreateOwnMap('_values'); map[subkey] = value; }; - Meta.prototype.peekValues = function (subkey) { + Meta.prototype.peekValues = function(subkey) { return this._findInherited('_values', subkey); }; - Meta.prototype.deleteFromValues = function (subkey) { + Meta.prototype.deleteFromValues = function(subkey) { delete this._getOrCreateOwnMap('_values')[subkey]; }; @@ -446,7 +515,8 @@ if (MANDATORY_SETTER) { Meta.prototype.writeValue = function(obj, key, value) { let descriptor = lookupDescriptor(obj, key); - let isMandatorySetter = descriptor !== null && descriptor.set && descriptor.set.isMandatorySetter; + let isMandatorySetter = + descriptor !== null && descriptor.set && descriptor.set.isMandatorySetter; if (isMandatorySetter) { this.writeValues(key, value); @@ -458,7 +528,13 @@ if (MANDATORY_SETTER) { if (EMBER_METAL_ES5_GETTERS) { Meta.prototype.writeDescriptors = function(subkey, value) { - assert(`Cannot update descriptors for \`${subkey}\` on \`${toString(this.source)}\` after it has been destroyed.`, !this.isMetaDestroyed()); + assert( + this.isMetaDestroyed() && + `Cannot update descriptors for \`${subkey}\` on \`${toString( + this.source + )}\` after it has been destroyed.`, + !this.isMetaDestroyed() + ); let map = this._getOrCreateOwnMap('_descriptors'); map[subkey] = value; }; @@ -500,7 +576,10 @@ const metaStore = new WeakMap(); export function setMeta(obj, meta) { assert('Cannot call `setMeta` on null', obj !== null); assert('Cannot call `setMeta` on undefined', obj !== undefined); - assert(`Cannot call \`setMeta\` on ${typeof obj}`, typeof obj === 'object' || typeof obj === 'function'); + assert( + `Cannot call \`setMeta\` on ${typeof obj}`, + typeof obj === 'object' || typeof obj === 'function' + ); if (DEBUG) { counters.setCalls++; @@ -511,7 +590,10 @@ export function setMeta(obj, meta) { export function peekMeta(obj) { assert('Cannot call `peekMeta` on null', obj !== null); assert('Cannot call `peekMeta` on undefined', obj !== undefined); - assert(`Cannot call \`peekMeta\` on ${typeof obj}`, typeof obj === 'object' || typeof obj === 'function'); + assert( + `Cannot call \`peekMeta\` on ${typeof obj}`, + typeof obj === 'object' || typeof obj === 'function' + ); let pointer = obj; let meta; @@ -545,7 +627,10 @@ export function peekMeta(obj) { export function deleteMeta(obj) { assert('Cannot call `deleteMeta` on null', obj !== null); assert('Cannot call `deleteMeta` on undefined', obj !== undefined); - assert(`Cannot call \`deleteMeta\` on ${typeof obj}`, typeof obj === 'object' || typeof obj === 'function'); + assert( + `Cannot call \`deleteMeta\` on ${typeof obj}`, + typeof obj === 'object' || typeof obj === 'function' + ); if (DEBUG) { counters.deleteCalls++; @@ -578,7 +663,10 @@ export function deleteMeta(obj) { export function meta(obj) { assert('Cannot call `meta` on null', obj !== null); assert('Cannot call `meta` on undefined', obj !== undefined); - assert(`Cannot call \`meta\` on ${typeof obj}`, typeof obj === 'object' || typeof obj === 'function'); + assert( + `Cannot call \`meta\` on ${typeof obj}`, + typeof obj === 'object' || typeof obj === 'function' + ); if (DEBUG) { counters.metaCalls++; @@ -622,7 +710,10 @@ export const DESCRIPTOR = '__DESCRIPTOR__'; export function descriptorFor(obj, keyName, _meta) { assert('Cannot call `descriptorFor` on null', obj !== null); assert('Cannot call `descriptorFor` on undefined', obj !== undefined); - assert(`Cannot call \`descriptorFor\` on ${typeof obj}`, typeof obj === 'object' || typeof obj === 'function'); + assert( + `Cannot call \`descriptorFor\` on ${typeof obj}`, + typeof obj === 'object' || typeof obj === 'function' + ); if (EMBER_METAL_ES5_GETTERS) { let meta = _meta === undefined ? peekMeta(obj) : _meta; @@ -643,7 +734,11 @@ export function descriptorFor(obj, keyName, _meta) { export function isDescriptorTrap(possibleDesc) { if (DESCRIPTOR_TRAP) { - return possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc[DESCRIPTOR] !== undefined; + return ( + possibleDesc !== null && + typeof possibleDesc === 'object' && + possibleDesc[DESCRIPTOR] !== undefined + ); } else { throw new Error('Cannot call `isDescriptorTrap` in production'); } @@ -658,7 +753,11 @@ export function isDescriptorTrap(possibleDesc) { @private */ export function isDescriptor(possibleDesc) { - return possibleDesc !== null && typeof possibleDesc === 'object' && possibleDesc.isDescriptor; + return ( + possibleDesc !== null && + typeof possibleDesc === 'object' && + possibleDesc.isDescriptor + ); } export { counters };
false
Other
emberjs
ember.js
9fa99447d769b02db0437461f6217ba8ec6d22f2.json
Expose `hasScheduledTimers` on `Ember.run`
packages/ember/lib/index.js
@@ -96,6 +96,7 @@ Ember.run.bind = metal.bind; Ember.run.cancel = metal.cancel; Ember.run.debounce = metal.debounce; Ember.run.end = metal.end; +Ember.run.hasScheduledTimers = metal.hasScheduledTimers; Ember.run.join = metal.join; Ember.run.later = metal.later; Ember.run.next = metal.next;
true
Other
emberjs
ember.js
9fa99447d769b02db0437461f6217ba8ec6d22f2.json
Expose `hasScheduledTimers` on `Ember.run`
packages/ember/tests/reexports_test.js
@@ -77,6 +77,7 @@ let allExports =[ ['run.cancel', 'ember-metal', 'cancel'], ['run.debounce', 'ember-metal', 'debounce'], ['run.end', 'ember-metal', 'end'], + ['run.hasScheduledTimers', 'ember-metal', 'hasScheduledTimers'], ['run.join', 'ember-metal', 'join'], ['run.later', 'ember-metal', 'later'], ['run.next', 'ember-metal', 'next'],
true
Other
emberjs
ember.js
3b77850fa877c1872b126f6a0661159f57173b03.json
Make run loop functions named exports.
packages/ember-application/lib/system/application.js
@@ -7,7 +7,11 @@ import { assert, isTesting } from 'ember-debug'; import { DEBUG } from 'ember-env-flags'; import { libraries, - run + run, + join, + schedule, + bind, + once, } from 'ember-metal'; import { Namespace, @@ -493,9 +497,9 @@ const Application = Engine.extend({ */ waitForDOMReady() { if (!this.$ || this.$.isReady) { - run.schedule('actions', this, 'domReady'); + schedule('actions', this, 'domReady'); } else { - this.$().ready(run.bind(this, 'domReady')); + this.$().ready(bind(this, 'domReady')); } }, @@ -594,7 +598,7 @@ const Application = Engine.extend({ this._readinessDeferrals--; if (this._readinessDeferrals === 0) { - run.once(this, this.didBecomeReady); + once(this, this.didBecomeReady); } }, @@ -751,10 +755,10 @@ const Application = Engine.extend({ function handleReset() { run(instance, 'destroy'); this._buildDeprecatedInstance(); - run.schedule('actions', this, '_bootSync'); + schedule('actions', this, '_bootSync'); } - run.join(this, handleReset); + join(this, handleReset); }, /**
true
Other
emberjs
ember.js
3b77850fa877c1872b126f6a0661159f57173b03.json
Make run loop functions named exports.
packages/ember-application/tests/system/visit_test.js
@@ -5,7 +5,7 @@ import { RSVP, onerrorDefault } from 'ember-runtime'; -import { run } from 'ember-metal'; +import { later } from 'ember-metal'; import Application from '../../system/application'; import ApplicationInstance from '../../system/application-instance'; import Engine from '../../system/engine'; @@ -104,7 +104,7 @@ moduleFor('Application - visit()', class extends ApplicationTestCase { // does not fire. [`@test Applications with autoboot set to false do not autoboot`](assert) { function delay(time) { - return new RSVP.Promise(resolve => run.later(resolve, time)); + return new RSVP.Promise(resolve => later(resolve, time)); } let appBooted = 0;
true
Other
emberjs
ember.js
3b77850fa877c1872b126f6a0661159f57173b03.json
Make run loop functions named exports.
packages/ember-extension-support/lib/data_adapter.js
@@ -1,7 +1,7 @@ import { getOwner } from 'ember-utils'; import { get, - run, + scheduleOnce, objectAt, addArrayObserver, removeArrayObserver @@ -297,7 +297,7 @@ export default EmberObject.extend({ // Only re-fetch records if the record count changed // (which is all we care about as far as model types are concerned). if (removedCount > 0 || addedCount > 0) { - run.scheduleOnce('actions', this, onChange); + scheduleOnce('actions', this, onChange); } }, willChange() { return this; }
true
Other
emberjs
ember.js
3b77850fa877c1872b126f6a0661159f57173b03.json
Make run loop functions named exports.
packages/ember-glimmer/lib/helpers/action.ts
@@ -10,7 +10,7 @@ import { flaggedInstrument, get, isNone, - run, + join, } from 'ember-metal'; import { ACTION, INVOKE, UnboundReference } from '../utils/references'; @@ -375,7 +375,7 @@ function makeClosureAction(context: any, target: any, action: any, processArgs: return (...args: any[]) => { let payload = { target: self, args, label: '@glimmer/closure-action' }; return flaggedInstrument('interaction.ember-action', payload, () => { - return run.join(self, fn, ...processArgs(args)); + return join(self, fn, ...processArgs(args)); }); }; }
true
Other
emberjs
ember.js
3b77850fa877c1872b126f6a0661159f57173b03.json
Make run loop functions named exports.
packages/ember-glimmer/lib/modifiers/action.ts
@@ -15,7 +15,7 @@ import { Destroyable } from '@glimmer/util'; import { assert } from 'ember-debug'; -import { flaggedInstrument, run } from 'ember-metal'; +import { flaggedInstrument, join } from 'ember-metal'; import { uuid } from 'ember-utils'; import { ActionManager, @@ -140,7 +140,7 @@ export class ActionState { event.stopPropagation(); } - run.join(() => { + join(() => { let args = this.getActionArgs(); let payload = { args,
true
Other
emberjs
ember.js
3b77850fa877c1872b126f6a0661159f57173b03.json
Make run loop functions named exports.
packages/ember-glimmer/lib/renderer.ts
@@ -15,7 +15,8 @@ import { import { Opaque } from '@glimmer/util'; import { assert } from 'ember-debug'; import { - run, + backburner, + getCurrentRunLoop, runInTransaction, setHasViews, } from 'ember-metal'; @@ -36,7 +37,6 @@ import { OutletState } from './utils/outlet'; import { UnboundReference } from './utils/references'; import OutletView from './views/outlet'; -const { backburner } = run; export type IBuilder = (env: Environment, cursor: Cursor) => ElementBuilder; export class DynamicScope implements GlimmerDynamicScope { @@ -203,7 +203,7 @@ export function renderSettled() { renderSettledDeferred = RSVP.defer(); // if there is no current runloop, the promise created above will not have // a chance to resolve (because its resolved in backburner's "end" event) - if (!run.currentRunLoop) { + if (!getCurrentRunLoop()) { // ensure a runloop has been kicked off backburner.schedule('actions', null, K); }
true