Skip to content

Commit 6724f75

Browse files
SaraVieiraCompuIves
authored andcommitted
add arrowParens to prettier config (codesandbox#1700)
* add arrowParens to prettier config * add to modal too * fix bind * re add overflow
1 parent 1e3cc64 commit 6724f75

File tree

4 files changed

+25
-2
lines changed
  • packages
    • app/src/app
    • common/src/templates/configuration/prettierRC

4 files changed

+25
-2
lines changed

packages/app/src/app/components/CodeEditor/Configuration/elements.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ export const Container = styled.div`
44
padding: 1rem;
55
color: rgba(255, 255, 255, 0.8);
66
box-sizing: border-box;
7-
87
overflow: auto;
8+
max-height: 100%;
99
`;
1010

1111
export const Title = styled.h1`

packages/app/src/app/components/CodeEditor/VSCode/Configuration/elements.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ export const Container = styled.div`
44
padding: 1rem;
55
color: rgba(255, 255, 255, 0.8);
66
box-sizing: border-box;
7-
7+
max-height: 100%;
88
overflow: auto;
99
`;
1010

packages/app/src/app/pages/common/Modals/PreferencesModal/CodeFormatting/Prettier/index.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,16 @@ function Prettier({ store, signals }) {
130130
Put the `{'>'}` of a multi-line JSX element at the end of the last
131131
line instead of being alone on the next line.
132132
</SubDescription>
133+
<Rule />
134+
<PaddedPreference
135+
title="Arrow Function Parentheses"
136+
type="dropdown"
137+
options={['avoid', 'always']}
138+
{...bindValue('arrowParens')}
139+
/>
140+
<SubDescription>
141+
Include parentheses around a sole arrow function parameter.
142+
</SubDescription>
133143
</PreferenceContainer>
134144
</SubContainer>
135145
);

packages/common/src/templates/configuration/prettierRC/ui.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,19 @@ export class ConfigWizard extends React.Component<ConfigurationUIProps> {
152152
line instead of being alone on the next line.
153153
</ConfigDescription>
154154
</PaddedConfig>
155+
<PaddedConfig>
156+
<ConfigItem>
157+
<PaddedPreference
158+
title="Arrow Function Parentheses"
159+
type="dropdown"
160+
options={['avoid', 'always']}
161+
{...this.bindValue(parsedFile, 'arrowParens')}
162+
/>
163+
</ConfigItem>
164+
<ConfigDescription>
165+
Include parentheses around a sole arrow function parameter.
166+
</ConfigDescription>
167+
</PaddedConfig>
155168
</div>
156169
);
157170
}

0 commit comments

Comments
 (0)