fix even more linting errors

This commit is contained in:
Cassie Tarakajian 2018-05-04 17:59:43 -07:00
parent 5057a901fe
commit bd303b7710
6 changed files with 7 additions and 10 deletions

View file

@ -22,9 +22,6 @@ class EmailVerificationView extends React.Component {
this.closeLoginPage = this.closeLoginPage.bind(this); this.closeLoginPage = this.closeLoginPage.bind(this);
this.gotoHomePage = this.gotoHomePage.bind(this); this.gotoHomePage = this.gotoHomePage.bind(this);
this.state = {
error: null,
};
} }
componentWillMount() { componentWillMount() {

View file

@ -88,7 +88,7 @@ export function signS3(req, res) {
} }
export function copyObjectInS3(req, res) { export function copyObjectInS3(req, res) {
const url = req.body.url; const { url } = req.body;
const objectKey = getObjectKey(url); const objectKey = getObjectKey(url);
const fileExtension = getExtension(objectKey); const fileExtension = getExtension(objectKey);
const newFilename = uuid.v4() + fileExtension; const newFilename = uuid.v4() + fileExtension;
@ -109,7 +109,7 @@ export function copyObjectInS3(req, res) {
} }
export function listObjectsInS3ForUser(req, res) { export function listObjectsInS3ForUser(req, res) {
const username = req.params.username; const { username } = req.params;
findUserByUsername(username, (user) => { findUserByUsername(username, (user) => {
const userId = user.id; const userId = user.id;
const params = { const params = {

View file

@ -15,7 +15,7 @@ export function serveProject(req, res) {
return; return;
} }
// TODO this does not parse html // TODO this does not parse html
const files = project.files; const { files } = project;
const htmlFile = files.find(file => file.name.match(/\.html$/i)).content; const htmlFile = files.find(file => file.name.match(/\.html$/i)).content;
const filesToInject = files.filter(file => file.name.match(/\.(js|css)$/i)); const filesToInject = files.filter(file => file.name.match(/\.(js|css)$/i));
injectMediaUrls(filesToInject, files, req.params.project_id); injectMediaUrls(filesToInject, files, req.params.project_id);

View file

@ -249,7 +249,7 @@ function bundleExternalLibs(project, zip, callback) {
function resolveScriptTagSrc(scriptTag, document) { function resolveScriptTagSrc(scriptTag, document) {
const path = scriptTag.src.split('/'); const path = scriptTag.src.split('/');
const filename = path[path.length - 1]; const filename = path[path.length - 1];
const src = scriptTag.src; const { src } = scriptTag;
if (!isUrl(src)) { if (!isUrl(src)) {
numScriptsResolved += 1; numScriptsResolved += 1;
@ -286,7 +286,7 @@ function buildZip(project, req, res) {
const zip = archiver('zip'); const zip = archiver('zip');
const rootFile = project.files.find(file => file.name === 'root'); const rootFile = project.files.find(file => file.name === 'root');
const numFiles = project.files.filter(file => file.fileType !== 'folder').length; const numFiles = project.files.filter(file => file.fileType !== 'folder').length;
const files = project.files; const { files } = project;
let numCompletedFiles = 0; let numCompletedFiles = 0;
zip.on('error', (err) => { zip.on('error', (err) => {

View file

@ -2,7 +2,7 @@ import mongoose from 'mongoose';
import shortid from 'shortid'; import shortid from 'shortid';
import slugify from 'slugify'; import slugify from 'slugify';
const Schema = mongoose.Schema; const { Schema } = mongoose;
const fileSchema = new Schema({ const fileSchema = new Schema({
name: { type: String, default: 'sketch.js' }, name: { type: String, default: 'sketch.js' },

View file

@ -8,7 +8,7 @@ const EmailConfirmationStates = {
Resent: 'resent', Resent: 'resent',
}; };
const Schema = mongoose.Schema; const { Schema } = mongoose;
const userSchema = new Schema({ const userSchema = new Schema({
name: { type: String, default: '' }, name: { type: String, default: '' },