diff --git a/.eslintrc.js b/.eslintrc.js index 92d3b44..08bfe7e 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -1,6 +1,9 @@ 'use strict'; module.exports = { + parserOptions: { + project: './tsconfig.json' + }, extends: [ '@strv/typescript', '@strv/typescript/optional', diff --git a/package.json b/package.json index 0b7e3b2..7136411 100644 --- a/package.json +++ b/package.json @@ -50,7 +50,9 @@ "@types/node": "^14.11.1", "@types/react": "^16.9.49", "@typescript-eslint/eslint-plugin": "^4.1.1", + "@typescript-eslint/parser": "^4.1.1", "eslint": "^7.9.0", + "eslint-config-prettier": "^6.11.0", "eslint-plugin-import": "^2.22.0", "eslint-plugin-prettier": "^3.1.4", "prettier": "^2.1.2", diff --git a/src/actions/DownloadActions.js b/src/actions/DownloadActions.js index de2dcdf..724ee0e 100644 --- a/src/actions/DownloadActions.js +++ b/src/actions/DownloadActions.js @@ -1,9 +1,8 @@ -import alt from '../alt' +import alt from '../alt'; export default alt.createActions(class DownloadActions { - constructor() { - this.generateActions( - 'requestDownload' - ) - } -}) + constructor() { + this.generateActions('requestDownload'); + } + }, +) diff --git a/src/actions/SupportActions.js b/src/actions/SupportActions.js index f4cfaf5..9f7be30 100644 --- a/src/actions/SupportActions.js +++ b/src/actions/SupportActions.js @@ -1,10 +1,8 @@ -import alt from '../alt' +import alt from '../alt'; export default alt.createActions(class SupportActions { - constructor() { - this.generateActions( - 'isChrome', - 'noSupport' - ) - } -}) + constructor() { + this.generateActions('isChrome', 'noSupport'); + } + }, +) diff --git a/src/actions/UploadActions.js b/src/actions/UploadActions.js index ae03df5..3440170 100644 --- a/src/actions/UploadActions.js +++ b/src/actions/UploadActions.js @@ -1,9 +1,8 @@ -import alt from '../alt' +import alt from '../alt'; export default alt.createActions(class UploadActions { - constructor() { - this.generateActions( - 'uploadFile' - ) - } -}) + constructor() { + this.generateActions('uploadFile'); + } + }, +) diff --git a/src/alt.js b/src/alt.js index e54dc88..67ce981 100644 --- a/src/alt.js +++ b/src/alt.js @@ -1,2 +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 6bff7ff..9115de6 100644 --- a/src/client.js +++ b/src/client.js @@ -2,21 +2,24 @@ import "babel-polyfill"; import "./index.styl"; import React from "react"; import ReactRouter from "react-router"; -import routes from "./routes"; -import alt from "./alt"; -import webrtcSupport from "webrtcsupport"; +import webrtcSupport from 'webrtcsupport'; +import routes from './routes'; +import alt from './alt'; import SupportActions from "./actions/SupportActions"; -let bootstrap = document.getElementById("bootstrap").innerHTML; +const bootstrap = document.getElementById("bootstrap").innerHTML; alt.bootstrap(bootstrap); window.FilePizza = () => { - ReactRouter.run(routes, ReactRouter.HistoryLocation, function(Handler) { + ReactRouter.run(routes, ReactRouter.HistoryLocation, Handler => { React.render(, document); - }); + }) + if (!webrtcSupport.support) { + SupportActions.noSupport(); + } - if (!webrtcSupport.support) SupportActions.noSupport(); - - let isChrome = navigator.userAgent.toLowerCase().indexOf("chrome") > -1; - if (isChrome) SupportActions.isChrome(); + const isChrome = navigator.userAgent.toLowerCase().includes('chrome') +;if (isChrome) { + SupportActions.isChrome() + } }; diff --git a/src/components/App.js b/src/components/App.js index 4ca3f07..d3ffc5d 100644 --- a/src/components/App.js +++ b/src/components/App.js @@ -1,14 +1,14 @@ -import Bootstrap from "./Bootstrap"; -import ErrorPage from "./ErrorPage"; import FrozenHead from "react-frozenhead"; import React from "react"; -import SupportStore from "../stores/SupportStore"; -import { RouteHandler } from "react-router"; -import ga from "react-google-analytics"; +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('send', 'pageview') } export default class App extends React.Component { @@ -18,7 +18,7 @@ export default class App extends React.Component { this._onChange = () => { this.setState(SupportStore.getState()); - }; + } } componentDidMount() { @@ -62,7 +62,13 @@ export default class App extends React.Component { - { process.env.GA_ACCESS_TOKEN ? :
} + {process.env.GA_ACCESS_TOKEN ? :
} ); diff --git a/src/components/Bootstrap.js b/src/components/Bootstrap.js index a164586..769f0e9 100644 --- a/src/components/Bootstrap.js +++ b/src/components/Bootstrap.js @@ -1,12 +1,13 @@ -import React from 'react' +import React from 'react'; export default class Bootstrap extends React.Component { - render() { - return