From fc8c71ad16a8c0c23bfd6ffb284226bf795ca4b2 Mon Sep 17 00:00:00 2001
From: Valeriy
Date: Tue, 19 Feb 2019 01:59:12 +0300
Subject: [PATCH] feat: use eslint with prettier to format code
---
.../server/middlewares/add-return-to.js | 2 +-
api-server/server/middlewares/csurf.js | 2 +-
api-server/server/utils/map.js | 12 ++--
client/gatsby-browser.js | 4 +-
client/gatsby-node.js | 4 +-
client/gatsby-ssr.js | 4 +-
.../fcc-source-challenges/gatsby-node.js | 34 +++++------
.../gatsby-remark-fcc-forum-emoji/index.js | 7 +--
client/src/client-only-routes/ShowSettings.js | 4 +-
.../client-only-routes/ShowUnsubscribed.js | 2 +-
.../Donation/components/DonateCompletion.js | 4 +-
.../Donation/components/DonateForm.js | 2 +-
.../Donation/components/DonateModal.js | 9 ++-
client/src/components/Flash/index.js | 2 +-
client/src/components/Footer/index.js | 2 +-
.../src/components/Header/components/Login.js | 11 ++--
.../components/Header/components/SignedIn.js | 9 ++-
client/src/components/Header/index.js | 2 +-
client/src/components/Map/components/Block.js | 4 +-
.../components/Map/components/SuperBlock.js | 7 ++-
client/src/components/Supporters.js | 2 +-
client/src/components/formHelpers/Form.js | 4 +-
client/src/components/formHelpers/index.js | 2 +-
client/src/components/helpers/ToggleButton.js | 4 +-
.../helpers/form/BlockSaveButton.js | 2 +-
client/src/components/layouts/Default.js | 2 +-
client/src/components/layouts/Guide.js | 6 +-
.../layouts/components/guide/NavPanel.js | 4 +-
.../layouts/components/guide/SideNav.js | 2 +-
client/src/components/profile/Profile.js | 2 +-
.../profile/components/Certifications.js | 2 +-
.../components/profile/components/TimeLine.js | 2 +-
.../src/components/settings/Certification.js | 16 ++---
client/src/components/settings/Email.js | 4 +-
client/src/components/settings/Internet.js | 8 +--
client/src/components/settings/Portfolio.js | 16 ++---
client/src/components/settings/Privacy.js | 15 +++--
.../src/components/settings/SolutionViewer.js | 2 +-
client/src/components/settings/Username.js | 5 +-
client/src/contexts/GuideNavigationContext.js | 2 +-
client/src/pages/accept-privacy-terms.js | 12 ++--
client/src/pages/donate-other.js | 2 +-
client/src/pages/guide.js | 4 +-
client/src/pages/index.js | 2 +-
client/src/pages/learn.js | 2 +-
.../software-resources-for-nonprofits.js | 58 +++++++++----------
client/src/pages/update-email.js | 6 +-
.../Challenges/classic/DesktopLayout.js | 4 +-
.../Challenges/classic/MobileLayout.js | 2 +-
.../components/Challenge-Description.js | 2 +-
.../Challenges/components/CompletionModal.js | 8 +--
.../Challenges/components/HelpModal.js | 8 +--
.../Challenges/components/ResetModal.js | 13 +++--
.../Challenges/components/Side-Panel.js | 9 ++-
.../Challenges/components/Test-Suite.js | 2 +-
.../Challenges/components/Tool-Panel.js | 10 ++--
.../Challenges/components/VideoModal.js | 4 +-
.../Challenges/components/icons/Fail.js | 2 +-
.../components/icons/GreenNotCompleted.js | 2 +-
.../Challenges/components/icons/GreenPass.js | 2 +-
.../Challenges/components/icons/Initial.js | 4 +-
.../Challenges/project/Tool-Panel.js | 5 +-
.../Challenges/redux/code-storage-epic.js | 26 +++++----
.../src/templates/Challenges/utils/build.js | 2 +-
.../src/templates/Challenges/utils/frame.js | 2 +-
client/src/templates/Introduction/Intro.js | 14 +++--
curriculum/md-translation.js | 44 +++++++-------
curriculum/test/test-challenges.js | 6 +-
tools/challenge-md-parser/text-to-data.js | 2 +-
.../scripts/ci/ensure-challenge-formatting.js | 2 +-
70 files changed, 254 insertions(+), 236 deletions(-)
diff --git a/api-server/server/middlewares/add-return-to.js b/api-server/server/middlewares/add-return-to.js
index f43c0c5d61..087b08153b 100644
--- a/api-server/server/middlewares/add-return-to.js
+++ b/api-server/server/middlewares/add-return-to.js
@@ -25,7 +25,7 @@ export default function addReturnToUrl() {
req.method !== 'GET' ||
pathsOfNoReturnRegex.test(path) ||
!whiteListRegex.test(path) ||
- (/hot/i).test(req.path)
+ /hot/i.test(req.path)
) {
return next();
}
diff --git a/api-server/server/middlewares/csurf.js b/api-server/server/middlewares/csurf.js
index b28e39e781..045ad68c7b 100644
--- a/api-server/server/middlewares/csurf.js
+++ b/api-server/server/middlewares/csurf.js
@@ -8,7 +8,7 @@ export default function() {
});
return function csrf(req, res, next) {
const path = req.path.split('/')[1];
- if ((/(^api$|^unauthenticated$|^internal$|^p$)/).test(path)) {
+ if (/(^api$|^unauthenticated$|^internal$|^p$)/.test(path)) {
return next();
}
return protection(req, res, next);
diff --git a/api-server/server/utils/map.js b/api-server/server/utils/map.js
index dd7544b40c..48172292ae 100644
--- a/api-server/server/utils/map.js
+++ b/api-server/server/utils/map.js
@@ -17,7 +17,7 @@ const getFirstChallenge = _.once(_getFirstChallenge);
* interface ChallengeMap {
* result: {
* superBlocks: [ ...superBlockDashedName: String ]
-* },
+ * },
* entities: {
* superBlock: {
* [ ...superBlockDashedName ]: SuperBlock
@@ -49,10 +49,12 @@ export function _cachedMap({ Block, Challenge }) {
});
const blockMap = Observable.combineLatest(
blocks.map(blocks =>
- blocks.map(block => block.toJSON()).reduce((hash, block) => {
- hash[block.dashedName] = block;
- return hash;
- }, {})
+ blocks
+ .map(block => block.toJSON())
+ .reduce((hash, block) => {
+ hash[block.dashedName] = block;
+ return hash;
+ }, {})
),
challenges
).map(([blocksMap, challenges]) => {
diff --git a/client/gatsby-browser.js b/client/gatsby-browser.js
index aeaf002ad7..2a1d585826 100644
--- a/client/gatsby-browser.js
+++ b/client/gatsby-browser.js
@@ -35,14 +35,14 @@ export const wrapPageElement = ({ element, props }) => {
);
}
- if ((/^\/guide(\/.*)*/).test(pathname)) {
+ if (/^\/guide(\/.*)*/.test(pathname)) {
return (
{element}
);
}
- if ((/^\/learn(\/.*)*/).test(pathname)) {
+ if (/^\/learn(\/.*)*/.test(pathname)) {
return {element};
}
return {element};
diff --git a/client/gatsby-node.js b/client/gatsby-node.js
index b183365538..c1d8de35ea 100644
--- a/client/gatsby-node.js
+++ b/client/gatsby-node.js
@@ -148,8 +148,8 @@ exports.onCreateWebpackConfig = ({ stage, rules, plugins, actions }) => {
/* eslint-disable max-len */
exclude: modulePath => {
return (
- (/node_modules/).test(modulePath) &&
- !(/(ansi-styles|chalk|strict-uri-encode|react-freecodecamp-search)/).test(
+ /node_modules/.test(modulePath) &&
+ !/(ansi-styles|chalk|strict-uri-encode|react-freecodecamp-search)/.test(
modulePath
)
);
diff --git a/client/gatsby-ssr.js b/client/gatsby-ssr.js
index 583a56bff7..aa941852bf 100644
--- a/client/gatsby-ssr.js
+++ b/client/gatsby-ssr.js
@@ -35,14 +35,14 @@ export const wrapPageElement = ({ element, props }) => {
);
}
- if ((/^\/guide(\/.*)*/).test(pathname)) {
+ if (/^\/guide(\/.*)*/.test(pathname)) {
return (
{element}
);
}
- if ((/^\/learn(\/.*)*/).test(pathname)) {
+ if (/^\/learn(\/.*)*/.test(pathname)) {
return {element};
}
return {element};
diff --git a/client/plugins/fcc-source-challenges/gatsby-node.js b/client/plugins/fcc-source-challenges/gatsby-node.js
index 794aba9430..f5df745570 100644
--- a/client/plugins/fcc-source-challenges/gatsby-node.js
+++ b/client/plugins/fcc-source-challenges/gatsby-node.js
@@ -31,28 +31,26 @@ exports.sourceNodes = function sourceChallengesSourceNodes(
persistent: true
});
- watcher.on('ready', sourceAndCreateNodes).on(
- 'change',
- filePath =>
- (/\.md$/).test(filePath)
- ? onSourceChange(filePath)
- .then(challenge => {
- reporter.info(
- `File changed at ${filePath}, replacing challengeNode id ${
- challenge.id
- }`
- );
- return createChallengeNode(challenge, reporter);
- })
- .then(createNode)
- .catch(e =>
- reporter.error(`fcc-replace-challenge
+ watcher.on('ready', sourceAndCreateNodes).on('change', filePath =>
+ /\.md$/.test(filePath)
+ ? onSourceChange(filePath)
+ .then(challenge => {
+ reporter.info(
+ `File changed at ${filePath}, replacing challengeNode id ${
+ challenge.id
+ }`
+ );
+ return createChallengeNode(challenge, reporter);
+ })
+ .then(createNode)
+ .catch(e =>
+ reporter.error(`fcc-replace-challenge
${e.message}
`)
- )
- : null
+ )
+ : null
);
function sourceAndCreateNodes() {
diff --git a/client/plugins/gatsby-remark-fcc-forum-emoji/index.js b/client/plugins/gatsby-remark-fcc-forum-emoji/index.js
index 3aebf81242..aea993e03b 100644
--- a/client/plugins/gatsby-remark-fcc-forum-emoji/index.js
+++ b/client/plugins/gatsby-remark-fcc-forum-emoji/index.js
@@ -20,10 +20,7 @@ function markdownToHTML(node) {
}
module.exports = function forumEmojiPlugin({ markdownAST }) {
- visit(
- markdownAST,
- 'image',
- imageNode =>
- emojiRE.test(imageNode.title) ? markdownToHTML(imageNode) : imageNode
+ visit(markdownAST, 'image', imageNode =>
+ emojiRE.test(imageNode.title) ? markdownToHTML(imageNode) : imageNode
);
};
diff --git a/client/src/client-only-routes/ShowSettings.js b/client/src/client-only-routes/ShowSettings.js
index 65d32cbe32..34657e30f2 100644
--- a/client/src/client-only-routes/ShowSettings.js
+++ b/client/src/client-only-routes/ShowSettings.js
@@ -191,7 +191,7 @@ function ShowSettings(props) {
bsStyle='primary'
className='btn-invert'
href={`/${username}`}
- >
+ >
Show me my public portfolio
diff --git a/client/src/client-only-routes/ShowUnsubscribed.js b/client/src/client-only-routes/ShowUnsubscribed.js
index 780ce44201..b3ba08cd5d 100644
--- a/client/src/client-only-routes/ShowUnsubscribed.js
+++ b/client/src/client-only-routes/ShowUnsubscribed.js
@@ -33,7 +33,7 @@ function ShowUnsubscribed({ unsubscribeId }) {
bsSize='lg'
bsStyle='primary'
href={`${apiLocation}/internal/resubscribe/${unsubscribeId}`}
- >
+ >
You can click here to resubscribe
diff --git a/client/src/components/Donation/components/DonateCompletion.js b/client/src/components/Donation/components/DonateCompletion.js
index a8229ee8b5..efde01b29c 100644
--- a/client/src/components/Donation/components/DonateCompletion.js
+++ b/client/src/components/Donation/components/DonateCompletion.js
@@ -18,8 +18,8 @@ function DonateCompletion({ processing, reset, success, error = null }) {
const heading = processing
? 'We are processing your donation.'
: success
- ? 'Your donation was successful.'
- : 'Something went wrong with your donation';
+ ? 'Your donation was successful.'
+ : 'Something went wrong with your donation';
return (
{heading}
diff --git a/client/src/components/Donation/components/DonateForm.js b/client/src/components/Donation/components/DonateForm.js
index 0029902315..954e30d8b4 100644
--- a/client/src/components/Donation/components/DonateForm.js
+++ b/client/src/components/Donation/components/DonateForm.js
@@ -184,7 +184,7 @@ class DonateForm extends Component {
disabled={!isFormValid}
id='confirm-donation-btn'
type='submit'
- >
+ >
Confirm your donation of $5 / month
diff --git a/client/src/components/Donation/components/DonateModal.js b/client/src/components/Donation/components/DonateModal.js
index 7c4f304074..109a384f00 100644
--- a/client/src/components/Donation/components/DonateModal.js
+++ b/client/src/components/Donation/components/DonateModal.js
@@ -20,9 +20,12 @@ import DonateText from './DonateText';
import '../Donation.css';
-const mapStateToProps = createSelector(isDonationModalOpenSelector, show => ({
- show
-}));
+const mapStateToProps = createSelector(
+ isDonationModalOpenSelector,
+ show => ({
+ show
+ })
+);
const mapDispatchToProps = dispatch =>
bindActionCreators(
diff --git a/client/src/components/Flash/index.js b/client/src/components/Flash/index.js
index 2e4768dd25..340ef66859 100644
--- a/client/src/components/Flash/index.js
+++ b/client/src/components/Flash/index.js
@@ -15,7 +15,7 @@ function Flash({ messages, onClose }) {
className='flash-message'
key={id}
onDismiss={createDismissHandler(onClose, id)}
- >
+ >
));
diff --git a/client/src/components/Footer/index.js b/client/src/components/Footer/index.js
index e47a9ed1b6..1ad82b3a5a 100644
--- a/client/src/components/Footer/index.js
+++ b/client/src/components/Footer/index.js
@@ -19,7 +19,7 @@ const ColHeader = ({ children, ...other }) => (
ColHeader.propTypes = propTypes;
const Link = ({ children, to, external, ...other }) => {
- if (!external && (/^\/(?!\/)/).test(to)) {
+ if (!external && /^\/(?!\/)/.test(to)) {
return (
{children}
diff --git a/client/src/components/Header/components/Login.js b/client/src/components/Header/components/Login.js
index a33051e8d6..2836a8f514 100644
--- a/client/src/components/Header/components/Login.js
+++ b/client/src/components/Header/components/Login.js
@@ -12,9 +12,12 @@ import { gtagReportConversion } from '../../../analytics/gtag';
import './login.css';
-const mapStateToProps = createSelector(isSignedInSelector, isSignedIn => ({
- isSignedIn
-}));
+const mapStateToProps = createSelector(
+ isSignedInSelector,
+ isSignedIn => ({
+ isSignedIn
+ })
+);
const mapDispatchToProps = dispatch => ({
navigate: location => dispatch(hardGoTo(location))
});
@@ -38,7 +41,7 @@ function Login(props) {
className={
(restProps.block ? 'btn-cta-big' : '') + ' signup-btn btn-cta'
}
- >
+ >
{children || 'Sign In'}
diff --git a/client/src/components/Header/components/SignedIn.js b/client/src/components/Header/components/SignedIn.js
index 8bba6033e0..e917c2a938 100644
--- a/client/src/components/Header/components/SignedIn.js
+++ b/client/src/components/Header/components/SignedIn.js
@@ -6,9 +6,12 @@ import { createSelector } from 'reselect';
import { userSelector } from '../../../redux';
-const mapStateToProps = createSelector(userSelector, ({ picture }) => ({
- picture
-}));
+const mapStateToProps = createSelector(
+ userSelector,
+ ({ picture }) => ({
+ picture
+ })
+);
function SignedIn({ picture }) {
return (
diff --git a/client/src/components/Header/index.js b/client/src/components/Header/index.js
index 055611b959..5b055b7b65 100644
--- a/client/src/components/Header/index.js
+++ b/client/src/components/Header/index.js
@@ -78,7 +78,7 @@ class Header extends Component {
className='menu-button'
onClick={this.toggleClass}
ref={this.menuButtonRef}
- >
+ >
Menu
diff --git a/client/src/components/Map/components/Block.js b/client/src/components/Map/components/Block.js
index 3f8c6973c0..423cdd9405 100644
--- a/client/src/components/Map/components/Block.js
+++ b/client/src/components/Map/components/Block.js
@@ -93,14 +93,14 @@ export class Block extends Component {
+ >
{i !== 0 && this.renderCheckMark(challenge.isCompleted)}
+ >
{challenge.title || challenge.frontmatter.title}
diff --git a/client/src/components/Map/components/SuperBlock.js b/client/src/components/Map/components/SuperBlock.js
index afcd9b4d3d..1fbe29b111 100644
--- a/client/src/components/Map/components/SuperBlock.js
+++ b/client/src/components/Map/components/SuperBlock.js
@@ -14,9 +14,10 @@ import { ChallengeNode } from '../../../redux/propTypes';
const mapStateToProps = (state, ownProps) => {
const expandedSelector = makeExpandedSuperBlockSelector(ownProps.superBlock);
- return createSelector(expandedSelector, isExpanded => ({ isExpanded }))(
- state
- );
+ return createSelector(
+ expandedSelector,
+ isExpanded => ({ isExpanded })
+ )(state);
};
function mapDispatchToProps(dispatch) {
diff --git a/client/src/components/Supporters.js b/client/src/components/Supporters.js
index 71e9ed1d23..57eeca8cc5 100644
--- a/client/src/components/Supporters.js
+++ b/client/src/components/Supporters.js
@@ -75,7 +75,7 @@ function Supporters({ isDonating, activeDonations }) {
bsStyle='primary'
href='https://donate.freecodecamp.org'
target='_blank'
- >
+ >
Click here to become a Supporter
diff --git a/client/src/components/formHelpers/Form.js b/client/src/components/formHelpers/Form.js
index d1a3791d37..8a33fd9181 100644
--- a/client/src/components/formHelpers/Form.js
+++ b/client/src/components/formHelpers/Form.js
@@ -50,7 +50,7 @@ export function DynamicForm({
id={`dynamic-${id}`}
onSubmit={handleSubmit(submit)}
style={{ width: '100%' }}
- >
+ >
{hideButton ? null : (
@@ -59,7 +59,7 @@ export function DynamicForm({
(allPristine && !enableSubmit) ||
!!Object.keys(errors).filter(key => errors[key]).length
}
- >
+ >
{buttonText ? buttonText : null}
)}
diff --git a/client/src/components/formHelpers/index.js b/client/src/components/formHelpers/index.js
index 41e5377d6a..ec9c9e182c 100644
--- a/client/src/components/formHelpers/index.js
+++ b/client/src/components/formHelpers/index.js
@@ -65,7 +65,7 @@ export function getValidationState(field) {
return null;
}
- if ((/https?:\/\/glitch\.com\/edit\/#!\/.*/g).test(field.value)) {
+ if (/https?:\/\/glitch\.com\/edit\/#!\/.*/g.test(field.value)) {
return 'glitch-warning';
}
diff --git a/client/src/components/helpers/ToggleButton.js b/client/src/components/helpers/ToggleButton.js
index 5ea23b5692..2fd67618c1 100644
--- a/client/src/components/helpers/ToggleButton.js
+++ b/client/src/components/helpers/ToggleButton.js
@@ -36,7 +36,7 @@ export default function ToggleButton({
disabled={value}
type='radio'
value={1}
- >
+ >
{onLabel}
+ >
{offLabel}
diff --git a/client/src/components/helpers/form/BlockSaveButton.js b/client/src/components/helpers/form/BlockSaveButton.js
index ffb8a50180..a0b32426bb 100644
--- a/client/src/components/helpers/form/BlockSaveButton.js
+++ b/client/src/components/helpers/form/BlockSaveButton.js
@@ -10,7 +10,7 @@ function BlockSaveButton({ children, ...restProps }) {
bsStyle='primary'
type='submit'
{...restProps}
- >
+ >
{children || 'Save'}
);
diff --git a/client/src/components/layouts/Default.js b/client/src/components/layouts/Default.js
index 51a6c5cdb6..a8c6ffb01c 100644
--- a/client/src/components/layouts/Default.js
+++ b/client/src/components/layouts/Default.js
@@ -155,7 +155,7 @@ class DefaultLayout extends Component {
},
{ name: 'keywords', content: metaKeywords.join(', ') }
]}
- >
+ >
diff --git a/client/src/components/layouts/Guide.js b/client/src/components/layouts/Guide.js
index 2c085b424a..ca862c0542 100644
--- a/client/src/components/layouts/Guide.js
+++ b/client/src/components/layouts/Guide.js
@@ -75,7 +75,7 @@ class GuideLayout extends React.Component {
md={4}
smHidden={!displaySideNav}
xsHidden={!displaySideNav}
- >
+ >
+ >
+ >
{this.props.children}
diff --git a/client/src/components/layouts/components/guide/NavPanel.js b/client/src/components/layouts/components/guide/NavPanel.js
index c37c902299..369da32baf 100644
--- a/client/src/components/layouts/components/guide/NavPanel.js
+++ b/client/src/components/layouts/components/guide/NavPanel.js
@@ -29,7 +29,7 @@ function NoArticles() {
}
rel='noopener noreferrer'
target='_blank'
- >
+ >
write one?
@@ -92,7 +92,7 @@ class NavPanel extends Component {
bsClass='panelStyle panel'
id={`${dashedName}-panel`}
role='listitem'
- >
+ >
{this.renderHeader()}
{isExpanded ? {this.renderBody()} : null}
diff --git a/client/src/components/layouts/components/guide/SideNav.js b/client/src/components/layouts/components/guide/SideNav.js
index 349aa996f5..e194a7d667 100644
--- a/client/src/components/layouts/components/guide/SideNav.js
+++ b/client/src/components/layouts/components/guide/SideNav.js
@@ -57,7 +57,7 @@ class SideNav extends Component {
path={parent.path}
title={title}
toggleDisplaySideNav={this.props.toggleDisplaySideNav}
- >
+ >
{children}
);
diff --git a/client/src/components/profile/Profile.js b/client/src/components/profile/Profile.js
index 3943b6415c..5779ae2c99 100644
--- a/client/src/components/profile/Profile.js
+++ b/client/src/components/profile/Profile.js
@@ -81,7 +81,7 @@ function renderSettingsButton() {
bsSize='lg'
bsStyle='primary'
className='btn-invert'
- >
+ >
Update my settings
diff --git a/client/src/components/profile/components/Certifications.js b/client/src/components/profile/components/Certifications.js
index 5181ef50d7..33261facba 100644
--- a/client/src/components/profile/components/Certifications.js
+++ b/client/src/components/profile/components/Certifications.js
@@ -123,7 +123,7 @@ function renderCertShow(username, cert) {
bsSize='lg'
bsStyle='primary'
className='btn-invert'
- >
+ >
View {cert.title}
diff --git a/client/src/components/profile/components/TimeLine.js b/client/src/components/profile/components/TimeLine.js
index 264692e50e..b1dd788ec5 100644
--- a/client/src/components/profile/components/TimeLine.js
+++ b/client/src/components/profile/components/TimeLine.js
@@ -140,7 +140,7 @@ class Timeline extends Component {
aria-labelledby='contained-modal-title'
onHide={this.closeSolution}
show={solutionOpen}
- >
+ >
{`${username}'s Solution to ${blockNameify(idToNameMap[id])}`}
diff --git a/client/src/components/settings/Certification.js b/client/src/components/settings/Certification.js
index b7d7ad4456..581ec8ce7c 100644
--- a/client/src/components/settings/Certification.js
+++ b/client/src/components/settings/Certification.js
@@ -142,7 +142,7 @@ class CertificationSettings extends Component {
bsStyle='primary'
className='btn-invert'
onClick={onClickHandler}
- >
+ >
Show Code
);
@@ -156,13 +156,13 @@ class CertificationSettings extends Component {
className='btn-invert'
id={`dropdown-for-${projectId}`}
title='Show Solutions'
- >
+ >
@@ -186,7 +186,7 @@ class CertificationSettings extends Component {
href={solution}
rel='noopener noreferrer'
target='_blank'
- >
+ >
Show Solution
);
@@ -197,7 +197,7 @@ class CertificationSettings extends Component {
bsStyle='primary'
className='btn-invert'
onClick={onClickHandler}
- >
+ >
Show Code
);
@@ -258,7 +258,7 @@ class CertificationSettings extends Component {
bsStyle='primary'
href={certLocation}
onClick={createClickHandler(superBlock)}
- >
+ >
{isCert ? 'Show Certification' : 'Claim Certification'}
@@ -280,7 +280,7 @@ class CertificationSettings extends Component {
bsSize='large'
onHide={this.handleSolutionModalHide}
show={isOpen}
- >
+ >
Solution for {projectTitle}
diff --git a/client/src/components/settings/Email.js b/client/src/components/settings/Email.js
index c24cdd824c..60b1a852ac 100644
--- a/client/src/components/settings/Email.js
+++ b/client/src/components/settings/Email.js
@@ -189,7 +189,7 @@ class EmailSettings extends Component {
+ >
New Email
+ >
Confirm New Email
+ >
GitHub
@@ -109,7 +109,7 @@ class InternetSettings extends Component {
+ >
LinkedIn
@@ -122,7 +122,7 @@ class InternetSettings extends Component {
+ >
Twitter
@@ -135,7 +135,7 @@ class InternetSettings extends Component {
+ >
Personal Website
diff --git a/client/src/components/settings/Portfolio.js b/client/src/components/settings/Portfolio.js
index 9a32f98dc8..fbb98c41b6 100644
--- a/client/src/components/settings/Portfolio.js
+++ b/client/src/components/settings/Portfolio.js
@@ -177,7 +177,7 @@ class PortfolioSettings extends Component {
if (isImage && !maybeUrl) {
return { state: null, message: '' };
}
- if (isImage && !(/\.(png|jpg|jpeg|gif)$/).test(maybeUrl)) {
+ if (isImage && !/\.(png|jpg|jpeg|gif)$/.test(maybeUrl)) {
return {
state: 'error',
message: 'URL must link directly to an image file'
@@ -214,7 +214,7 @@ class PortfolioSettings extends Component {
validationState={
pristine || (!pristine && !title) ? null : titleState
}
- >
+ >
Title
+ >
URL
+ >
Image
+ >
Description
+ >
Save this portfolio item
@@ -288,7 +288,7 @@ class PortfolioSettings extends Component {
className='btn-delete-portfolio'
onClick={() => this.handleRemoveItem(id)}
type='button'
- >
+ >
Remove this portfolio item
@@ -325,7 +325,7 @@ class PortfolioSettings extends Component {
bsStyle='primary'
onClick={this.handleAdd}
type='button'
- >
+ >
Add a new portfolio Item
diff --git a/client/src/components/settings/Privacy.js b/client/src/components/settings/Privacy.js
index ce23e94d17..c892fa0918 100644
--- a/client/src/components/settings/Privacy.js
+++ b/client/src/components/settings/Privacy.js
@@ -14,10 +14,13 @@ import Spacer from '../helpers/Spacer';
import ToggleSetting from './ToggleSetting';
import SectionHeader from './SectionHeader';
-const mapStateToProps = createSelector(userSelector, user => ({
- ...user.profileUI,
- user
-}));
+const mapStateToProps = createSelector(
+ userSelector,
+ user => ({
+ ...user.profileUI,
+ user
+ })
+);
const mapDispatchToProps = dispatch =>
bindActionCreators({ submitProfileUI }, dispatch);
@@ -130,7 +133,7 @@ class PrivacySettings extends Component {
toggleFlag={this.toggleFlag('showLocation')}
/>
+ >
Download your data
diff --git a/client/src/components/settings/SolutionViewer.js b/client/src/components/settings/SolutionViewer.js
index a63f7806b7..e5ec12c41d 100644
--- a/client/src/components/settings/SolutionViewer.js
+++ b/client/src/components/settings/SolutionViewer.js
@@ -42,7 +42,7 @@ function SolutionViewer({
bsStyle='primary'
className='solution-viewer'
key={solution.slice(0, 10)}
- >
+ >
JS
diff --git a/client/src/components/settings/Username.js b/client/src/components/settings/Username.js
index a271031e79..678ef22cff 100644
--- a/client/src/components/settings/Username.js
+++ b/client/src/components/settings/Username.js
@@ -91,9 +91,8 @@ class UsernameSettings extends Component {
characterValidation: { valid }
} = this.state;
- return this.setState(
- { submitClicked: true },
- () => (valid ? submitNewUsername(formValue) : null)
+ return this.setState({ submitClicked: true }, () =>
+ valid ? submitNewUsername(formValue) : null
);
}
diff --git a/client/src/contexts/GuideNavigationContext.js b/client/src/contexts/GuideNavigationContext.js
index fa25bddeab..9ccf32e1af 100644
--- a/client/src/contexts/GuideNavigationContext.js
+++ b/client/src/contexts/GuideNavigationContext.js
@@ -81,7 +81,7 @@ class NavigationContextProvider extends Component {
toggleDisplaySideNav: noop,
toggleExpandedState: this.toggleExpandedState
}}
- >
+ >
{children}
);
diff --git a/client/src/pages/accept-privacy-terms.js b/client/src/pages/accept-privacy-terms.js
index 53d5f2b471..314a1c2887 100644
--- a/client/src/pages/accept-privacy-terms.js
+++ b/client/src/pages/accept-privacy-terms.js
@@ -101,13 +101,13 @@ class AcceptPrivacyTerms extends Component {
id='terms-of-service'
inline={true}
onChange={this.createHandleChange('termsOfService')}
- >
+ >
I accept the{' '}
+ >
terms of service
{' '}
(required)
@@ -123,13 +123,13 @@ class AcceptPrivacyTerms extends Component {
id='privacy-policy'
inline={true}
onChange={this.createHandleChange('privacyPolicy')}
- >
+ >
I accept the{' '}
+ >
privacy policy
{' '}
(required)
@@ -145,7 +145,7 @@ class AcceptPrivacyTerms extends Component {
id='quincy-email'
inline={true}
onChange={this.createHandleChange('quincyEmail')}
- >
+ >
I want weekly emails from Quincy, freeCodeCamp.org's
founder.
@@ -157,7 +157,7 @@ class AcceptPrivacyTerms extends Component {
className='big-cta-btn'
disabled={!privacyPolicy || !termsOfService}
type='submit'
- >
+ >
Continue to freeCodeCamp
diff --git a/client/src/pages/donate-other.js b/client/src/pages/donate-other.js
index 11d902c3b5..59e9cdd225 100644
--- a/client/src/pages/donate-other.js
+++ b/client/src/pages/donate-other.js
@@ -68,7 +68,7 @@ class DonateOtherPage extends Component {
})
}
target='_blank'
- >
+ >
{' '}
+ >
freeCodeCamp.org
{'. It has a curriculum that starts from zero and helps you learn' +
@@ -48,7 +48,7 @@ function Index() {
href='https://github.com/freeCodeCamp/freeCodeCamp'
rel='noopener noreferrer'
target='_blank'
- >
+ >
open source
{'. Your help in making it better is greatly appreciated!'}
diff --git a/client/src/pages/index.js b/client/src/pages/index.js
index a7d30d0be5..7d07a22776 100644
--- a/client/src/pages/index.js
+++ b/client/src/pages/index.js
@@ -232,7 +232,7 @@ const IndexPage = () => (
href='https://donate.freecodecamp.org/'
rel='noopener noreferrer'
target='_blank'
- >
+ >
make a tax-deductible donation here
diff --git a/client/src/pages/learn.js b/client/src/pages/learn.js
index 63ca1d82bb..0238d42154 100644
--- a/client/src/pages/learn.js
+++ b/client/src/pages/learn.js
@@ -53,7 +53,7 @@ const IndexPage = ({
href='https://donate.freecodecamp.org'
rel='noopener noreferrer'
target='_blank'
- >
+ >
donate
{' '}
to our nonprofit.
diff --git a/client/src/pages/software-resources-for-nonprofits.js b/client/src/pages/software-resources-for-nonprofits.js
index df8d5ae6f7..c298d4114e 100644
--- a/client/src/pages/software-resources-for-nonprofits.js
+++ b/client/src/pages/software-resources-for-nonprofits.js
@@ -30,7 +30,7 @@ function SoftwareResourcesForNonProfits() {
href='http://givecamp.org/'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Give Camp
@@ -39,7 +39,7 @@ function SoftwareResourcesForNonProfits() {
href='http://www.volunteermatch.com'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Volunteer Match.com
@@ -48,7 +48,7 @@ function SoftwareResourcesForNonProfits() {
href='http://www.catchafire.org'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Catchafire
@@ -57,7 +57,7 @@ function SoftwareResourcesForNonProfits() {
href='http://anyonecanhaveawebsite.com'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Anyone Can Have A Website
@@ -69,7 +69,7 @@ function SoftwareResourcesForNonProfits() {
href='https://www.youtube.com/watch?v=4AXDKWuY9QM'
rel='noopener noreferrer'
target='_blank'
- >
+ >
How to build and deploy a website without writing any code for
free
@@ -79,7 +79,7 @@ function SoftwareResourcesForNonProfits() {
href='http://www.wix.com/'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Wix
@@ -88,7 +88,7 @@ function SoftwareResourcesForNonProfits() {
href='https://www.squarespace.com/'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Square Space
@@ -97,7 +97,7 @@ function SoftwareResourcesForNonProfits() {
href='https://wordpress.com/'
rel='noopener noreferrer'
target='_blank'
- >
+ >
WordPress
@@ -106,7 +106,7 @@ function SoftwareResourcesForNonProfits() {
href='https://xprs.imcreator.com'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Imcreator.com
@@ -118,7 +118,7 @@ function SoftwareResourcesForNonProfits() {
href='http://causesignal.com'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Cause Signal
@@ -127,7 +127,7 @@ function SoftwareResourcesForNonProfits() {
href='https://www.thedatabank.com/'
rel='noopener noreferrer'
target='_blank'
- >
+ >
The Data Bank
@@ -136,7 +136,7 @@ function SoftwareResourcesForNonProfits() {
href='http://www.donorsnap.com/'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Donor Snap
@@ -145,7 +145,7 @@ function SoftwareResourcesForNonProfits() {
href='http://www.donorperfect.com/'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Donor Perfect
@@ -157,7 +157,7 @@ function SoftwareResourcesForNonProfits() {
}
rel='noopener noreferrer'
target='_blank'
- >
+ >
E Tapestry
@@ -166,7 +166,7 @@ function SoftwareResourcesForNonProfits() {
href='http://www.z2systems.com'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Z2 Systems
@@ -175,7 +175,7 @@ function SoftwareResourcesForNonProfits() {
href='http://www.regpacks.com/volunteer-management'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Reg Packs
@@ -184,7 +184,7 @@ function SoftwareResourcesForNonProfits() {
href='http://sumac.com'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Sumac
@@ -193,7 +193,7 @@ function SoftwareResourcesForNonProfits() {
href='http://www.volgistics.com'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Volgistics
@@ -205,7 +205,7 @@ function SoftwareResourcesForNonProfits() {
href='https://www.ordoro.com'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Ordoro
@@ -214,7 +214,7 @@ function SoftwareResourcesForNonProfits() {
href='http://www.unleashedsoftware.com'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Unleashed Software
@@ -223,7 +223,7 @@ function SoftwareResourcesForNonProfits() {
href='https://www.ezofficeinventory.com/industries/non-profits'
rel='noopener noreferrer'
target='_blank'
- >
+ >
EZ Office Inventory
@@ -235,7 +235,7 @@ function SoftwareResourcesForNonProfits() {
href='http://www.dokeos.com'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Dokeos
@@ -244,7 +244,7 @@ function SoftwareResourcesForNonProfits() {
href='http://www.efrontlearning.net/'
rel='noopener noreferrer'
target='_blank'
- >
+ >
E Front Learning
@@ -253,7 +253,7 @@ function SoftwareResourcesForNonProfits() {
href='https://moodle.org/'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Moodle
@@ -262,7 +262,7 @@ function SoftwareResourcesForNonProfits() {
href='https://sakaiproject.org/'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Sakai Project
@@ -274,7 +274,7 @@ function SoftwareResourcesForNonProfits() {
href='https://civicrm.org/'
rel='noopener noreferrer'
target='_blank'
- >
+ >
CiviCRM
@@ -283,7 +283,7 @@ function SoftwareResourcesForNonProfits() {
href='http://tcmgr.com/'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Total Community Manager
@@ -295,7 +295,7 @@ function SoftwareResourcesForNonProfits() {
href='http://www.google.com/forms'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Google Forms
@@ -304,7 +304,7 @@ function SoftwareResourcesForNonProfits() {
href='http://www.typeform.com'
rel='noopener noreferrer'
target='_blank'
- >
+ >
Typeform
diff --git a/client/src/pages/update-email.js b/client/src/pages/update-email.js
index 7e84af27d3..9638e319e2 100644
--- a/client/src/pages/update-email.js
+++ b/client/src/pages/update-email.js
@@ -92,12 +92,12 @@ class UpdateEmail extends Component {
+ >
+ >
Email
@@ -115,7 +115,7 @@ class UpdateEmail extends Component {
bsStyle='primary'
disabled={this.getEmailValidationState() !== 'success'}
type='submit'
- >
+ >
{isNewEmail ? 'Update my Email' : 'Verify Email'}
diff --git a/client/src/templates/Challenges/classic/DesktopLayout.js b/client/src/templates/Challenges/classic/DesktopLayout.js
index 3379bbeadc..7849def151 100644
--- a/client/src/templates/Challenges/classic/DesktopLayout.js
+++ b/client/src/templates/Challenges/classic/DesktopLayout.js
@@ -43,7 +43,7 @@ class DesktopLayout extends Component {
renderOnResize={true}
renderOnResizeRate={20}
{...resizeProps}
- >
+ >
{editor}
@@ -53,7 +53,7 @@ class DesktopLayout extends Component {
renderOnResize={true}
renderOnResizeRate={20}
{...resizeProps}
- >
+ >
{testOutput}
diff --git a/client/src/templates/Challenges/classic/MobileLayout.js b/client/src/templates/Challenges/classic/MobileLayout.js
index 007aaab91c..99331b2d9c 100644
--- a/client/src/templates/Challenges/classic/MobileLayout.js
+++ b/client/src/templates/Challenges/classic/MobileLayout.js
@@ -58,7 +58,7 @@ class MobileLayout extends Component {
defaultActiveKey={1}
id='challenge-page-tabs'
onSelect={moveToTab}
- >
+ >
{instructions}
diff --git a/client/src/templates/Challenges/components/Challenge-Description.js b/client/src/templates/Challenges/components/Challenge-Description.js
index 14a27ef41c..0d328d7c76 100644
--- a/client/src/templates/Challenges/components/Challenge-Description.js
+++ b/client/src/templates/Challenges/components/Challenge-Description.js
@@ -10,7 +10,7 @@ const propTypes = {
};
function emptyInstruction(instructions) {
- return (/^\s*<\/section>$/).test(
+ return /^\s*<\/section>$/.test(
instructions
);
}
diff --git a/client/src/templates/Challenges/components/CompletionModal.js b/client/src/templates/Challenges/components/CompletionModal.js
index 367221136b..3aa07bdf3c 100644
--- a/client/src/templates/Challenges/components/CompletionModal.js
+++ b/client/src/templates/Challenges/components/CompletionModal.js
@@ -120,11 +120,11 @@ export class CompletionModal extends Component {
onHide={close}
onKeyDown={isOpen ? handleKeypress : noop}
show={isOpen}
- >
+ >
+ >
{message}
@@ -138,7 +138,7 @@ export class CompletionModal extends Component {
bsSize='large'
bsStyle='primary'
onClick={submitChallenge}
- >
+ >
Submit and go to next challenge{' '}
(Ctrl + Enter)
@@ -150,7 +150,7 @@ export class CompletionModal extends Component {
className='btn-invert'
download={`${dashedName}.json`}
href={this.state.downloadURL}
- >
+ >
Download my solution
) : null}
diff --git a/client/src/templates/Challenges/components/HelpModal.js b/client/src/templates/Challenges/components/HelpModal.js
index 23543dd2e7..96a6bd70ea 100644
--- a/client/src/templates/Challenges/components/HelpModal.js
+++ b/client/src/templates/Challenges/components/HelpModal.js
@@ -37,7 +37,7 @@ export class HelpModal extends Component {
+ >
Ask for help?
@@ -48,7 +48,7 @@ export class HelpModal extends Component {
rel='noopener noreferrer'
target='_blank'
title='Read, search, ask'
- >
+ >
Read-Search-Ask
method, then you can ask for help on the freeCodeCamp forum.
@@ -58,7 +58,7 @@ export class HelpModal extends Component {
bsSize='lg'
bsStyle='primary'
onClick={createQuestion}
- >
+ >
Create a help post on the forum
diff --git a/client/src/templates/Challenges/components/ResetModal.js b/client/src/templates/Challenges/components/ResetModal.js
index 4b0ae45caf..cc80a78917 100644
--- a/client/src/templates/Challenges/components/ResetModal.js
+++ b/client/src/templates/Challenges/components/ResetModal.js
@@ -16,9 +16,12 @@ const propTypes = {
reset: PropTypes.func.isRequired
};
-const mapStateToProps = createSelector(isResetModalOpenSelector, isOpen => ({
- isOpen
-}));
+const mapStateToProps = createSelector(
+ isResetModalOpenSelector,
+ isOpen => ({
+ isOpen
+ })
+);
const mapDispatchToProps = dispatch =>
bindActionCreators(
@@ -41,7 +44,7 @@ function ResetModal({ reset, close, isOpen }) {
keyboard={true}
onHide={close}
show={isOpen}
- >
+ >
Reset this lesson?
@@ -62,7 +65,7 @@ function ResetModal({ reset, close, isOpen }) {
bsSize='large'
bsStyle='danger'
onClick={withActions(reset, close)}
- >
+ >
Reset this Lesson
diff --git a/client/src/templates/Challenges/components/Side-Panel.js b/client/src/templates/Challenges/components/Side-Panel.js
index 7ebcab0cbd..1e7684ca1e 100644
--- a/client/src/templates/Challenges/components/Side-Panel.js
+++ b/client/src/templates/Challenges/components/Side-Panel.js
@@ -13,9 +13,12 @@ import { initConsole, challengeTestsSelector } from '../redux';
import { createSelector } from 'reselect';
import './side-panel.css';
-const mapStateToProps = createSelector(challengeTestsSelector, tests => ({
- tests
-}));
+const mapStateToProps = createSelector(
+ challengeTestsSelector,
+ tests => ({
+ tests
+ })
+);
const mapDispatchToProps = dispatch =>
bindActionCreators(
diff --git a/client/src/templates/Challenges/components/Test-Suite.js b/client/src/templates/Challenges/components/Test-Suite.js
index 98e9045ec0..ad08ef1909 100644
--- a/client/src/templates/Challenges/components/Test-Suite.js
+++ b/client/src/templates/Challenges/components/Test-Suite.js
@@ -38,7 +38,7 @@ function TestSuite({ tests }) {
className='test-result'
key={text.slice(-6) + index}
tabIndex='0'
- >
+ >
{isInitial ? : statusIcon}
diff --git a/client/src/templates/Challenges/components/Tool-Panel.js b/client/src/templates/Challenges/components/Tool-Panel.js
index a7b0f0c63e..54392eaa6f 100644
--- a/client/src/templates/Challenges/components/Tool-Panel.js
+++ b/client/src/templates/Challenges/components/Tool-Panel.js
@@ -45,7 +45,7 @@ function ToolPanel({
className={`tool-panel-group ${
isMobile ? 'tool-panel-group-mobile' : ''
}`}
- >
+ >
@@ -54,7 +54,7 @@ function ToolPanel({
bsStyle='primary'
className='btn-invert'
onClick={openResetModal}
- >
+ >
{isMobile ? 'Reset' : 'Reset All Code'}
{guideUrl ? (
@@ -64,7 +64,7 @@ function ToolPanel({
className='btn-invert'
href={guideUrl}
target='_blank'
- >
+ >
{isMobile ? 'Hint' : 'Get a hint'}
) : null}
@@ -74,7 +74,7 @@ function ToolPanel({
bsStyle='primary'
className='btn-invert'
onClick={openVideoModal}
- >
+ >
{isMobile ? 'Video' : 'Watch a video'}
) : null}
@@ -83,7 +83,7 @@ function ToolPanel({
bsStyle='primary'
className='btn-invert'
onClick={openHelpModal}
- >
+ >
{isMobile ? 'Help' : 'Ask for help'}
diff --git a/client/src/templates/Challenges/components/VideoModal.js b/client/src/templates/Challenges/components/VideoModal.js
index 03f916a815..aec89d9882 100644
--- a/client/src/templates/Challenges/components/VideoModal.js
+++ b/client/src/templates/Challenges/components/VideoModal.js
@@ -30,11 +30,11 @@ export class VideoModal extends Component {
dialogClassName='video-modal'
onHide={closeVideoModal}
show={isOpen}
- >
+ >
+ >
Watch A Video
diff --git a/client/src/templates/Challenges/components/icons/Fail.js b/client/src/templates/Challenges/components/icons/Fail.js
index cdaa7a5853..3dc696107f 100644
--- a/client/src/templates/Challenges/components/icons/Fail.js
+++ b/client/src/templates/Challenges/components/icons/Fail.js
@@ -7,7 +7,7 @@ function RedFail() {
viewBox='0 0 200 200'
width='50'
xmlns='http://www.w3.org/2000/svg'
- >
+ >
Test failed
+ >
Not Passed
+ >
Passed
+ >
Initial
+ >
+ >
Get a hint
)}
@@ -44,7 +44,7 @@ export class ToolPanel extends Component {
bsStyle='primary'
className='btn-invert'
onClick={openHelpModal}
- >
+ >
Ask for help
@@ -59,4 +59,3 @@ export default connect(
mapStateToProps,
mapDispatchToProps
)(ToolPanel);
-
diff --git a/client/src/templates/Challenges/redux/code-storage-epic.js b/client/src/templates/Challenges/redux/code-storage-epic.js
index fecec0ef1b..80250da57f 100644
--- a/client/src/templates/Challenges/redux/code-storage-epic.js
+++ b/client/src/templates/Challenges/redux/code-storage-epic.js
@@ -105,18 +105,20 @@ function loadCodeEpic(action$, state$) {
const codeFound = getCode(id);
if (codeFound && isFilesAllPoly(codeFound)) {
finalFiles = {
- ...fileKeys.map(key => files[key]).reduce(
- (files, file) => ({
- ...files,
- [file.key]: {
- ...file,
- contents: codeFound[file.key]
- ? codeFound[file.key].contents
- : file.contents
- }
- }),
- {}
- )
+ ...fileKeys
+ .map(key => files[key])
+ .reduce(
+ (files, file) => ({
+ ...files,
+ [file.key]: {
+ ...file,
+ contents: codeFound[file.key]
+ ? codeFound[file.key].contents
+ : file.contents
+ }
+ }),
+ {}
+ )
};
} else {
const legacyCode = getLegacyCode(legacyKey);
diff --git a/client/src/templates/Challenges/utils/build.js b/client/src/templates/Challenges/utils/build.js
index ee5f89f919..ed03375ccc 100644
--- a/client/src/templates/Challenges/utils/build.js
+++ b/client/src/templates/Challenges/utils/build.js
@@ -92,7 +92,7 @@ function getJSTestRunner({ build, sources }, proxyLogger) {
const testWorker = createWorker('test-evaluator');
- return async(testString, testTimeout) => {
+ return async (testString, testTimeout) => {
try {
testWorker.on('LOG', proxyLogger);
return await testWorker.execute(
diff --git a/client/src/templates/Challenges/utils/frame.js b/client/src/templates/Challenges/utils/frame.js
index ae8e3d7459..f861580875 100644
--- a/client/src/templates/Challenges/utils/frame.js
+++ b/client/src/templates/Challenges/utils/frame.js
@@ -98,7 +98,7 @@ const initTestFrame = frameReady => ctx => {
resolve();
}
});
- contentLoaded.then(async() => {
+ contentLoaded.then(async () => {
const { sources, loadEnzyme } = ctx;
// default for classic challenges
// should not be used for modern
diff --git a/client/src/templates/Introduction/Intro.js b/client/src/templates/Introduction/Intro.js
index 6abd63189c..ab63975b3b 100644
--- a/client/src/templates/Introduction/Intro.js
+++ b/client/src/templates/Introduction/Intro.js
@@ -23,11 +23,13 @@ const propTypes = {
};
function renderMenuItems({ edges = [] }) {
- return edges.map(({ node }) => node).map(({ title, fields: { slug } }) => (
-
- {title}
-
- ));
+ return edges
+ .map(({ node }) => node)
+ .map(({ title, fields: { slug } }) => (
+
+ {title}
+
+ ));
}
function IntroductionPage({ data: { markdownRemark, allChallengeNode } }) {
@@ -55,7 +57,7 @@ function IntroductionPage({ data: { markdownRemark, allChallengeNode } }) {
+ >
Go to the first lesson
diff --git a/curriculum/md-translation.js b/curriculum/md-translation.js
index 5e0b1d14f0..c6d5d4686a 100644
--- a/curriculum/md-translation.js
+++ b/curriculum/md-translation.js
@@ -43,7 +43,7 @@ async function translateChallenge(file) {
translateText(instructions),
...tests.map(
test =>
- new Promise(async(resolve, reject) => {
+ new Promise(async (resolve, reject) => {
const { testString, text } = test;
const translatedText = await translateText(text).catch(reject);
return resolve({
@@ -58,11 +58,11 @@ async function translateChallenge(file) {
const { files = {}, solutions = [], ...challengeMeta } = challenge;
const md = `---
${YAML.dump(
- Object.assign(challengeMeta, {
- localeTitle: title ? title.join(' ').trim() : ''
- }),
- { lineWidth: 10000 }
- )}---
+ Object.assign(challengeMeta, {
+ localeTitle: title ? title.join(' ').trim() : ''
+ }),
+ { lineWidth: 10000 }
+)}---
## Description
${description}
@@ -88,20 +88,20 @@ ${generateChallengeSeed(files)}
${
- solutions.length === 0
- ? `\`\`\`js
+ solutions.length === 0
+ ? `\`\`\`js
// solution required
\`\`\``
- : solutions
- .map(
- solution => `
+ : solutions
+ .map(
+ solution => `
\`\`\`js
${solution}
\`\`\`
`
- )
- .join('\n')
- }
+ )
+ .join('\n')
+}
`;
@@ -126,8 +126,8 @@ ${contents}
${
- head.length
- ? `
+ head.length
+ ? `
### Before Test
@@ -136,11 +136,11 @@ ${head}
\`\`\`
`
- : ''
- }
+ : ''
+}
${
- tail.length
- ? `
+ tail.length
+ ? `
### After Test
@@ -149,8 +149,8 @@ console.info('after the test');
\`\`\`
`
- : ''
- }
+ : ''
+}
`;
});
}
diff --git a/curriculum/test/test-challenges.js b/curriculum/test/test-challenges.js
index 1efa4260b9..7ea6d28125 100644
--- a/curriculum/test/test-challenges.js
+++ b/curriculum/test/test-challenges.js
@@ -289,7 +289,7 @@ async function createTestRunnerForDOMChallenge(
await context.reload();
await context.setContent(build);
await context.evaluate(
- async(sources, loadEnzyme) => {
+ async (sources, loadEnzyme) => {
const code = sources && 'index' in sources ? sources['index'] : '';
const getUserInput = fileName => sources[fileName];
await document.__initTestFrame({ code, getUserInput, loadEnzyme });
@@ -298,7 +298,7 @@ async function createTestRunnerForDOMChallenge(
loadEnzyme
);
- return async({ text, testString }) => {
+ return async ({ text, testString }) => {
try {
const { pass, err } = await Promise.race([
new Promise((_, reject) => setTimeout(() => reject('timeout'), 5000)),
@@ -327,7 +327,7 @@ async function createTestRunnerForJSChallenge({ files }, solution) {
const code = sources && 'index' in sources ? sources['index'] : '';
const testWorker = createWorker('test-evaluator');
- return async({ text, testString }) => {
+ return async ({ text, testString }) => {
try {
const { pass, err } = await testWorker.execute(
{ testString, build, code, sources },
diff --git a/tools/challenge-md-parser/text-to-data.js b/tools/challenge-md-parser/text-to-data.js
index 70dc4a70e5..638b5835a7 100644
--- a/tools/challenge-md-parser/text-to-data.js
+++ b/tools/challenge-md-parser/text-to-data.js
@@ -45,7 +45,7 @@ function textToData(sectionIds) {
const lines = child.value.split('\n');
if (lines.filter(Boolean).length > 0) {
lines.forEach((line, index) => {
- if ((/^\s*$/).test(line)) {
+ if (/^\s*$/.test(line)) {
currentParagraph = null;
} else {
if (!currentParagraph || index > 0) {
diff --git a/tools/scripts/ci/ensure-challenge-formatting.js b/tools/scripts/ci/ensure-challenge-formatting.js
index 0fd60d050f..dbf06e3d00 100644
--- a/tools/scripts/ci/ensure-challenge-formatting.js
+++ b/tools/scripts/ci/ensure-challenge-formatting.js
@@ -70,7 +70,7 @@ const challengeFrontmatterValidator = file => frontmatter => {
function isChallengeParseable(file) {
const { stat, fullPath } = file;
- if (!stat.isFile() || (/_meta/).test(fullPath)) {
+ if (!stat.isFile() || /_meta/.test(fullPath)) {
return Promise.resolve(true);
}
return parseMarkdown(fullPath);