diff --git a/.eslintrc.json b/.eslintrc.json index a2a145dc2e..3921b8dec7 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -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" diff --git a/client/plugins/fcc-create-nav-data/create-navigation-node.test.js b/client/plugins/fcc-create-nav-data/create-navigation-node.test.js index 2f6e7d71f0..50fbb80d3f 100644 --- a/client/plugins/fcc-create-nav-data/create-navigation-node.test.js +++ b/client/plugins/fcc-create-nav-data/create-navigation-node.test.js @@ -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); diff --git a/client/src/client-only-routes/ShowSettings.js b/client/src/client-only-routes/ShowSettings.js index 4737d519c8..65d32cbe32 100644 --- a/client/src/client-only-routes/ShowSettings.js +++ b/client/src/client-only-routes/ShowSettings.js @@ -258,7 +258,6 @@ function ShowSettings(props) { verifyCert={verifyCert} /> - {/* */} diff --git a/client/src/components/Donation/components/DonateForm.js b/client/src/components/Donation/components/DonateForm.js index e133a04374..f3a798cd63 100644 --- a/client/src/components/Donation/components/DonateForm.js +++ b/client/src/components/Donation/components/DonateForm.js @@ -21,6 +21,7 @@ import { userSelector, isSignedInSelector } from '../../../redux'; const propTypes = { email: PropTypes.string, + isSignedIn: PropTypes.bool, stripe: PropTypes.shape({ createToken: PropTypes.func.isRequired }) @@ -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 @@ -151,7 +152,7 @@ class DonateForm extends Component { } resetDonation() { - return this.setState({...initialState}); + return this.setState({ ...initialState }); } renderCompletion(props) { diff --git a/client/src/components/Footer/index.js b/client/src/components/Footer/index.js index e36c893045..f93545a431 100644 --- a/client/src/components/Footer/index.js +++ b/client/src/components/Footer/index.js @@ -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 }) => (
{children}
); +ColHeader.propTypes = propTypes; const Link = ({ children, to, external, ...other }) => { if (!external && (/^\/(?!\/)/).test(to)) { @@ -25,6 +33,7 @@ const Link = ({ children, to, external, ...other }) => { ); }; +Link.propTypes = propTypes; function Footer() { return ( diff --git a/client/src/components/Map/components/Block.js b/client/src/components/Map/components/Block.js index eab7378195..052f3dd8c7 100644 --- a/client/src/components/Map/components/Block.js +++ b/client/src/components/Map/components/Block.js @@ -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; diff --git a/client/src/components/formHelpers/index.js b/client/src/components/formHelpers/index.js index ec9c9e182c..41e5377d6a 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/settings/Certification.js b/client/src/components/settings/Certification.js index a595f65e20..b7d7ad4456 100644 --- a/client/src/components/settings/Certification.js +++ b/client/src/components/settings/Certification.js @@ -78,12 +78,8 @@ const isCertMapSelector = createSelector( is2018DataVisCert, isApisMicroservicesCert, isJsAlgoDataStructCert, - isBackEndCert, - isDataVisCert, - isFrontEndCert, isInfosecQaCert, isFrontEndLibsCert, - isFullStackCert, isRespWebDesignCert }) => ({ 'Responsive Web Design': isRespWebDesignCert, diff --git a/client/src/head/favicons.js b/client/src/head/favicons.js index 6e05fb5071..06a3f579d5 100644 --- a/client/src/head/favicons.js +++ b/client/src/head/favicons.js @@ -3,32 +3,53 @@ import React from 'react'; const favicons = [ , , , , - , - , - , - , - + , + , + , + , + ]; export default favicons; diff --git a/client/src/head/meta.js b/client/src/head/meta.js index c614950b8f..bb788268a9 100644 --- a/client/src/head/meta.js +++ b/client/src/head/meta.js @@ -1,16 +1,22 @@ import React from 'react'; const meta = [ - , - , - , - , + , + , + , + , , ]; diff --git a/client/src/head/preloads.js b/client/src/head/preloads.js index f3c4647cb3..c38f582a4f 100644 --- a/client/src/head/preloads.js +++ b/client/src/head/preloads.js @@ -1,14 +1,9 @@ import React from 'react'; import styleSheets from './styleSheets'; -const preloads = styleSheets.map((styleSheet, i) => ( - - +const preloads = styleSheets.map(styleSheet => ( + + {styleSheet} )); diff --git a/client/src/head/scripts.js b/client/src/head/scripts.js index dbf3da2f4a..09c3064fbd 100644 --- a/client/src/head/scripts.js +++ b/client/src/head/scripts.js @@ -3,6 +3,7 @@ import React from 'react'; const scripts = [