Skip to content

Commit

Permalink
run lint-fix in other packages
Browse files Browse the repository at this point in the history
  • Loading branch information
adidahiya committed Jan 22, 2020
1 parent 481ac5b commit 6d2360b
Show file tree
Hide file tree
Showing 9 changed files with 39 additions and 27 deletions.
4 changes: 1 addition & 3 deletions packages/core/src/common/constructor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@
* Generic interface defining constructor types, such as classes. This is used to type the class
* itself in meta-programming situations such as decorators.
*/
export interface IConstructor<T> {
new (...args: any[]): T;
}
export type IConstructor<T> = new (...args: any[]) => T;
4 changes: 2 additions & 2 deletions packages/core/src/common/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,5 @@ export const DRAWER_VERTICAL_IS_IGNORED = ns + ` <Drawer> vertical is ignored if
export const DRAWER_ANGLE_POSITIONS_ARE_CASTED =
ns + ` <Drawer> all angle positions are casted into pure position (TOP, BOTTOM, LEFT or RIGHT)`;

export const TOASTER_MAX_TOASTS_INVALID = ns + ` <Toaster> maxToasts is set to an invalid number, must be greater than 0`;

export const TOASTER_MAX_TOASTS_INVALID =
ns + ` <Toaster> maxToasts is set to an invalid number, must be greater than 0`;
12 changes: 2 additions & 10 deletions packages/core/src/common/position.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,23 +55,15 @@ export function isPositionVertical(position: Position) {
}

export function getPositionIgnoreAngles(position: Position) {
if (
position === Position.TOP ||
position === Position.TOP_LEFT ||
position === Position.TOP_RIGHT
) {
if (position === Position.TOP || position === Position.TOP_LEFT || position === Position.TOP_RIGHT) {
return Position.TOP;
} else if (
position === Position.BOTTOM ||
position === Position.BOTTOM_LEFT ||
position === Position.BOTTOM_RIGHT
) {
return Position.BOTTOM;
} else if (
position === Position.LEFT ||
position === Position.LEFT_TOP ||
position === Position.LEFT_BOTTOM
) {
} else if (position === Position.LEFT || position === Position.LEFT_TOP || position === Position.LEFT_BOTTOM) {
return Position.LEFT;
} else {
return Position.RIGHT;
Expand Down
5 changes: 4 additions & 1 deletion packages/core/test/common/utils/compareUtilsTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@ describe("CompareUtils", () => {

describe("returns unequal key/values if any specified values are not deeply equal", () => {
runTest(
[{ key: "a", valueA: 2, valueB: 1 }, { key: "b", valueA: [2, 3, 4], valueB: [1, 2, 3] }],
[
{ key: "a", valueA: 2, valueB: 1 },
{ key: "b", valueA: [2, 3, 4], valueB: [1, 2, 3] },
],
{ a: 2, b: [2, 3, 4], c: "3" },
{ b: [1, 2, 3], a: 1, c: "3" },
["a", "b"],
Expand Down
13 changes: 10 additions & 3 deletions packages/core/test/popover/popperUtilTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ import { arrowOffsetModifier, getAlignment, getOppositePosition } from "../../sr

describe("Popper utils", () => {
it("getOppositePosition returns opposite", () => {
[["top", "bottom"], ["left", "right"]].map(([a, b]) => {
[
["top", "bottom"],
["left", "right"],
].map(([a, b]) => {
expect(getOppositePosition(a as Position)).to.equal(b);
expect(getOppositePosition(b as Position)).to.equal(a);
});
Expand All @@ -34,12 +37,16 @@ describe("Popper utils", () => {

describe("arrow offset modifier shifts away from popover", () => {
it("right", () => {
const { offsets: { popper, arrow } } = arrowOffsetModifier(getPopperData("right"), {});
const {
offsets: { popper, arrow },
} = arrowOffsetModifier(getPopperData("right"), {});
expect(popper.left).to.be.greaterThan(arrow.left);
});

it("left", () => {
const { offsets: { popper, arrow } } = arrowOffsetModifier(getPopperData("left"), {});
const {
offsets: { popper, arrow },
} = arrowOffsetModifier(getPopperData("left"), {});
expect(popper.left).to.be.lessThan(arrow.left);
});

Expand Down
5 changes: 4 additions & 1 deletion packages/core/test/toast/toasterTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,10 @@ describe("Toaster", () => {
const key = toaster.show({ message: "two" });
toaster.show({ message: "six" });
toaster.dismiss(key);
assert.deepEqual(toaster.getToasts().map(t => t.message), ["six", "one"]);
assert.deepEqual(
toaster.getToasts().map(t => t.message),
["six", "one"],
);
});

it("clear() removes all toasts", () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/icons/src/iconName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
import * as IconNames from "./generated/iconNames";

/** String literal union type of all Blueprint UI icon names. */
export type IconName = (typeof IconNames)[keyof typeof IconNames];
export type IconName = typeof IconNames[keyof typeof IconNames];
20 changes: 15 additions & 5 deletions packages/landing-app/src/logo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,11 @@ export type ISegment = [Point, Point];
export class Corner extends Transformable<Corner> {
public static CORNER() {
return new Corner(
[[P(), P().translate(-1, 0, 0)], [P(), P().translate(0, 1, 0)], [P(), P().translate(0, 0, -1)]],
[
[P(), P().translate(-1, 0, 0)],
[P(), P().translate(0, 1, 0)],
[P(), P().translate(0, 0, -1)],
],
P(),
);
}
Expand Down Expand Up @@ -520,7 +524,7 @@ export const T = {
return t => callback(t === 0 ? 0 : Math.pow(e, 10 * (t - 1)));
},
EASE_IN_OUT: (callback: IAnimatedCallback): IAnimatedCallback => {
return t => callback((t *= 2) < 1 ? 1 / 2 * t * t * t * t : -1 / 2 * ((t -= 2) * t * t * t - 2));
return t => callback((t *= 2) < 1 ? (1 / 2) * t * t * t * t : (-1 / 2) * ((t -= 2) * t * t * t - 2));
},
EASE_IN_OUT_EXP: (e: number, callback: IAnimatedCallback): IAnimatedCallback => {
return t => {
Expand All @@ -529,9 +533,9 @@ export const T = {
} else if (t === 1) {
callback(1);
} else if ((t *= 2) < 1) {
callback(1 / 2 * Math.pow(e, 10 * (t - 1)));
callback((1 / 2) * Math.pow(e, 10 * (t - 1)));
} else {
callback(1 / 2 * (-Math.pow(e, -10 * --t) + 2));
callback((1 / 2) * (-Math.pow(e, -10 * --t) + 2));
}
};
},
Expand Down Expand Up @@ -1100,7 +1104,13 @@ export function initializeLogo(canvas: HTMLCanvasElement, canvasBackground: HTML
.timeline()
.tween(0, () => model.restore().translate(0, -8, 0))
.tween(offset + 100)
.tween(1000, T.EASE_OUT_EXP(2, T.INTERPOLATE(-8, 0, (t: number) => model.restore().translate(0, t, 0))));
.tween(
1000,
T.EASE_OUT_EXP(
2,
T.INTERPOLATE(-8, 0, (t: number) => model.restore().translate(0, t, 0)),
),
);
};

slideDownAnimation(0, slideInGroups[0]);
Expand Down
1 change: 0 additions & 1 deletion packages/select/test/listItemsPropsTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import { assert } from "chai";
import * as sinon from "sinon";
import { executeItemsEqual } from "../src/common/listItemsProps";


describe("IListItemsProps Utils", () => {
describe("executeItemsEqual", () => {
// interface for a non-primitive item value
Expand Down

0 comments on commit 6d2360b

Please sign in to comment.