chore(deps): update dependency prettier to v2.3.0 (#42074)
* chore(deps): update dependency prettier to v2.3.0 * chore: apply formating per prettier * fix: correctly disable import/no-unresolved Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Mrugesh Mohapatra <hi@mrugesh.dev> Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
@@ -14,15 +14,17 @@ function rendererCreateWithRedux(ui) {
|
||||
|
||||
describe('<Intro />', () => {
|
||||
it('has no blockquotes when loggedOut', () => {
|
||||
const container = rendererCreateWithRedux(<Intro {...loggedOutProps} />)
|
||||
.root;
|
||||
const container = rendererCreateWithRedux(
|
||||
<Intro {...loggedOutProps} />
|
||||
).root;
|
||||
expect(container.findAllByType('blockquote').length === 0).toBeTruthy();
|
||||
expect(container.findAllByType('h1').length === 1).toBeTruthy();
|
||||
});
|
||||
|
||||
it('has a blockquote when loggedIn', () => {
|
||||
const container = rendererCreateWithRedux(<Intro {...loggedInProps} />)
|
||||
.root;
|
||||
const container = rendererCreateWithRedux(
|
||||
<Intro {...loggedInProps} />
|
||||
).root;
|
||||
expect(container.findAllByType('blockquote').length === 1).toBeTruthy();
|
||||
expect(container.findAllByType('h1').length === 1).toBeTruthy();
|
||||
});
|
||||
|
@@ -21,13 +21,8 @@ const propTypes = {
|
||||
};
|
||||
|
||||
const ProjectModal = props => {
|
||||
const {
|
||||
isOpen,
|
||||
projectTitle,
|
||||
files,
|
||||
solution,
|
||||
handleSolutionModalHide
|
||||
} = props;
|
||||
const { isOpen, projectTitle, files, solution, handleSolutionModalHide } =
|
||||
props;
|
||||
const { t } = useTranslation();
|
||||
return (
|
||||
<Modal
|
||||
|
@@ -1,10 +1,12 @@
|
||||
import { navigate } from 'gatsby';
|
||||
|
||||
const createRedirect = (to = '/') => () => {
|
||||
if (typeof window !== 'undefined') {
|
||||
navigate(to);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
const createRedirect =
|
||||
(to = '/') =>
|
||||
() => {
|
||||
if (typeof window !== 'undefined') {
|
||||
navigate(to);
|
||||
}
|
||||
return null;
|
||||
};
|
||||
|
||||
export default createRedirect;
|
||||
|
@@ -2,8 +2,10 @@ import React from 'react';
|
||||
import { Trans } from 'react-i18next';
|
||||
|
||||
// Matches editor links for: Replit, Glitch, CodeSandbox, GitHub
|
||||
const editorRegex = /repl\.?it(\.com)?\/(@|join\/)|glitch\.com\/edit\/#!|codesandbox\.io\/s\/|github\.com/;
|
||||
const fCCRegex = /codepen\.io\/freecodecamp|freecodecamp\.rocks|github\.com\/freecodecamp/i;
|
||||
const editorRegex =
|
||||
/repl\.?it(\.com)?\/(@|join\/)|glitch\.com\/edit\/#!|codesandbox\.io\/s\/|github\.com/;
|
||||
const fCCRegex =
|
||||
/codepen\.io\/freecodecamp|freecodecamp\.rocks|github\.com\/freecodecamp/i;
|
||||
const localhostRegex = /localhost:/;
|
||||
const httpRegex = /http(?!s|([^s]+?localhost))/;
|
||||
|
||||
@@ -21,5 +23,7 @@ export const localhostValidator = value =>
|
||||
export const httpValidator = value =>
|
||||
httpRegex.test(value) ? <Trans>validation.http-url</Trans> : null;
|
||||
|
||||
export const composeValidators = (...validators) => value =>
|
||||
validators.reduce((error, validator) => error ?? validator?.(value), null);
|
||||
export const composeValidators =
|
||||
(...validators) =>
|
||||
value =>
|
||||
validators.reduce((error, validator) => error ?? validator?.(value), null);
|
||||
|
@@ -285,13 +285,8 @@ export class CertificationSettings extends Component {
|
||||
);
|
||||
};
|
||||
renderProjectsFor = (certName, isCert) => {
|
||||
const {
|
||||
username,
|
||||
isHonest,
|
||||
createFlashMessage,
|
||||
t,
|
||||
verifyCert
|
||||
} = this.props;
|
||||
const { username, isHonest, createFlashMessage, t, verifyCert } =
|
||||
this.props;
|
||||
const { certSlug } = first(projectMap[certName]);
|
||||
const certLocation = `/certification/${username}/${certSlug}`;
|
||||
const createClickHandler = certSlug => e => {
|
||||
@@ -332,12 +327,8 @@ export class CertificationSettings extends Component {
|
||||
|
||||
// legacy projects rendering
|
||||
handleSubmitLegacy({ values: formChalObj }) {
|
||||
const {
|
||||
isHonest,
|
||||
createFlashMessage,
|
||||
verifyCert,
|
||||
updateLegacyCert
|
||||
} = this.props;
|
||||
const { isHonest, createFlashMessage, verifyCert, updateLegacyCert } =
|
||||
this.props;
|
||||
let legacyTitle;
|
||||
let certSlug;
|
||||
let certs = Object.keys(legacyProjectMap);
|
||||
|
@@ -141,17 +141,11 @@ class EmailSettings extends Component {
|
||||
emailForm: { newEmail, confirmNewEmail, currentEmail, isPristine }
|
||||
} = this.state;
|
||||
|
||||
const {
|
||||
isEmailVerified,
|
||||
updateQuincyEmail,
|
||||
sendQuincyEmail,
|
||||
t
|
||||
} = this.props;
|
||||
const { isEmailVerified, updateQuincyEmail, sendQuincyEmail, t } =
|
||||
this.props;
|
||||
|
||||
const {
|
||||
state: newEmailValidation,
|
||||
message: newEmailValidationMessage
|
||||
} = this.getValidationForNewEmail();
|
||||
const { state: newEmailValidation, message: newEmailValidationMessage } =
|
||||
this.getValidationForNewEmail();
|
||||
|
||||
const {
|
||||
state: confirmEmailValidation,
|
||||
|
@@ -165,20 +165,14 @@ class InternetSettings extends Component {
|
||||
message: githubProfileValidationMessage
|
||||
} = this.getValidationStateFor(githubProfile);
|
||||
|
||||
const {
|
||||
state: linkedinValidation,
|
||||
message: linkedinValidationMessage
|
||||
} = this.getValidationStateFor(linkedin);
|
||||
const { state: linkedinValidation, message: linkedinValidationMessage } =
|
||||
this.getValidationStateFor(linkedin);
|
||||
|
||||
const {
|
||||
state: twitterValidation,
|
||||
message: twitterValidationMessage
|
||||
} = this.getValidationStateFor(twitter);
|
||||
const { state: twitterValidation, message: twitterValidationMessage } =
|
||||
this.getValidationStateFor(twitter);
|
||||
|
||||
const {
|
||||
state: websiteValidation,
|
||||
message: websiteValidationMessage
|
||||
} = this.getValidationStateFor(website);
|
||||
const { state: websiteValidation, message: websiteValidationMessage } =
|
||||
this.getValidationStateFor(website);
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
|
@@ -123,9 +123,8 @@ class PortfolioSettings extends Component {
|
||||
const { state: titleState } = this.getTitleValidation(title);
|
||||
const { state: urlState } = this.getUrlValidation(url);
|
||||
const { state: imageState } = this.getUrlValidation(image, true);
|
||||
const { state: descriptionState } = this.getDescriptionValidation(
|
||||
description
|
||||
);
|
||||
const { state: descriptionState } =
|
||||
this.getDescriptionValidation(description);
|
||||
return [titleState, imageState, urlState, descriptionState]
|
||||
.filter(Boolean)
|
||||
.every(state => state === 'success');
|
||||
@@ -192,19 +191,15 @@ class PortfolioSettings extends Component {
|
||||
const { t } = this.props;
|
||||
const { id, title, description, url, image } = portfolio;
|
||||
const pristine = this.isFormPristine(id);
|
||||
const {
|
||||
state: titleState,
|
||||
message: titleMessage
|
||||
} = this.getTitleValidation(title);
|
||||
const { state: titleState, message: titleMessage } =
|
||||
this.getTitleValidation(title);
|
||||
const { state: urlState, message: urlMessage } = this.getUrlValidation(url);
|
||||
const { state: imageState, message: imageMessage } = this.getUrlValidation(
|
||||
image,
|
||||
true
|
||||
);
|
||||
const {
|
||||
state: descriptionState,
|
||||
message: descriptionMessage
|
||||
} = this.getDescriptionValidation(description);
|
||||
const { state: descriptionState, message: descriptionMessage } =
|
||||
this.getDescriptionValidation(description);
|
||||
|
||||
return (
|
||||
<div key={id}>
|
||||
|
Reference in New Issue
Block a user