Skip to content

Commit 7d83f91

Browse files
authored
Upgrade to prettier@latest (#1138)
Running latest version of prettier
1 parent bef98a4 commit 7d83f91

81 files changed

Lines changed: 2299 additions & 1990 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintrc

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
{
2-
"extends": [
3-
"plugin:react/recommended",
4-
"prettier",
5-
"prettier/react"
6-
],
2+
"extends": ["plugin:react/recommended", "prettier", "prettier/react"],
73
"env": {
84
"browser": true,
95
"es6": true
@@ -12,6 +8,7 @@
128
"rules": {
139
"react/display-name": 0,
1410
"react/prop-types": 1,
15-
"react/no-find-dom-node": 1
11+
"react/no-find-dom-node": 1,
12+
"react/no-string-refs": 1
1613
}
17-
}
14+
}

package.json

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,9 @@
5050
"dotenv": "^4.0.0",
5151
"enzyme": "^3.1.0",
5252
"enzyme-adapter-react-16": "^1.0.1",
53-
"eslint": "^3.19.0",
54-
"eslint-config-prettier": "^1.7.0",
55-
"eslint-plugin-react": "^6.10.3",
53+
"eslint": "^4.8.0",
54+
"eslint-config-prettier": "^2.6.0",
55+
"eslint-plugin-react": "^7.4.0",
5656
"expect.js": "^0.3.1",
5757
"flat": "^2.0.1",
5858
"grunt": "^0.4.5",
@@ -63,13 +63,13 @@
6363
"grunt-env": "^0.4.4",
6464
"grunt-exec": "^0.4.6",
6565
"grunt-webpack": "^2.0.1",
66-
"husky": "^0.13.3",
66+
"husky": "^0.14.3",
6767
"jest": "^21.2.1",
6868
"json-beautify": "^1.0.1",
6969
"jsonwebtoken": "^7.3.0",
70-
"lint-staged": "^3.4.0",
70+
"lint-staged": "^4.2.3",
7171
"mochify": "^3.3.0",
72-
"prettier": "^1.2.2",
72+
"prettier": "^1.7.4",
7373
"react-test-renderer": "^16.0.0",
7474
"semver": "^5.3.0",
7575
"sinon": "^1.15.4",
@@ -128,6 +128,7 @@
128128
"coverageReporters": ["lcov", "text-summary"]
129129
},
130130
"lint-staged": {
131-
"*.{js,jsx}": ["npm run lint", "prettier --write --print-width 100 --single-quote", "git add"]
131+
"*.{js,jsx}": ["npm run lint"],
132+
"*.{js,jsx,json,html}": ["prettier --write --print-width 100 --single-quote", "git add"]
132133
}
133134
}

src/__tests__/testUtils.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,12 @@ export const mockComponent = (type, domElement = 'div') => props =>
2525
});
2626

2727
export const extractPropsFromWrapper = (wrapper, index = 0) =>
28-
removeDataFromProps(wrapper.find('div').at(index).props());
28+
removeDataFromProps(
29+
wrapper
30+
.find('div')
31+
.at(index)
32+
.props()
33+
);
2934

