diff --git a/packages/learn/gatsby-browser.js b/packages/learn/gatsby-browser.js
index 49da8624f1..a685e9d0bd 100644
--- a/packages/learn/gatsby-browser.js
+++ b/packages/learn/gatsby-browser.js
@@ -6,11 +6,7 @@ import { createStore } from './src/redux/store';
export const wrapRootElement = ({ element }) => {
const store = createStore();
- const ConnectedRootElement = (
-
- {element}
-
- );
+ const ConnectedRootElement = {element};
return ConnectedRootElement;
};
diff --git a/packages/learn/gatsby-node.js b/packages/learn/gatsby-node.js
index 3d0ab4c410..66f60ec146 100644
--- a/packages/learn/gatsby-node.js
+++ b/packages/learn/gatsby-node.js
@@ -107,18 +107,19 @@ const MonacoWebpackPlugin = require('monaco-editor-webpack-plugin');
exports.onCreateWebpackConfig = ({ stage, rules, plugins, actions }) => {
actions.setWebpackConfig({
module: {
- rules: [rules.js({
- /* eslint-disable max-len */
- exclude: modulePath => {
- return (
- /node_modules/.test(modulePath) &&
- !(/(ansi-styles|chalk|strict-uri-encode|react-freecodecamp-search)/).test(
- modulePath
- )
- );
- }
- /* eslint-enable max-len*/
- })
+ rules: [
+ rules.js({
+ /* eslint-disable max-len */
+ exclude: modulePath => {
+ return (
+ /node_modules/.test(modulePath) &&
+ !(/(ansi-styles|chalk|strict-uri-encode|react-freecodecamp-search)/).test(
+ modulePath
+ )
+ );
+ }
+ /* eslint-enable max-len*/
+ })
]
},
node: {
@@ -136,9 +137,7 @@ exports.onCreateWebpackConfig = ({ stage, rules, plugins, actions }) => {
});
if (stage !== 'build-html') {
actions.setWebpackConfig({
- plugins: [
- new MonacoWebpackPlugin()
- ]
+ plugins: [new MonacoWebpackPlugin()]
});
}
if (stage === 'build-html') {
diff --git a/packages/learn/gatsby-ssr.js b/packages/learn/gatsby-ssr.js
index 70698adc6e..a53d9824eb 100644
--- a/packages/learn/gatsby-ssr.js
+++ b/packages/learn/gatsby-ssr.js
@@ -6,10 +6,7 @@ import headComponents from './src/head';
import { createStore } from './src/redux/store';
-export const replaceRenderer = ({
- bodyComponent,
- replaceBodyHTMLString
-}) => {
+export const replaceRenderer = ({ bodyComponent, replaceBodyHTMLString }) => {
const store = createStore();
const ConnectedBody = () => (
diff --git a/packages/learn/src/__mocks__/monacoEditorMock.js b/packages/learn/src/__mocks__/monacoEditorMock.js
index 8766737768..b12f1c69c1 100644
--- a/packages/learn/src/__mocks__/monacoEditorMock.js
+++ b/packages/learn/src/__mocks__/monacoEditorMock.js
@@ -1,18 +1,15 @@
/* eslint-disable */
import React from 'react';
-export default (props) => {
+export default props => {
const { width = '100%', height = '100%' } = props;
- const fixedWidth = width.toString().indexOf('%') !== -1 ?
- width : `${width}px`;
- const fixedHeight = height.toString().indexOf('%') !== -1 ?
- height : `${height}px`;
+ const fixedWidth =
+ width.toString().indexOf('%') !== -1 ? width : `${width}px`;
+ const fixedHeight =
+ height.toString().indexOf('%') !== -1 ? height : `${height}px`;
const style = {
width: fixedWidth,
height: fixedHeight
- }; return (
-
- );
-}
+ };
+ return ;
+};
diff --git a/packages/learn/src/head/sassjs.js b/packages/learn/src/head/sassjs.js
index 9a338babff..cf8c101a45 100644
--- a/packages/learn/src/head/sassjs.js
+++ b/packages/learn/src/head/sassjs.js
@@ -1,8 +1,7 @@
import React from 'react';
const cdnAddr =
- 'https://cdnjs.cloudflare.com/ajax/libs/sass.js/' +
- '0.10.9/sass.sync.min.js';
+ 'https://cdnjs.cloudflare.com/ajax/libs/sass.js/0.10.9/sass.sync.min.js';
const sassjs = [];
diff --git a/packages/learn/src/redux/store.js b/packages/learn/src/redux/store.js
index 98d3dddafe..2575a1ffa1 100644
--- a/packages/learn/src/redux/store.js
+++ b/packages/learn/src/redux/store.js
@@ -1,3 +1,6 @@
+/* eslint-disable-next-line max-len */
+import { composeWithDevTools } from 'redux-devtools-extension/logOnlyInProduction';
+
import {
createStore as reduxCreateStore,
combineReducers,
@@ -6,9 +9,6 @@ import {
import { combineEpics, createEpicMiddleware } from 'redux-observable';
import { reducer as formReducer } from 'redux-form';
-import {
- composeWithDevTools
-} from 'redux-devtools-extension/logOnlyInProduction';
import { reducer as app, epics as appEpics } from './app';
import {
@@ -50,6 +50,5 @@ const composeEnhancers = composeWithDevTools({
export const createStore = () =>
reduxCreateStore(
rootReducer,
- composeEnhancers(
- applyMiddleware(epicMiddleware)
- ));
+ composeEnhancers(applyMiddleware(epicMiddleware))
+ );
diff --git a/packages/learn/src/templates/Challenges/components/CompletionModal.js b/packages/learn/src/templates/Challenges/components/CompletionModal.js
index cbde4fde76..9d95d49ec1 100644
--- a/packages/learn/src/templates/Challenges/components/CompletionModal.js
+++ b/packages/learn/src/templates/Challenges/components/CompletionModal.js
@@ -76,10 +76,13 @@ export class CompletionModal extends PureComponent {
const showDownloadButton = Object.keys(files).length;
const filesForDownload = Object.keys(files)
.map(key => files[key])
- .reduce((allFiles, { path, contents }) => ({
- ...allFiles,
- [path]: contents
- }), {});
+ .reduce(
+ (allFiles, { path, contents }) => ({
+ ...allFiles,
+ [path]: contents
+ }),
+ {}
+ );
const dashedName = dasherize(title);
return (
Submit and go to next challenge (Ctrl + Enter)
- {showDownloadButton
- ?
- : null
- }
+ {showDownloadButton ? (
+
+ ) : null}
);
diff --git a/packages/learn/src/templates/Challenges/components/Side-Panel.js b/packages/learn/src/templates/Challenges/components/Side-Panel.js
index f79f63e2c7..4a7db77cf3 100644
--- a/packages/learn/src/templates/Challenges/components/Side-Panel.js
+++ b/packages/learn/src/templates/Challenges/components/Side-Panel.js
@@ -52,14 +52,20 @@ export class SidePanel extends PureComponent {
}
componentDidMount() {
- MathJax.Hub.Queue(['Typeset', MathJax.Hub,
- document.querySelector('.rosetta-code')]);
+ MathJax.Hub.Queue([
+ 'Typeset',
+ MathJax.Hub,
+ document.querySelector('.rosetta-code')
+ ]);
this.props.initConsole('');
}
componentDidUpdate(prevProps) {
- MathJax.Hub.Queue(['Typeset', MathJax.Hub,
- document.querySelector('.rosetta-code')]);
+ MathJax.Hub.Queue([
+ 'Typeset',
+ MathJax.Hub,
+ document.querySelector('.rosetta-code')
+ ]);
const { title, initConsole } = this.props;
if (title !== prevProps.title) {
initConsole('');
diff --git a/packages/learn/src/templates/Challenges/rechallenge/transformers.js b/packages/learn/src/templates/Challenges/rechallenge/transformers.js
index c364636d13..239b83f83d 100644
--- a/packages/learn/src/templates/Challenges/rechallenge/transformers.js
+++ b/packages/learn/src/templates/Challenges/rechallenge/transformers.js
@@ -92,20 +92,23 @@ const htmlSassTransformCode = file => {
let doc = document.implementation.createHTMLDocument();
doc.body.innerHTML = file.contents;
let styleTags = [].filter.call(
- doc.querySelectorAll('style'),
- style => style.type === 'text/sass'
+ doc.querySelectorAll('style'),
+ style => style.type === 'text/sass'
);
if (styleTags.length === 0 || typeof Sass === 'undefined') {
return vinyl.transformContents(() => doc.body.innerHTML, file);
}
return styleTags.reduce((obs, style) => {
- return obs.flatMap(file => new Promise(resolve => {
- window.Sass.compile(style.innerHTML, function(result) {
- style.type = 'text/css';
- style.innerHTML = result.text;
- resolve(vinyl.transformContents(() => doc.body.innerHTML, file));
- });
- }));
+ return obs.flatMap(
+ file =>
+ new Promise(resolve => {
+ window.Sass.compile(style.innerHTML, function(result) {
+ style.type = 'text/css';
+ style.innerHTML = result.text;
+ resolve(vinyl.transformContents(() => doc.body.innerHTML, file));
+ });
+ })
+ );
}, Observable.of(file));
};