Skip to content

Commit f99bb5c

Browse files
berezhKohelbekker
authored andcommitted
fix prettier (#363)
* fix prettier * merge with master
1 parent 3cf517c commit f99bb5c

File tree

9 files changed

+1660
-3353
lines changed

9 files changed

+1660
-3353
lines changed

.prettierrc

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"jsxBracketSameLine": true,
3+
"singleQuote": true,
4+
"overrides": [
5+
{
6+
"files": ["**/*.css", "**/*.scss", "**/*.pcss", "**/*.html"],
7+
"options": {
8+
"singleQuote": false,
9+
"tabWidth": 4
10+
}
11+
}
12+
],
13+
"jsxSingleQuote": false,
14+
"printWidth": 120,
15+
"tabWidth": 4,
16+
"endOfLine": "auto",
17+
"semi": true,
18+
"tslintIntegration": true,
19+
"stylelintIntegration": true,
20+
"ignorePath": ".gitignore"
21+
}

package.json

+3-11
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@
119119
"postcss-hexrgba": "^1.0.1",
120120
"postcss-import": "^12.0.0",
121121
"postcss-nested": "^3.0.0",
122+
"prettier": "1.9.0",
122123
"ramda": "^0.26.1",
123124
"react-app-rewired": "^2.1.5",
124125
"react-hot-loader": "^4.3.4",
@@ -128,7 +129,8 @@
128129
"source-map-explorer": "^1.7.0",
129130
"ts-jest": "^23.1.3",
130131
"ts-node": "^7.0.1",
131-
"typescript": "3.4.5",
132+
"tslint-plugin-prettier": "^2.3.0",
133+
"typescript": "3.8.2",
132134
"webpack": "4.42.0",
133135
"webpack-obfuscator": "^2.3.0"
134136
},
@@ -138,16 +140,6 @@
138140
"pre-push": "yarn lint && CI=true yarn test --no-watch"
139141
}
140142
},
141-
"prettier": {
142-
"trailingComma": "es6",
143-
"tabWidth": 4,
144-
"printWidth": 130,
145-
"semi": true,
146-
"singleQuote": true,
147-
"tslintIntegration": true,
148-
"stylelintIntegration": true,
149-
"ignorePath": ".gitignore"
150-
},
151143
"browserslist": [
152144
">0.2%",
153145
"not ie <= 11",

src/components/EmailForm/index.tsx

+17-21
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import cr from 'classnames';
2-
import * as React from 'react';
2+
import React, { FormEvent } from 'react';
33
import { Button } from 'react-bootstrap';
44
import { useSelector } from 'react-redux';
55
import { CustomInput } from '../';
@@ -79,7 +79,7 @@ const EmailForm = React.memo((props: EmailFormProps) => {
7979
return false;
8080
};
8181

82-
const handleClick = (label?: string, e?: React.FormEvent<HTMLInputElement>) => {
82+
const handleClick = (e: FormEvent<HTMLInputElement>) => {
8383
if (e) {
8484
e.preventDefault();
8585
}
@@ -101,21 +101,20 @@ const EmailForm = React.memo((props: EmailFormProps) => {
101101
return (
102102
<form>
103103
<div className={emailFormClass}>
104-
{!isMobileDevice && <div className="cr-email-form__options-group">
105-
<div className="cr-email-form__option">
106-
<div className="cr-email-form__option-inner">
107-
{title || 'Forgot password'}
108-
<div className="cr-email-form__cros-icon" onClick={handleCancel}>
109-
<CloseIcon className="close-icon"/>
110-
</div>
104+
{!isMobileDevice && (
105+
<div className="cr-email-form__options-group">
106+
<div className="cr-email-form__option">
107+
<div className="cr-email-form__option-inner">
108+
{title || 'Forgot password'}
109+
<div className="cr-email-form__cros-icon" onClick={handleCancel}>
110+
<CloseIcon className="close-icon" />
111+
</div>
112+
</div>
113+
</div>
111114
</div>
112-
</div>
113-
</div>
114-
}
115+
)}
115116
<div className="cr-email-form__form-content">
116-
<div className="cr-email-form__header">
117-
{message}
118-
</div>
117+
<div className="cr-email-form__header">{message}</div>
119118
<div className={emailGroupClass}>
120119
<CustomInput
121120
type="email"
@@ -137,10 +136,9 @@ const EmailForm = React.memo((props: EmailFormProps) => {
137136
block={true}
138137
type="button"
139138
disabled={isButtonDisabled()}
140-
onClick={e => handleClick(undefined, e)}
139+
onClick={(e) => handleClick(e as any)}
141140
size="lg"
142-
variant="primary"
143-
>
141+
variant="primary">
144142
{isLoading ? 'Loading...' : buttonLabel ? buttonLabel : 'Send'}
145143
</Button>
146144
</div>
@@ -150,6 +148,4 @@ const EmailForm = React.memo((props: EmailFormProps) => {
150148
);
151149
});
152150

153-
export {
154-
EmailForm,
155-
};
151+
export { EmailForm };

src/components/SignUp/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export const SignUpForm = (props: SignUpFormProps) => {
158158
(confirmPassword && isConfirmPasswordValid);
159159
};
160160

161-
const handleClick = (label?: string, e?: React.FormEvent<HTMLInputElement>) => {
161+
const handleClick = (e?: React.FormEvent<HTMLInputElement>) => {
162162
if (e) {
163163
e.preventDefault();
164164
}
@@ -285,7 +285,7 @@ export const SignUpForm = (props: SignUpFormProps) => {
285285
block={true}
286286
type="button"
287287
disabled={disableButton()}
288-
onClick={e => handleClick(undefined, e)}
288+
onClick={e => handleClick(e as any)}
289289
size="lg"
290290
variant="primary"
291291
>

src/components/Tooltip/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ interface Props {
88
className?: string;
99
}
1010

11-
export const Tooltip = (props: Props) => (
12-
<BootstrapTooltip id="tooltip" className="tooltip" {...props}>
11+
export const Tooltip = ({ id = 'tooltip', ...rest }: Props) => (
12+
<BootstrapTooltip id={`${id}`} className="tooltip" {...rest}>
1313
<div className="tooltip__content">
14-
<FormattedMessage id={props.title} />
14+
<FormattedMessage id={rest.title} />
1515
</div>
1616
</BootstrapTooltip>
1717
);

src/screens/ProfileTwoFactorAuthScreen/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ class ToggleTwoFactorAuthComponent extends React.Component<Props, State> {
225225
};
226226

227227
private get2faAction = () => {
228-
const routingState = this.props.history.location.state;
228+
const routingState = this.props.history.location.state as any;
229229

230230
return routingState ? routingState.enable2fa : false;
231231
};

tsconfig.prod.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"forceConsistentCasingInFileNames": true,
1010
"suppressImplicitAnyIndexErrors": false,
1111
"noUnusedLocals": true,
12-
"allowSyntheticDefaultImports": false,
12+
"allowSyntheticDefaultImports": true,
1313
"experimentalDecorators": true,
1414
"types": [
1515
"node",

tslint.json

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
{
2+
"extends": ["tslint-plugin-prettier"],
23
"linterOptions": {
34
"exclude": [
45
"config/**/*.js",
@@ -167,10 +168,7 @@
167168
"use-isnan": true,
168169
"deprecation": true,
169170
"eofline": true,
170-
"linebreak-style": [
171-
true,
172-
"LF"
173-
],
171+
"linebreak-style": false,
174172
"max-classes-per-file": [
175173
true,
176174
1

0 commit comments

Comments
 (0)