3035
//set urls with jest: https://github.com/facebook/jest/issues/890#issuecomment-298594389
3136
export const setURL = url => {

src/connection/database/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ function processDatabaseOptions(opts) {
101101
) {
102102
l.warn(
103103
opts,
104-
`Ignoring an element of \`additionalSignUpFields\` because it does not contain valid \`name\` property. Every element of \`additionalSignUpFields\` must be an object with a \`name\` property that is a non-empty string consisting of letters, numbers and underscores. The following names are reserved, and therefore, cannot be used: ${reservedNames.join(', ')}.`
104+
`Ignoring an element of \`additionalSignUpFields\` because it does not contain valid \`name\` property. Every element of \`additionalSignUpFields\` must be an object with a \`name\` property that is a non-empty string consisting of letters, numbers and underscores. The following names are reserved, and therefore, cannot be used: ${reservedNames.join(
105+
', '
106+
)}.`
105107
);
106108
filter = false;
107109
}
@@ -138,7 +140,9 @@ function processDatabaseOptions(opts) {
138140
if (type != undefined && (typeof type != 'string' || types.indexOf(type) === -1)) {
139141
l.warn(
140142
opts,
141-
`When provided, the \`type\` property of an element of \`additionalSignUpFields\` must be one of the following strings: "${types.join('", "')}".`
143+
`When provided, the \`type\` property of an element of \`additionalSignUpFields\` must be one of the following strings: "${types.join(
144+
'", "'
145+
)}".`
142146
);
143147
type = undefined;
144148
}

src/connection/database/login_pane.jsx

Lines changed: 22 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,27 +31,31 @@ export default class LoginPane extends React.Component {
3131
const header = headerText && <p>{headerText}</p>;
3232

3333
// Should never validate format on login because of custom db connection and import mode
34-
const fieldPane = usernameStyle === 'email'
35-
? <EmailPane
34+
const fieldPane =
35+
usernameStyle === 'email' ? (
36+
<EmailPane
3637
i18n={i18n}
3738
lock={lock}
3839
forceInvalidVisibility={!showPassword}
3940
placeholder={emailInputPlaceholder}
4041
/>
41-
: <UsernamePane
42+
) : (
43+
<UsernamePane
4244
i18n={i18n}
4345
lock={lock}
4446
placeholder={usernameInputPlaceholder}
4547
usernameStyle={usernameStyle}
4648
validateFormat={false}
47-
/>;
49+
/>
50+
);
4851

49-
const passwordPane = showPassword
50-
? <PasswordPane i18n={i18n} lock={lock} placeholder={passwordInputPlaceholder} />
51-
: null;
52+
const passwordPane = showPassword ? (
53+
<PasswordPane i18n={i18n} lock={lock} placeholder={passwordInputPlaceholder} />
54+
) : null;
5255

53-
const dontRememberPassword = showForgotPasswordLink && hasScreen(lock, 'forgotPassword')
54-
? <p className="auth0-lock-alternative">
56+
const dontRememberPassword =
57+
showForgotPasswordLink && hasScreen(lock, 'forgotPassword') ? (
58+
<p className="auth0-lock-alternative">
5559
<a
5660
className="auth0-lock-alternative-link"
5761
href={forgotPasswordLink(lock, 'javascript:void(0)')}
@@ -60,9 +64,16 @@ export default class LoginPane extends React.Component {
6064
{forgotPasswordAction}
6165
</a>
6266
</p>
63-
: null;
67+
) : null;
6468

65-
return <div>{header}{fieldPane}{passwordPane}{dontRememberPassword}</div>;
69+
return (
70+
<div>
71+
{header}
72+
{fieldPane}
73+
{passwordPane}
74+
{dontRememberPassword}
75+
</div>
76+
);
6677
}
6778
}
6879

src/connection/database/mfa_pane.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,13 @@ export default class MFAPane extends React.Component {
1313

1414
const titleElement = title && <h2>{title}</h2>;
1515

16-
return <div>{titleElement}{header}{pane}</div>;
16+
return (
17+
<div>
18+
{titleElement}
19+
{header}
20+
{pane}
21+
</div>
22+
);
1723
}
1824
}
1925

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
import React from 'react';
22

33
const SignUpTerms = ({ checkHandler, checked, children }) => {
4-
return checkHandler
5-
? <span className="auth0-lock-sign-up-terms-agreement">
6-
<label>
7-
<input type="checkbox" onChange={checkHandler} checked={checked} />
8-
{children}
9-
</label>
10-
</span>
11-
: children;
4+
return checkHandler ? (
5+
<span className="auth0-lock-sign-up-terms-agreement">
6+
<label>
7+
<input type="checkbox" onChange={checkHandler} checked={checked} />
8+
{children}
9+
</label>
10+
</span>
11+
) : (
12+
children
13+
);
1214
};
1315

1416
export default SignUpTerms;

src/connection/passwordless/email_sent_confirmation.jsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,21 +27,24 @@ class Resend extends React.Component {
2727
render() {
2828
const { labels, lock } = this.props;
2929

30-
const resendLink =
31-
m.resendAvailable(lock) &&
30+
const resendLink = m.resendAvailable(lock) && (
3231
<ResendLink
3332
onClick={::this.handleClick}
3433
label={m.resendFailed(lock) ? labels.retry : labels.resend}
35-
/>;
34+
/>
35+
);
3636

37-
const resendingLabel =
38-
m.resendOngoing(lock) && <a className="auth0-lock-resend-link">{labels.resending}</a>;
37+
const resendingLabel = m.resendOngoing(lock) && (
38+
<a className="auth0-lock-resend-link">{labels.resending}</a>
39+
);
3940

40-
const resendSuccessLabel =
41-
m.resendSuccess(lock) && <span className="auth0-lock-sent-label">{labels.sent}</span>;
41+
const resendSuccessLabel = m.resendSuccess(lock) && (
42+
<span className="auth0-lock-sent-label">{labels.sent}</span>
43+
);
4244

43-
const resendFailedLabel =
44-
m.resendFailed(lock) && <span className="auth0-lock-sent-failed-label">{labels.failed}</span>;
45+
const resendFailedLabel = m.resendFailed(lock) && (
46+
<span className="auth0-lock-sent-failed-label">{labels.failed}</span>
47+
);
4548

4649
return (
4750
<span>

src/connection/social/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const STRATEGIES = {
2525
linkedin: 'LinkedIn',
2626
miicard: 'miiCard',
2727
paypal: 'PayPal',
28-
"paypal-sandbox": "PayPal Sandbox",
28+
'paypal-sandbox': 'PayPal Sandbox',
2929
planningcenter: 'Planning Center',
3030
renren: '人人',
3131
salesforce: 'Salesforce',

src/core/client/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,8 @@ function formatClientConnection(connectionType, strategyName, connection) {
119119
result.passwordPolicy = connection.passwordPolicy || 'none';
120120
result.allowSignup = typeof connection.showSignup === 'boolean' ? connection.showSignup : true;
121121
result.allowForgot = typeof connection.showForgot === 'boolean' ? connection.showForgot : true;
122-
result.requireUsername = typeof connection.requires_username === 'boolean'
123-
? connection.requires_username
124-
: false;
122+
result.requireUsername =
123+
typeof connection.requires_username === 'boolean' ? connection.requires_username : false;
125124
result.validation = formatConnectionValidation(connection.validation);
126125
}
127126

0 commit comments

Comments
 (0)