From 3efe3d20f786958a601c2e8988eb82a6fe164723 Mon Sep 17 00:00:00 2001 From: Dhruvdutt Jadhav Date: Tue, 27 Feb 2018 01:35:02 +0530 Subject: [PATCH] chore: fix linting issues (#570) --- client/modules/IDE/components/About.jsx | 2 +- .../modules/IDE/components/PreviewFrame.jsx | 4 +- server/examples-gg-latest.js | 57 +++++++++++-------- 3 files changed, 36 insertions(+), 27 deletions(-) diff --git a/client/modules/IDE/components/About.jsx b/client/modules/IDE/components/About.jsx index 281e0d99..ee0b78f6 100644 --- a/client/modules/IDE/components/About.jsx +++ b/client/modules/IDE/components/About.jsx @@ -3,7 +3,7 @@ import InlineSVG from 'react-inlinesvg'; import { Helmet } from 'react-helmet'; const squareLogoUrl = require('../../../images/p5js-square-logo.svg'); -const playUrl = require('../../../images/play.svg'); +// const playUrl = require('../../../images/play.svg'); const asteriskUrl = require('../../../images/p5-asterisk.svg'); function About(props) { diff --git a/client/modules/IDE/components/PreviewFrame.jsx b/client/modules/IDE/components/PreviewFrame.jsx index e7a114f5..93d83aec 100644 --- a/client/modules/IDE/components/PreviewFrame.jsx +++ b/client/modules/IDE/components/PreviewFrame.jsx @@ -204,7 +204,9 @@ class PreviewFrame extends React.Component { '/hijackConsole.js' ]; const accessiblelib = sketchDoc.createElement('script'); - accessiblelib.setAttribute('src', 'https://cdn.rawgit.com/MathuraMG/p5-accessibility/9cb5bd0b/dist/p5-accessibility.js'); + accessiblelib.setAttribute( + 'src', 'https://cdn.rawgit.com/MathuraMG/p5-accessibility/9cb5bd0b/dist/p5-accessibility.js' + ); const accessibleOutputs = sketchDoc.createElement('section'); accessibleOutputs.setAttribute('id', 'accessible-outputs'); accessibleOutputs.style.position = 'absolute'; diff --git a/server/examples-gg-latest.js b/server/examples-gg-latest.js index 5957a669..c5a04aed 100644 --- a/server/examples-gg-latest.js +++ b/server/examples-gg-latest.js @@ -3,6 +3,7 @@ import Q from 'q'; import mongoose from 'mongoose'; import objectID from 'bson-objectid'; import shortid from 'shortid'; + import eachSeries from 'async/eachSeries'; import User from './models/user'; import Project from './models/project'; @@ -89,15 +90,16 @@ const insert = function insert(_mainString, _insString, _pos) { // TEMP: GATHER DATA FROM STATIC FILE // - to save time use local json file for now - -const fs = require('fs'); +// const fs = require('fs'); // gg-github-retrieval.json // gg-github-newProjects.json -function retrieveDataTemp(fName) { - return new Promise((resolve, reject) => { - const ggdata = `${__dirname}/${fName}`; - resolve(JSON.parse(fs.readFileSync(ggdata))); - }); -} + +// function retrieveDataTemp(fName) { +// return new Promise((resolve, reject) => { +// const ggdata = `${__dirname}/${fName}`; +// resolve(JSON.parse(fs.readFileSync(ggdata))); +// }); +// } /* --- data processing --- */ // 1. first get the top level directories P and M @@ -194,7 +196,7 @@ function appendSketchItemLinks(sketchList) { // 4. for each sketch item function getSketchItems(sketchList) { - const completeSketchPkg = []; + // const completeSketchPkg = []; /* eslint-disable */ return Q.all(sketchList[0].map(sketch => Q.all(sketch.tree.map((item) => { @@ -304,7 +306,10 @@ function formatSketchForStorage(sketch, user) { // add the ID to the root children id array output[0].children.push(projectItem.id); // add the JS reference to the defaultHTML - output[2].content = insert(output[2].content, ``, output[2].content.search('')); + output[2].content = insert( + output[2].content, ``, + output[2].content.search('') + ); } }); @@ -543,26 +548,27 @@ output etc // } // checking function -function doNext(output) { - console.log(JSON.stringify(output)); - console.log(output.length); -} +// function doNext(output) { +// console.log(JSON.stringify(output)); +// console.log(output.length); +// } // save output to terminal -function saveRetrievalToFile(output) { - return new Promise((resolve, reject) => { - fs.writeFileSync('server/gg-github-raw.json', JSON.stringify(output)); - resolve(output); - }); -} +// function saveRetrievalToFile(output) { +// return new Promise((resolve, reject) => { +// fs.writeFileSync('server/gg-github-raw.json', JSON.stringify(output)); +// resolve(output); +// }); +// } // save output to terminal -function saveNewProjectsToFile(output) { - return new Promise((resolve, reject) => { - fs.writeFileSync('server/gg-github-newProjects.json', JSON.stringify(output)); - resolve(output); - }); -} +// function saveNewProjectsToFile(output) { +// return new Promise((resolve, reject) => { +// fs.writeFileSync('server/gg-github-newProjects.json', JSON.stringify(output)); +// resolve(output); +// }); +// } + // test make without deleting all projects etc // function make() { // return retrieveDataTemp('gg-github-retrieval.json') @@ -571,4 +577,5 @@ function saveNewProjectsToFile(output) { // .then(linkToFontFiles) // .then(saveToFile); // } + // make();