Skip to content

Commit 58c9d25

Browse files
Update prettier and format (#240)
1 parent 05327b3 commit 58c9d25

File tree

16 files changed

+73
-83
lines changed

16 files changed

+73
-83
lines changed

examples/webpack-react/src/vars.css.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ export const vars = createGlobalTheme(':root', {
5858
full: '99999px',
5959
},
6060
fontFamily: {
61-
body:
62-
'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
61+
body: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',
6362
},
6463
fontSize: {
6564
'0x': fontSizeScale(0),

fixtures/sprinkles/src/styles.css.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,5 @@ const responsiveStyles = createAtomicStyles({
3434
export const atoms = createAtomsFn(responsiveStyles);
3535

3636
export const mapResponsiveValue = createMapValueFn(responsiveStyles);
37-
export const normalizeResponsiveValue = createNormalizeValueFn(
38-
responsiveStyles,
39-
);
37+
export const normalizeResponsiveValue =
38+
createNormalizeValueFn(responsiveStyles);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"babel-jest": "^26.6.3",
5353
"jest": "^26.6.3",
5454
"jest-puppeteer": "^4.4.0",
55-
"prettier": "^2.2.1",
55+
"prettier": "^2.3.2",
5656
"puppeteer": "^8.0.0",
5757
"ts-node": "^9.1.1",
5858
"typescript": "^4.1.3"

packages/babel-plugin/src/index.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ const getRelevantCall = (
114114
t.isIdentifier(callee.property, { name: exportName }),
115115
);
116116
} else {
117-
const importInfo = Array.from(
118-
importIdentifiers.entries(),
119-
).find(([identifier]) => t.isIdentifier(callee, { name: identifier }));
117+
const importInfo = Array.from(importIdentifiers.entries()).find(
118+
([identifier]) => t.isIdentifier(callee, { name: identifier }),
119+
);
120120

121121
if (importInfo) {
122122
return importInfo[1];
@@ -201,9 +201,9 @@ export default function (): PluginObj<Context> {
201201
} else if (t.isImportSpecifier(specifier)) {
202202
const { imported, local } = specifier;
203203

204-
const importName = (t.isIdentifier(imported)
205-
? imported.name
206-
: imported.value) as StyleFunction;
204+
const importName = (
205+
t.isIdentifier(imported) ? imported.name : imported.value
206+
) as StyleFunction;
207207

208208
if (styleFunctions.includes(importName)) {
209209
this.importIdentifiers.set(local.name, importName);

packages/css/src/style.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export function globalKeyframes(name: string, rule: CSSKeyframes) {
6969
}
7070

7171
export function styleVariants<
72-
StyleMap extends Record<string | number, StyleRule>
72+
StyleMap extends Record<string | number, StyleRule>,
7373
>(styleMap: StyleMap, debugId?: string): Record<keyof StyleMap, string>;
7474
export function styleVariants<Data extends Record<string | number, unknown>>(
7575
data: Data,

packages/css/src/transformCss.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,8 @@ class Stylesheet {
130130
this.transformSimplePseudos(root, root.rule);
131131
this.transformSelectors(root, root.rule);
132132

133-
const activeConditionalRuleset = this.conditionalRulesets[
134-
this.conditionalRulesets.length - 1
135-
];
133+
const activeConditionalRuleset =
134+
this.conditionalRulesets[this.conditionalRulesets.length - 1];
136135

137136
if (
138137
!activeConditionalRuleset.mergeIfCompatible(this.currConditionalRuleset)

packages/sprinkles/src/createAtomsFn.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ import {
1010

1111
type ResponsiveArrayVariant<
1212
RA extends { length: number },
13-
Values extends string | number | symbol
13+
Values extends string | number | symbol,
1414
> = ResponsiveArrayByMaxLength<RA['length'], Values | null>;
1515

1616
type ConditionalStyle<
17-
Values extends { [key: string]: ConditionalPropertyValue }
17+
Values extends { [key: string]: ConditionalPropertyValue },
1818
> =
1919
| (Values[keyof Values]['defaultClass'] extends string ? keyof Values : never)
2020
| {
@@ -23,7 +23,7 @@ type ConditionalStyle<
2323

2424
type ConditionalStyleWithResponsiveArray<
2525
Values extends { [key: string]: ConditionalPropertyValue },
26-
RA extends { length: number }
26+
RA extends { length: number },
2727
> = ConditionalStyle<Values> | ResponsiveArrayVariant<RA, keyof Values>;
2828

2929
type ChildAtomProps<Atoms extends AtomicStyles['styles']> = {

packages/sprinkles/src/createUtils.ts

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ type ExtractValue<
99
| string
1010
| number
1111
| Partial<Record<string, string | number>>
12-
| ResponsiveArrayByMaxLength<number, string | number | null>
12+
| ResponsiveArrayByMaxLength<number, string | number | null>,
1313
> = Value extends ResponsiveArrayByMaxLength<number, string | number | null>
1414
? NonNullable<Value[number]>
1515
: Value extends Partial<Record<string, string | number>>
@@ -24,17 +24,15 @@ type Conditions<ConditionName extends string> = {
2424
};
2525
};
2626

27-
type ExtractDefaultCondition<
28-
AtomicStyles extends Conditions<string>
29-
> = AtomicStyles['conditions']['defaultCondition'];
27+
type ExtractDefaultCondition<AtomicStyles extends Conditions<string>> =
28+
AtomicStyles['conditions']['defaultCondition'];
3029

31-
type ExtractConditionNames<
32-
AtomicStyles extends Conditions<string>
33-
> = AtomicStyles['conditions']['conditionNames'][number];
30+
type ExtractConditionNames<AtomicStyles extends Conditions<string>> =
31+
AtomicStyles['conditions']['conditionNames'][number];
3432

3533
export type ConditionalValue<
3634
AtomicStyles extends Conditions<string>,
37-
Value extends string | number
35+
Value extends string | number,
3836
> =
3937
| (ExtractDefaultCondition<AtomicStyles> extends false ? never : Value)
4038
| Partial<Record<ExtractConditionNames<AtomicStyles>, Value>>
@@ -48,13 +46,13 @@ export type ConditionalValue<
4846
type RequiredConditionalObject<
4947
RequiredConditionName extends string,
5048
OptionalConditionNames extends string,
51-
Value extends string | number
49+
Value extends string | number,
5250
> = Record<RequiredConditionName, Value> &
5351
Partial<Record<OptionalConditionNames, Value>>;
5452

5553
export type RequiredConditionalValue<
5654
AtomicStyles extends Conditions<string>,
57-
Value extends string | number
55+
Value extends string | number,
5856
> = ExtractDefaultCondition<AtomicStyles> extends false
5957
? never
6058
:
@@ -126,7 +124,7 @@ export function createMapValueFn<AtomicStyles extends Conditions<string>>(
126124
atomicStyles: AtomicStyles,
127125
): <
128126
OutputValue extends string | number,
129-
Value extends ConditionalValue<AtomicStyles, string | number>
127+
Value extends ConditionalValue<AtomicStyles, string | number>,
130128
>(
131129
value: Value,
132130
fn: (

packages/sprinkles/src/index.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type AtomicProperties = {
2626

2727
type ShorthandOptions<
2828
Properties extends AtomicProperties,
29-
Shorthands extends { [shorthandName: string]: Array<keyof Properties> }
29+
Shorthands extends { [shorthandName: string]: Array<keyof Properties> },
3030
> = {
3131
shorthands: Shorthands;
3232
};
@@ -37,7 +37,7 @@ type UnconditionalAtomicOptions<Properties extends AtomicProperties> = {
3737

3838
type ResponsiveArrayOptions<
3939
Conditions extends { [conditionName: string]: Condition },
40-
ResponsiveLength extends number
40+
ResponsiveLength extends number,
4141
> = {
4242
responsiveArray: ResponsiveArrayConfig<keyof Conditions> & {
4343
length: ResponsiveLength;
@@ -47,7 +47,7 @@ type ResponsiveArrayOptions<
4747
type ConditionalAtomicOptions<
4848
Properties extends AtomicProperties,
4949
Conditions extends { [conditionName: string]: Condition },
50-
DefaultCondition extends keyof Conditions | false
50+
DefaultCondition extends keyof Conditions | false,
5151
> = UnconditionalAtomicOptions<Properties> & {
5252
conditions: Conditions;
5353
defaultCondition: DefaultCondition;
@@ -73,7 +73,7 @@ type UnconditionalAtomicStyles<Properties extends AtomicProperties> = {
7373
type ConditionalAtomicStyles<
7474
Properties extends AtomicProperties,
7575
Conditions extends { [conditionName: string]: Condition },
76-
DefaultCondition extends keyof Conditions | false
76+
DefaultCondition extends keyof Conditions | false,
7777
> = {
7878
conditions: {
7979
defaultCondition: DefaultCondition;
@@ -98,7 +98,7 @@ type ConditionalWithResponsiveArrayAtomicStyles<
9898
Properties extends AtomicProperties,
9999
Conditions extends { [conditionName: string]: Condition },
100100
ResponsiveLength extends number,
101-
DefaultCondition extends keyof Conditions | false
101+
DefaultCondition extends keyof Conditions | false,
102102
> = {
103103
conditions: {
104104
defaultCondition: DefaultCondition;
@@ -124,7 +124,7 @@ type ConditionalWithResponsiveArrayAtomicStyles<
124124
type ShorthandAtomicStyles<
125125
Shorthands extends {
126126
[shorthandName: string]: Array<string | number | symbol>;
127-
}
127+
},
128128
> = {
129129
styles: {
130130
[Shorthand in keyof Shorthands]: {
@@ -139,7 +139,7 @@ export function createAtomicStyles<
139139
ResponsiveLength extends number,
140140
Conditions extends BaseConditions,
141141
Shorthands extends { [shorthandName: string]: Array<keyof Properties> },
142-
DefaultCondition extends keyof Conditions | false
142+
DefaultCondition extends keyof Conditions | false,
143143
>(
144144
options: ConditionalAtomicOptions<Properties, Conditions, DefaultCondition> &
145145
ShorthandOptions<Properties, Shorthands> &
@@ -156,7 +156,7 @@ export function createAtomicStyles<
156156
Properties extends AtomicProperties,
157157
Conditions extends BaseConditions,
158158
Shorthands extends { [shorthandName: string]: Array<keyof Properties> },
159-
DefaultCondition extends keyof Conditions | false
159+
DefaultCondition extends keyof Conditions | false,
160160
>(
161161
options: ConditionalAtomicOptions<Properties, Conditions, DefaultCondition> &
162162
ShorthandOptions<Properties, Shorthands>,
@@ -167,7 +167,7 @@ export function createAtomicStyles<
167167
Properties extends AtomicProperties,
168168
Conditions extends BaseConditions,
169169
ResponsiveLength extends number,
170-
DefaultCondition extends keyof Conditions | false
170+
DefaultCondition extends keyof Conditions | false,
171171
>(
172172
options: ConditionalAtomicOptions<Properties, Conditions, DefaultCondition> &
173173
ResponsiveArrayOptions<Conditions, ResponsiveLength>,
@@ -181,14 +181,14 @@ export function createAtomicStyles<
181181
export function createAtomicStyles<
182182
Properties extends AtomicProperties,
183183
Conditions extends BaseConditions,
184-
DefaultCondition extends keyof Conditions | false
184+
DefaultCondition extends keyof Conditions | false,
185185
>(
186186
options: ConditionalAtomicOptions<Properties, Conditions, DefaultCondition>,
187187
): ConditionalAtomicStyles<Properties, Conditions, DefaultCondition>;
188188
// Unconditional + Shorthands
189189
export function createAtomicStyles<
190190
Properties extends AtomicProperties,
191-
Shorthands extends { [shorthandName: string]: Array<keyof Properties> }
191+
Shorthands extends { [shorthandName: string]: Array<keyof Properties> },
192192
>(
193193
options: UnconditionalAtomicOptions<Properties> &
194194
ShorthandOptions<Properties, Shorthands>,

packages/sprinkles/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export type ResponsiveArrayByMaxLength<MaxLength extends number, Value> = [
2929

3030
export type RequiredResponsiveArrayByMaxLength<
3131
MaxLength extends number,
32-
Value
32+
Value,
3333
> = [
3434
never,
3535
RequiredResponsiveArray<1, Value | null>,

0 commit comments

Comments
 (0)