Skip to content

Commit

Permalink
style: upgrade prettier and reformat
Browse files Browse the repository at this point in the history
  • Loading branch information
sergeysova committed May 10, 2021
1 parent 1b5452b commit 4739ea5
Show file tree
Hide file tree
Showing 11 changed files with 803 additions and 1,097 deletions.
2 changes: 1 addition & 1 deletion combine-events/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export function combineEvents<P extends Shape>(config: {

export function combineEvents<
P extends Shape,
T extends Unit<P extends Tuple ? P : Partial<P>>
T extends Unit<P extends Tuple ? P : Partial<P>>,
>(config: {
events: Events<P>;
target: T;
Expand Down
1,799 changes: 751 additions & 1,048 deletions integration/custom/yarn.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
"husky": "3.1.0",
"jest": "^26.4.2",
"lint-staged": "^9.5.0",
"prettier": "^1.19.1",
"prettier": "^2.3.0",
"rollup": "^2.32.1",
"rollup-plugin-terser": "^7.0.2",
"tsd": "^0.13.1",
Expand Down
5 changes: 1 addition & 4 deletions pending/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,7 @@ function pending({ effects: rawEffects, domain, of = 'some' }) {
}

return combine({
ɔ: [
effects.map((fx) => fx.pending),
strategy,
],
ɔ: [effects.map((fx) => fx.pending), strategy],
config: {
sid: 'pending',
named: 'pending',
Expand Down
2 changes: 1 addition & 1 deletion split-map/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Unit, Event } from 'effector';

export function splitMap<
S,
Cases extends Record<string, (payload: S) => any | undefined>
Cases extends Record<string, (payload: S) => any | undefined>,
>(_: {
source: Unit<S>;
cases: Cases;
Expand Down
11 changes: 6 additions & 5 deletions split-map/split-map.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,12 @@ test('default case from event', () => {
});

test('fall through from event', () => {
const source = createEvent<{
first?: string;
second?: boolean;
default?: number;
}>();
const source =
createEvent<{
first?: string;
second?: boolean;
default?: number;
}>();
const out = splitMap({
source,
cases: {
Expand Down
2 changes: 1 addition & 1 deletion spread/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export function spread<Payload>(config: {

export function spread<
Source,
Payload extends Source extends Unit<infer S> ? S : never
Payload extends Source extends Unit<infer S> ? S : never,
>(config: {
source: Source;
targets: {
Expand Down
18 changes: 10 additions & 8 deletions spread/spread.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -248,10 +248,11 @@ describe('edge', () => {
});

test('nested targets', () => {
const source = createEvent<{
first: string;
second: { foo: number; bar: boolean };
}>();
const source =
createEvent<{
first: string;
second: { foo: number; bar: boolean };
}>();
const targetA = createEvent<string>();
const targetB = createEvent<number>();
const targetC = createEvent<boolean>();
Expand Down Expand Up @@ -341,10 +342,11 @@ describe('invalid', () => {
});

test('null/undefined in source', () => {
const source = createEvent<null | void | {
first: number;
second: boolean;
}>();
const source =
createEvent<null | void | {
first: number;
second: boolean;
}>();
const targetA = createEvent<number>();
const targetB = createEvent<boolean>();

Expand Down
37 changes: 20 additions & 17 deletions test-typings/combine-events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,12 @@ import { combineEvents } from '../combine-events';
const bar = createEvent<number>();
const baz = createEvent<boolean>();

const target = createEvent<{
foo: string;
bar: number;
baz: boolean;
}>();
const target =
createEvent<{
foo: string;
bar: number;
baz: boolean;
}>();

combineEvents({
events: { foo, bar, baz },
Expand All @@ -128,12 +129,13 @@ import { combineEvents } from '../combine-events';
const baz = createEvent<boolean>();
const bai = createEvent<{ foo: string }>();

const target = createEvent<{
foo: string;
bar: number;
baz: boolean;
bai: { foo: string };
}>();
const target =
createEvent<{
foo: string;
bar: number;
baz: boolean;
bai: { foo: string };
}>();

combineEvents({
events: { foo, bar, baz, bai },
Expand All @@ -154,12 +156,13 @@ import { combineEvents } from '../combine-events';
// @ts-expect-error
combineEvents({
events: { foo, bar, baz, bai },
target: createEvent<{
foo: string;
bar: number;
baz: number;
bai: { demo: string };
}>(),
target:
createEvent<{
foo: string;
bar: number;
baz: number;
bai: { demo: string };
}>(),
});
}

Expand Down
12 changes: 6 additions & 6 deletions test-typings/condition.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { expectType } from 'tsd';
import {
Store,
Event,
Effect,
createStore,
createEvent,
createEffect,
combine,
createEffect,
createEvent,
createStore,
Effect,
Event,
Store,
} from 'effector';
import { condition } from '../condition';

Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5988,16 +5988,16 @@ prettier-linter-helpers@^1.0.0:
dependencies:
fast-diff "^1.1.2"

prettier@^1.19.1:
version "1.19.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb"
integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew==

prettier@^2.0.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==

prettier@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18"
integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==

pretty-format@^26.0.0, pretty-format@^26.6.2:
version "26.6.2"
resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-26.6.2.tgz#e35c2705f14cb7fe2fe94fa078345b444120fc93"
Expand Down

0 comments on commit 4739ea5

Please sign in to comment.