Skip to content

Commit

Permalink
chore: Apply linting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Bouncey authored and raisedadead committed Feb 19, 2019
1 parent a63b84e commit 8e0237d
Show file tree
Hide file tree
Showing 16 changed files with 95 additions and 51 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": ["plugin:react/recommended", "@freecodecamp/eslint-config"],
"rules": { "no-shadow": 0 },
"rules": { "no-shadow": 0, "react/no-unescaped-entities": 0 },
"settings": {
"react": {
"version": "16.4.2"
Expand Down
20 changes: 14 additions & 6 deletions client/plugins/fcc-create-nav-data/create-navigation-node.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,21 @@ describe('fcc-create-nav-data', () => {
expect(result.dashedName).equal('file-writing');
});

it('node.path should equal the file path from pagesDir, prefixed with `/guide`', () => {
expect(result.path).to.equal('/guide/php/functions/files/file-writing');
});
it(
'node.path should equal the file path from pagesDir, ' +
'prefixed with `/guide`',
() => {
expect(result.path).to.equal('/guide/php/functions/files/file-writing');
}
);

it('node.parentPath should equal the path of the parent page, prefixed with `/guide`', () => {
expect(result.parentPath).to.equal('/guide/php/functions/files');
});
it(
'node.parentPath should equal the path of the parent page, ' +
'prefixed with `/guide`',
() => {
expect(result.parentPath).to.equal('/guide/php/functions/files');
}
);

it('node.title should equal srcNode.frontmatter.title', () => {
expect(result.title).to.equal(mockNode.frontmatter.title);
Expand Down
1 change: 0 additions & 1 deletion client/src/client-only-routes/ShowSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,6 @@ function ShowSettings(props) {
verifyCert={verifyCert}
/>
<Spacer />
{/* <DangerZone /> */}
</main>
</Grid>
</Fragment>
Expand Down
9 changes: 5 additions & 4 deletions client/src/components/Donation/components/DonateForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import { userSelector, isSignedInSelector } from '../../../redux';

const propTypes = {
email: PropTypes.string,
isSignedIn: PropTypes.bool,
stripe: PropTypes.shape({
createToken: PropTypes.func.isRequired
})
Expand Down Expand Up @@ -120,9 +121,9 @@ class DonateForm extends Component {
}
}));

const chargeStripePath = isSignedIn ?
`/internal/donate/charge-stripe` :
`${apiLocation}/unauthenticated/donate/charge-stripe`;
const chargeStripePath = isSignedIn
? `${apiLocation}/internal/donate/charge-stripe`
: `${apiLocation}/unauthenticated/donate/charge-stripe`;
return postJSON$(chargeStripePath, {
token,
amount
Expand Down Expand Up @@ -151,7 +152,7 @@ class DonateForm extends Component {
}

resetDonation() {
return this.setState({...initialState});
return this.setState({ ...initialState });
}

renderCompletion(props) {
Expand Down
9 changes: 9 additions & 0 deletions client/src/components/Footer/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
import React from 'react';
import PropTypes from 'prop-types';
import { Link as GatsbyLink } from 'gatsby';
import { Grid, Row, Col } from '@freecodecamp/react-bootstrap';

import './footer.css';

const propTypes = {
children: PropTypes.any,
external: PropTypes.bool,
to: PropTypes.string.isRequired
};

const ColHeader = ({ children, ...other }) => (
<div className='col-header' {...other}>
{children}
</div>
);
ColHeader.propTypes = propTypes;

const Link = ({ children, to, external, ...other }) => {
if (!external && (/^\/(?!\/)/).test(to)) {
Expand All @@ -25,6 +33,7 @@ const Link = ({ children, to, external, ...other }) => {
</a>
);
};
Link.propTypes = propTypes;

function Footer() {
return (
Expand Down
8 changes: 7 additions & 1 deletion client/src/components/Map/components/Block.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,13 @@ export class Block extends Component {
}

render() {
const { blockDashedName, completedChallenges, challenges, isExpanded, intro } = this.props;
const {
blockDashedName,
completedChallenges,
challenges,
isExpanded,
intro
} = this.props;
let completedCount = 0;
const challengesWithCompleted = challenges.map(challenge => {
const { id } = challenge;
Expand Down
2 changes: 1 addition & 1 deletion client/src/components/formHelpers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
}

Expand Down
4 changes: 0 additions & 4 deletions client/src/components/settings/Certification.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,8 @@ const isCertMapSelector = createSelector(
is2018DataVisCert,
isApisMicroservicesCert,
isJsAlgoDataStructCert,
isBackEndCert,
isDataVisCert,
isFrontEndCert,
isInfosecQaCert,
isFrontEndLibsCert,
isFullStackCert,
isRespWebDesignCert
}) => ({
'Responsive Web Design': isRespWebDesignCert,
Expand Down
31 changes: 26 additions & 5 deletions client/src/head/favicons.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,53 @@ import React from 'react';
const favicons = [
<link
href='/assets/apple-touch-icon.png'
key='/assets/apple-touch-icon.png'
rel='apple-touch-icon'
sizes='180x180'
/>,
<link
href='/assets/favicon-32x32.png'
key='/assets/favicon-32x32.png'
rel='icon'
sizes='32x32'
type='image/png'
/>,
<link
href='/assets/android-chrome-192x192.png'
key='/assets/android-chrome-192x192.png'
rel='icon'
sizes='192x192'
type='image/png'
/>,
<link
href='/assets/favicon-16x16.png'
key='/assets/favicon-16x16.png'
rel='icon'
sizes='16x16'
type='image/png'
/>,
<link href='/assets/site.webmanifest' rel='manifest' />,
<link color='#006400' href='/assets/safari-pinned-tab.svg' rel='mask-icon' />,
<meta content='#006400' name='msapplication-TileColor' />,
<meta content='/assets/mstile-144x144.png' name='msapplication-TileImage' />,
<meta content='#006400' name='theme-color' />
<link
href='/assets/site.webmanifest'
key='/assets/site.webmanifest'
rel='manifest'
/>,
<link
color='#006400'
href='/assets/safari-pinned-tab.svg'
key='/assets/safari-pinned-tab.svg'
rel='mask-icon'
/>,
<meta
content='#006400'
key='msapplication-TileColor'
name='msapplication-TileColor'
/>,
<meta
content='/assets/mstile-144x144.png'
key='msapplication-TileImage'
name='msapplication-TileImage'
/>,
<meta content='#006400' key='theme-color' name='theme-color' />
];

export default favicons;
14 changes: 10 additions & 4 deletions client/src/head/meta.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
import React from 'react';

const meta = [
<meta charSet='utf-8' />,
<meta content='IE=edge' httpEquiv='X-UA-Compatible' />,
<meta content='width=device-width, initial-scale=1.0' name='viewport' />,
<meta content='summary_large_image' name='twitter:card' />,
<meta charSet='utf-8' key='charset' />,
<meta content='IE=edge' httpEquiv='X-UA-Compatible' key='IE=edge' />,
<meta
content='width=device-width, initial-scale=1.0'
key='viewport'
name='viewport'
/>,
<meta content='summary_large_image' key='twitter:card' name='twitter:card' />,
<meta
content='https://s3.amazonaws.com/freecodecamp/curriculum-diagram-full.jpg'
key='https://s3.amazonaws.com/freecodecamp/curriculum-diagram-full.jpg'
name='twitter:image:src'
/>,
<meta
content='https://s3.amazonaws.com/freecodecamp/curriculum-diagram-full.jpg'
key='https://s3.amazonaws.com/freecodecamp/curriculum-diagram-full.jpg'
property='og:image'
/>
];
Expand Down
11 changes: 3 additions & 8 deletions client/src/head/preloads.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import React from 'react';
import styleSheets from './styleSheets';

const preloads = styleSheets.map((styleSheet, i) => (
<React.Fragment>
<link
as='style'
href={styleSheet.props.href}
key={`preload-${i}`}
rel='preload'
/>
const preloads = styleSheets.map(styleSheet => (
<React.Fragment key={`preload-${styleSheet.props.href}`}>
<link as='style' href={styleSheet.props.href} rel='preload' />
{styleSheet}
</React.Fragment>
));
Expand Down
1 change: 1 addition & 0 deletions client/src/head/scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import React from 'react';
const scripts = [
<script
async=''
key='https://www.googletagmanager.com/gtag/js?id=AW-795617839'
src='https://www.googletagmanager.com/gtag/js?id=AW-795617839'
/>
];
Expand Down
7 changes: 1 addition & 6 deletions client/src/head/styleSheets.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
import React from 'react';

const styleSheets = [
// bootstrap v3.3.7
<link href='/bootstrap3/css/bootstrap.min.css' rel='stylesheet' />
];
const styleSheets = [];

export default styleSheets;
16 changes: 8 additions & 8 deletions client/src/resources/honesty-policy.js
Original file line number Diff line number Diff line change
@@ -1,43 +1,43 @@
import React from 'react';

const policy = [
<p>
<p key={1}>
Before we issue our verified certification to a camper, he or she must
accept our Academic Honesty Pledge, which reads:
</p>,
<p>
<p key={2}>
"I understand that plagiarism means copying someone else’s work and
presenting the work as if it were my own, without clearly attributing the
original author."
</p>,
<p>
<p key={3}>
"I understand that plagiarism is an act of intellectual dishonesty, and that
people usually get kicked out of university or fired from their jobs if they
get caught plagiarizing".
</p>,
<p>
<p key={4}>
"Aside from using open source libraries such as jQuery and Bootstrap, and
short snippets of code which are clearly attributed to their original
author, 100% of the code in my projects was written by me, or along with
another camper with whom I was pair programming in real time."
</p>,
<p>
<p key={5}>
"I pledge that I did not plagiarize any of my freeCodeCamp.org work. I
understand that freeCodeCamp.org’s team will audit my projects to confirm
this."
</p>,
<p>
<p key={6}>
In the situations where we discover instances of unambiguous plagiarism, we
will replace the camper in question’s certification with a message that
"Upon review, this account has been flagged for academic dishonesty."
</p>,
<p>
<p key={7}>
As an academic institution that grants achievement-based certifications, we
take academic honesty very seriously. If you have any questions about this
policy, or suspect that someone has violated it, you can email{' '}
<a href='mailto:team@freecodecamp.org'>team@freecodecamp.org</a>
&thinsp;and we will investigate.
</p>
].map((el, i) => ({...el, key: `honesty-${i}`}));
];

export default policy;
6 changes: 5 additions & 1 deletion client/src/templates/Challenges/components/Preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ class Preview extends Component {
const iframeToggle = this.state.iframeStatus ? 'disable' : 'enable';
return (
<div className={`challenge-preview ${iframeToggle}-iframe`}>
<iframe className={'challenge-preview-frame'} id={mainId} title='Challenge Preview'/>
<iframe
className={'challenge-preview-frame'}
id={mainId}
title='Challenge Preview'
/>
</div>
);
}
Expand Down
5 changes: 4 additions & 1 deletion client/src/templates/Introduction/Intro.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ function IntroductionPage({ data: { markdownRemark, allChallengeNode } }) {
/>
</FullWidthRow>
<FullWidthRow>
<Link className='btn btn-lg btn-primary btn-block' to={firstLessonPath}>
<Link
className='btn btn-lg btn-primary btn-block'
to={firstLessonPath}
>
Go to the first lesson
</Link>
<ButtonSpacer />
Expand Down

0 comments on commit 8e0237d

Please sign in to comment.