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';
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) {

View file

@ -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';

View file

@ -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, `<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
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();