Skip to content

Commit

Permalink
add member-delimiter-style lint rule (semi colons after member declar…
Browse files Browse the repository at this point in the history
…ations in types). phetsims/chipper#1210
  • Loading branch information
zepumph committed Mar 23, 2022
1 parent cde0db2 commit c3fd20c
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions js/DerivedProperty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import IntentionalAny from '../../phet-core/js/types/IntentionalAny.js';
const DERIVED_PROPERTY_IO_PREFIX = 'DerivedPropertyIO';

type DerivedPropertyDefinedOptions = {
tandem: Tandem,
phetioType?: IOType
tandem: Tandem;
phetioType?: IOType;
};

// Maps tuples/arrays from T => IReadOnlyProperty<T>
Expand Down
2 changes: 1 addition & 1 deletion js/DynamicProperty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ type SelfOptions<ThisValueType, InnerValueType, OuterValueType> = {
// If valuePropertyProperty.value === null, this dynamicProperty will act instead like
// derive( valuePropertyProperty.value ) === new Property( defaultValue ). Note that if a custom map function is
// provided, it will be applied to this defaultValue to determine our Property's value.
defaultValue?: InnerValueType,
defaultValue?: InnerValueType;

// Maps a non-null valuePropertyProperty.value into the Property to be used. See top-level documentation for usage.
// If it's a string, it will grab that named property out (e.g. it's like passing u => u[ derive ])
Expand Down
2 changes: 1 addition & 1 deletion js/EmitterTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ QUnit.test( 'Emitter Basics', assert => {
} );

QUnit.test( 'Emitter Tricks', assert => {
const entries: Array<{ listener: string, arg: string }> = [];
const entries: Array<{ listener: string; arg: string }> = [];

const emitter = new Emitter<[ string ]>( {
parameters: [ { valueType: 'string' } ]
Expand Down
2 changes: 1 addition & 1 deletion js/EnumerationProperty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ type SelfOptions<T extends EnumerationValue> = {

// By default, this will be taken from the initial value, but if subtyping enumerations, you must provide this
// manually to make sure it is set to the correct, subtype value, see https://github.com/phetsims/phet-core/issues/102
enumeration?: Enumeration<T>
enumeration?: Enumeration<T>;
};

export type EnumerationPropertyOptions<T extends EnumerationValue> = SelfOptions<T> & Omit<PropertyOptions<T>, 'phetioType'>;
Expand Down
6 changes: 3 additions & 3 deletions js/Property.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ let globalId = 0; // autoincremented for unique IDs
type PropertyDefinedOptions = {
tandem: Tandem;
useDeepEquality: boolean;
units: string | null,
reentrant: boolean
units: string | null;
reentrant: boolean;
};

// Options used in the contstructor
Expand All @@ -51,7 +51,7 @@ export type PropertyOptions<T> = Partial<PropertyDefinedOptions> & {
validValues?: readonly T[];
valueType?: any;
arrayElementType?: any;
isValidValue?: any
isValidValue?: any;
} & PhetioObjectOptions;

// a Property (can't be a TinyProperty) with all of the value-mutation removed.
Expand Down
4 changes: 2 additions & 2 deletions js/TinyEmitter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import axon from './axon.js';
const shuffleListeners = _.hasIn( window, 'phet.chipper.queryParameters' ) && phet.chipper.queryParameters.shuffleListeners;

type EmitContext = {
index: number,
listenerArray?: Function[]
index: number;
listenerArray?: Function[];
};
type Listener<T extends any[]> = ( ...args: T ) => void;

Expand Down
4 changes: 2 additions & 2 deletions js/TinyForwardingProperty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import IProperty from './IProperty.js';
import { PropertyLazyLinkListener } from './IReadOnlyProperty.js';

type NodeLike = {
updateLinkedElementForProperty: <T>( tandemName: string, oldProperty?: IProperty<T> | null, newProperty?: IProperty<T> | null ) => void,
isPhetioInstrumented: () => boolean
updateLinkedElementForProperty: <T>( tandemName: string, oldProperty?: IProperty<T> | null, newProperty?: IProperty<T> | null ) => void;
isPhetioInstrumented: () => boolean;
};

export default class TinyForwardingProperty<T> extends TinyProperty<T> {
Expand Down
2 changes: 1 addition & 1 deletion js/TinyProperty.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import IProperty from './IProperty.js';
import { PropertyLinkListener, PropertyLazyLinkListener, PropertyListener } from './IReadOnlyProperty.js';

type ComparableObject = {
equals: ( a: any ) => boolean
equals: ( a: any ) => boolean;
};
export type TinyPropertyEmitterParameters<T> = [ T, T | null, IProperty<T> ];
export type TinyPropertyOnBeforeNotify<T> = ( ...args: TinyPropertyEmitterParameters<T> ) => void;
Expand Down
2 changes: 1 addition & 1 deletion js/createObservableArray.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type ObservableArray<T> = {
removeAll: ( elements: T[] ) => void;
clear: () => void;
count: ( predicate: Predicate<T> ) => number;
find: ( predicate: Predicate<T>, fromIndex?: number ) => T | undefined,
find: ( predicate: Predicate<T>, fromIndex?: number ) => T | undefined;
shuffle: ( random: FakeRandom<T> ) => void;
getArrayCopy: () => T[];
dispose: () => void;
Expand Down

0 comments on commit c3fd20c

Please sign in to comment.