chore: fix linting issues (#570)

This commit is contained in:
Dhruvdutt Jadhav 2018-02-27 01:35:02 +05:30 committed by Cassie Tarakajian
parent 4628b38be0
commit 3efe3d20f7
3 changed files with 36 additions and 27 deletions

View file

@ -3,7 +3,7 @@ import InlineSVG from 'react-inlinesvg';
import { Helmet } from 'react-helmet'; import { Helmet } from 'react-helmet';
const squareLogoUrl = require('../../../images/p5js-square-logo.svg'); 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'); const asteriskUrl = require('../../../images/p5-asterisk.svg');
function About(props) { function About(props) {

View file

@ -204,7 +204,9 @@ class PreviewFrame extends React.Component {
'/hijackConsole.js' '/hijackConsole.js'
]; ];
const accessiblelib = sketchDoc.createElement('script'); 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'); const accessibleOutputs = sketchDoc.createElement('section');
accessibleOutputs.setAttribute('id', 'accessible-outputs'); accessibleOutputs.setAttribute('id', 'accessible-outputs');
accessibleOutputs.style.position = 'absolute'; accessibleOutputs.style.position = 'absolute';

View file

@ -3,6 +3,7 @@ import Q from 'q';
import mongoose from 'mongoose'; import mongoose from 'mongoose';
import objectID from 'bson-objectid'; import objectID from 'bson-objectid';
import shortid from 'shortid'; import shortid from 'shortid';
import eachSeries from 'async/eachSeries'; import eachSeries from 'async/eachSeries';
import User from './models/user'; import User from './models/user';
import Project from './models/project'; import Project from './models/project';
@ -89,15 +90,16 @@ const insert = function insert(_mainString, _insString, _pos) {
// TEMP: GATHER DATA FROM STATIC FILE // TEMP: GATHER DATA FROM STATIC FILE
// - to save time use local json file for now - // - to save time use local json file for now -
const fs = require('fs'); // const fs = require('fs');
// gg-github-retrieval.json // gg-github-retrieval.json
// gg-github-newProjects.json // gg-github-newProjects.json
function retrieveDataTemp(fName) {
return new Promise((resolve, reject) => { // function retrieveDataTemp(fName) {
const ggdata = `${__dirname}/${fName}`; // return new Promise((resolve, reject) => {
resolve(JSON.parse(fs.readFileSync(ggdata))); // const ggdata = `${__dirname}/${fName}`;
}); // resolve(JSON.parse(fs.readFileSync(ggdata)));
} // });
// }
/* --- data processing --- */ /* --- data processing --- */
// 1. first get the top level directories P and M // 1. first get the top level directories P and M
@ -194,7 +196,7 @@ function appendSketchItemLinks(sketchList) {
// 4. for each sketch item // 4. for each sketch item
function getSketchItems(sketchList) { function getSketchItems(sketchList) {
const completeSketchPkg = []; // const completeSketchPkg = [];
/* eslint-disable */ /* eslint-disable */
return Q.all(sketchList[0].map(sketch => Q.all(sketch.tree.map((item) => { 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 // add the ID to the root children id array
output[0].children.push(projectItem.id); output[0].children.push(projectItem.id);
// add the JS reference to the defaultHTML // add the JS reference to the defaultHTML
output[2].content = insert(output[2].content, `<script src='${item.name}'></script>`, output[2].content.search('<!-- sketch additions -->')); output[2].content = insert(
output[2].content, `<script src='${item.name}'></script>`,
output[2].content.search('<!-- sketch additions -->')
);
} }
}); });
@ -543,26 +548,27 @@ output etc
// } // }
// checking function // checking function
function doNext(output) { // function doNext(output) {
console.log(JSON.stringify(output)); // console.log(JSON.stringify(output));
console.log(output.length); // console.log(output.length);
} // }
// save output to terminal // save output to terminal
function saveRetrievalToFile(output) { // function saveRetrievalToFile(output) {
return new Promise((resolve, reject) => { // return new Promise((resolve, reject) => {
fs.writeFileSync('server/gg-github-raw.json', JSON.stringify(output)); // fs.writeFileSync('server/gg-github-raw.json', JSON.stringify(output));
resolve(output); // resolve(output);
}); // });
} // }
// save output to terminal // save output to terminal
function saveNewProjectsToFile(output) { // function saveNewProjectsToFile(output) {
return new Promise((resolve, reject) => { // return new Promise((resolve, reject) => {
fs.writeFileSync('server/gg-github-newProjects.json', JSON.stringify(output)); // fs.writeFileSync('server/gg-github-newProjects.json', JSON.stringify(output));
resolve(output); // resolve(output);
}); // });
} // }
// test make without deleting all projects etc // test make without deleting all projects etc
// function make() { // function make() {
// return retrieveDataTemp('gg-github-retrieval.json') // return retrieveDataTemp('gg-github-retrieval.json')
@ -571,4 +577,5 @@ function saveNewProjectsToFile(output) {
// .then(linkToFontFiles) // .then(linkToFontFiles)
// .then(saveToFile); // .then(saveToFile);
// } // }
// make(); // make();