From 0dc1b6fa04c71bb06bd675adc8c208ebdd2fcdec Mon Sep 17 00:00:00 2001
From: Alex Kern
Date: Sun, 20 Sep 2020 17:27:08 -0700
Subject: [PATCH] prettier
---
.eslintrc.js | 3 +-
.prettierrc.js | 9 +++
pages/download/[...slug].tsx | 7 ++
src/actions/DownloadActions.js | 7 +-
src/actions/SupportActions.js | 7 +-
src/actions/UploadActions.js | 7 +-
src/alt.js | 2 +-
src/client.js | 28 ++++----
src/components/App.js | 44 ++++++------
src/components/Bootstrap.js | 2 +-
src/components/DownloadButton.js | 2 +-
src/components/DownloadPage.js | 20 +++---
src/components/DropZone.js | 4 +-
src/components/ErrorPage.js | 8 +--
src/components/Tempalink.js | 9 ++-
src/components/Uploader.js | 8 +--
src/ice.js | 51 --------------
src/ice.ts | 52 ++++++++++++++
src/index.js | 13 ++--
src/middleware/bootstrap.js | 16 +++--
src/middleware/error.js | 11 ++-
src/middleware/javascript.js | 16 +++--
src/middleware/react.js | 21 +++---
src/middleware/static.js | 10 +--
src/routes.js | 12 ++--
src/server.js | 113 ++++++++++++++++---------------
src/stores/DownloadStore.js | 42 ++++++------
src/stores/ErrorStore.js | 12 ++--
src/stores/SupportStore.js | 10 +--
src/stores/UploadStore.js | 58 ++++++++--------
src/toppings.js | 100 ---------------------------
src/toppings.ts | 100 +++++++++++++++++++++++++++
src/{util.js => util.ts} | 6 +-
src/{wt.js => wt.ts} | 4 +-
34 files changed, 419 insertions(+), 395 deletions(-)
create mode 100644 .prettierrc.js
create mode 100644 pages/download/[...slug].tsx
delete mode 100644 src/ice.js
create mode 100644 src/ice.ts
delete mode 100644 src/toppings.js
create mode 100644 src/toppings.ts
rename src/{util.js => util.ts} (82%)
rename src/{wt.js => wt.ts} (83%)
diff --git a/.eslintrc.js b/.eslintrc.js
index 08bfe7e..95f0ce9 100644
--- a/.eslintrc.js
+++ b/.eslintrc.js
@@ -1,8 +1,9 @@
'use strict';
module.exports = {
+ parser: '@typescript-eslint/parser',
parserOptions: {
- project: './tsconfig.json'
+ project: './tsconfig.json',
},
extends: [
'@strv/typescript',
diff --git a/.prettierrc.js b/.prettierrc.js
new file mode 100644
index 0000000..5f64564
--- /dev/null
+++ b/.prettierrc.js
@@ -0,0 +1,9 @@
+'use strict';
+
+module.exports = {
+ semi: false,
+ trailingComma: 'all',
+ singleQuote: true,
+ printWidth: 80,
+ tabWidth: 2,
+};
diff --git a/pages/download/[...slug].tsx b/pages/download/[...slug].tsx
new file mode 100644
index 0000000..402a959
--- /dev/null
+++ b/pages/download/[...slug].tsx
@@ -0,0 +1,7 @@
+import React from 'react';
+
+const DownloadPage = () => {
+ return
+}
+
+export default DownloadPage
diff --git a/src/actions/DownloadActions.js b/src/actions/DownloadActions.js
index 724ee0e..6d0fe5e 100644
--- a/src/actions/DownloadActions.js
+++ b/src/actions/DownloadActions.js
@@ -1,8 +1,7 @@
-import alt from '../alt';
+import alt from '../alt'
export default alt.createActions(class DownloadActions {
constructor() {
- this.generateActions('requestDownload');
+ this.generateActions('requestDownload')
}
- },
-)
+ })
diff --git a/src/actions/SupportActions.js b/src/actions/SupportActions.js
index 9f7be30..9c4e1bd 100644
--- a/src/actions/SupportActions.js
+++ b/src/actions/SupportActions.js
@@ -1,8 +1,7 @@
-import alt from '../alt';
+import alt from '../alt'
export default alt.createActions(class SupportActions {
constructor() {
- this.generateActions('isChrome', 'noSupport');
+ this.generateActions('isChrome', 'noSupport')
}
- },
-)
+ })
diff --git a/src/actions/UploadActions.js b/src/actions/UploadActions.js
index 3440170..96a7bb8 100644
--- a/src/actions/UploadActions.js
+++ b/src/actions/UploadActions.js
@@ -1,8 +1,7 @@
-import alt from '../alt';
+import alt from '../alt'
export default alt.createActions(class UploadActions {
constructor() {
- this.generateActions('uploadFile');
+ this.generateActions('uploadFile')
}
- },
-)
+ })
diff --git a/src/alt.js b/src/alt.js
index 67ce981..714e2eb 100644
--- a/src/alt.js
+++ b/src/alt.js
@@ -1,3 +1,3 @@
-import Alt from 'alt';
+import Alt from 'alt'
export default new Alt()
diff --git a/src/client.js b/src/client.js
index 9115de6..fa3c975 100644
--- a/src/client.js
+++ b/src/client.js
@@ -1,25 +1,25 @@
-import "babel-polyfill";
-import "./index.styl";
-import React from "react";
-import ReactRouter from "react-router";
-import webrtcSupport from 'webrtcsupport';
-import routes from './routes';
-import alt from './alt';
-import SupportActions from "./actions/SupportActions";
+import 'babel-polyfill'
+import './index.styl'
+import React from 'react'
+import ReactRouter from 'react-router'
+import webrtcSupport from 'webrtcsupport'
+import routes from './routes'
+import alt from './alt'
+import SupportActions from './actions/SupportActions'
-const bootstrap = document.getElementById("bootstrap").innerHTML;
-alt.bootstrap(bootstrap);
+const bootstrap = document.getElementById('bootstrap').innerHTML
+alt.bootstrap(bootstrap)
window.FilePizza = () => {
ReactRouter.run(routes, ReactRouter.HistoryLocation, Handler => {
- React.render(, document);
+ React.render(, document)
})
if (!webrtcSupport.support) {
- SupportActions.noSupport();
+ SupportActions.noSupport()
}
const isChrome = navigator.userAgent.toLowerCase().includes('chrome')
-;if (isChrome) {
+ if (isChrome) {
SupportActions.isChrome()
}
-};
+}
diff --git a/src/components/App.js b/src/components/App.js
index d3ffc5d..a772378 100644
--- a/src/components/App.js
+++ b/src/components/App.js
@@ -1,32 +1,32 @@
-import FrozenHead from "react-frozenhead";
-import React from "react";
-import { RouteHandler } from 'react-router';
-import ga from 'react-google-analytics';
-import SupportStore from '../stores/SupportStore';
-import ErrorPage from "./ErrorPage";
-import Bootstrap from './Bootstrap';
+import FrozenHead from 'react-frozenhead'
+import React from 'react'
+import { RouteHandler } from 'react-router'
+import ga from 'react-google-analytics'
+import SupportStore from '../stores/SupportStore'
+import ErrorPage from './ErrorPage'
+import Bootstrap from './Bootstrap'
if (process.env.GA_ACCESS_TOKEN) {
- ga("create", process.env.GA_ACCESS_TOKEN, "auto");
- ;;ga('send', 'pageview')
+ ga('create', process.env.GA_ACCESS_TOKEN, 'auto')
+ ga('send', 'pageview')
}
export default class App extends React.Component {
constructor() {
- super();
- this.state = SupportStore.getState();
+ super()
+ this.state = SupportStore.getState()
this._onChange = () => {
- this.setState(SupportStore.getState());
+ this.setState(SupportStore.getState())
}
}
componentDidMount() {
- SupportStore.listen(this._onChange);
+ SupportStore.listen(this._onChange)
}
componentWillUnmount() {
- SupportStore.unlisten(this._onChange);
+ SupportStore.unlisten(this._onChange)
}
render() {
@@ -72,19 +72,19 @@ export default class App extends React.Component {
- Cooked up by{" "}
+ Cooked up by{' '}
Alex Kern
- {" "}
- &{" "}
+ {' '}
+ &{' '}
Neeraj Baid
- {" "}
- while eating Sliver @ UC Berkeley ·{" "}
+ {' '}
+ while eating Sliver @ UC Berkeley ·{' '}
FAQ
- {" "}
- ·{" "}
+ {' '}
+ ·{' '}
Fork us
@@ -94,6 +94,6 @@ export default class App extends React.Component {
{process.env.GA_ACCESS_TOKEN ? :
}