summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaishan <[email protected]>2020-11-13 23:03:41 +0800
committerHaishan <[email protected]>2020-11-13 23:03:41 +0800
commit3bbca8017b5de78ce982efd6d2889262bff2d7d1 (patch)
tree19550d8ef68bca2b36a92b1c6e677bd4e6418a55 /src
parent837cca81317fe7158bc1be2d07949e64d07a0293 (diff)
chore: remove husky and lint-staged
Diffstat (limited to 'src')
-rw-r--r--src/api/proxies.ts2
-rw-r--r--src/components/ContentHeader.tsx3
-rw-r--r--src/components/ErrorBoundary.tsx2
-rw-r--r--src/components/Field.tsx10
-rw-r--r--src/components/Icon.tsx8
-rw-r--r--src/components/Input.tsx11
-rw-r--r--src/components/Loading.tsx3
-rw-r--r--src/components/Logs.tsx8
-rw-r--r--src/components/Modal.tsx19
-rw-r--r--src/components/Rule.tsx9
-rw-r--r--src/components/Selection.tsx15
-rw-r--r--src/components/SvgGithub.tsx5
-rw-r--r--src/components/ToggleSwitch.tsx9
-rw-r--r--src/components/rules/RuleProviderItem.tsx1
-rw-r--r--src/components/shared/Fab.ts2
-rw-r--r--src/hooks/basic.ts2
-rw-r--r--src/misc/constants.ts3
-rw-r--r--src/store/modals.ts8
18 files changed, 62 insertions, 58 deletions
diff --git a/src/api/proxies.ts b/src/api/proxies.ts
index 72e1c52..963f8be 100644
--- a/src/api/proxies.ts
+++ b/src/api/proxies.ts
@@ -26,7 +26,7 @@ export async function requestToSwitchProxy(apiConfig, name1, name2) {
return await fetch(fullURL, {
...init,
method: 'PUT',
- body: JSON.stringify(body)
+ body: JSON.stringify(body),
});
}
diff --git a/src/components/ContentHeader.tsx b/src/components/ContentHeader.tsx
index 148a071..f786240 100644
--- a/src/components/ContentHeader.tsx
+++ b/src/components/ContentHeader.tsx
@@ -1,10 +1,9 @@
-
import React from 'react';
import s0 from './ContentHeader.module.css';
type Props = {
- title: string;
+ title: string;
};
function ContentHeader({ title }: Props) {
diff --git a/src/components/ErrorBoundary.tsx b/src/components/ErrorBoundary.tsx
index 38d90e2..f95c581 100644
--- a/src/components/ErrorBoundary.tsx
+++ b/src/components/ErrorBoundary.tsx
@@ -1,7 +1,7 @@
import * as React from 'react';
// import { getSentry } from '../misc/sentry';
-import { deriveMessageFromError,Err } from '../misc/errors';
+import { deriveMessageFromError, Err } from '../misc/errors';
import ErrorBoundaryFallback from './ErrorBoundaryFallback';
type Props = {
diff --git a/src/components/Field.tsx b/src/components/Field.tsx
index 8e2f7e3..c0b3ae5 100644
--- a/src/components/Field.tsx
+++ b/src/components/Field.tsx
@@ -6,11 +6,11 @@ import s from './Field.module.css';
const { useCallback } = React;
type Props = {
- value?: string | number;
- type?: 'text' | 'number';
- onChange?: (...args: any[]) => any;
- id?: string;
- label?: string;
+ value?: string | number;
+ type?: 'text' | 'number';
+ onChange?: (...args: any[]) => any;
+ id?: string;
+ label?: string;
};
export default function Field({ id, label, value, onChange, ...props }: Props) {
diff --git a/src/components/Icon.tsx b/src/components/Icon.tsx
index 9922e58..5085b3a 100644
--- a/src/components/Icon.tsx
+++ b/src/components/Icon.tsx
@@ -2,10 +2,10 @@ import cx from 'clsx';
import React from 'react';
type Props = {
- id: string;
- width?: number;
- height?: number;
- className?: string;
+ id: string;
+ width?: number;
+ height?: number;
+ className?: string;
};
const Icon = ({ id, width = 20, height = 20, className, ...props }: Props) => {
diff --git a/src/components/Input.tsx b/src/components/Input.tsx
index 8a8c65a..a6c44bd 100644
--- a/src/components/Input.tsx
+++ b/src/components/Input.tsx
@@ -1,4 +1,3 @@
-
import React from 'react';
import s0 from './Input.module.css';
@@ -6,11 +5,11 @@ import s0 from './Input.module.css';
const { useState, useRef, useEffect, useCallback } = React;
type InputProps = {
- value?: string | number;
- type?: string;
- onChange?: (...args: any[]) => any;
- name?: string;
- placeholder?: string;
+ value?: string | number;
+ type?: string;
+ onChange?: (...args: any[]) => any;
+ name?: string;
+ placeholder?: string;
};
export default function Input(props: InputProps) {
diff --git a/src/components/Loading.tsx b/src/components/Loading.tsx
index 7f83416..2db01da 100644
--- a/src/components/Loading.tsx
+++ b/src/components/Loading.tsx
@@ -1,10 +1,9 @@
-
import React from 'react';
import s0 from './Loading.module.css';
type Props = {
- height?: string;
+ height?: string;
};
const Loading = ({ height }: Props) => {
diff --git a/src/components/Logs.tsx b/src/components/Logs.tsx
index d563e77..5bc1f5d 100644
--- a/src/components/Logs.tsx
+++ b/src/components/Logs.tsx
@@ -26,10 +26,10 @@ const colors = {
};
type LogLineProps = {
- time?: string;
- even?: boolean;
- payload?: string;
- type?: string;
+ time?: string;
+ even?: boolean;
+ payload?: string;
+ type?: string;
};
function LogLine({ time, even, payload, type }: LogLineProps) {
diff --git a/src/components/Modal.tsx b/src/components/Modal.tsx
index 885b350..cb5fea3 100644
--- a/src/components/Modal.tsx
+++ b/src/components/Modal.tsx
@@ -5,14 +5,21 @@ import Modal from 'react-modal';
import s0 from './Modal.module.css';
type Props = {
- isOpen: boolean;
- onRequestClose: (...args: any[]) => any;
- children: React.ReactNode;
- className?: string;
- overlayClassName?: string;
+ isOpen: boolean;
+ onRequestClose: (...args: any[]) => any;
+ children: React.ReactNode;
+ className?: string;
+ overlayClassName?: string;
};
-function ModalAPIConfig({ isOpen, onRequestClose, className, overlayClassName, children, ...otherProps }: Props) {
+function ModalAPIConfig({
+ isOpen,
+ onRequestClose,
+ className,
+ overlayClassName,
+ children,
+ ...otherProps
+}: Props) {
const contentCls = cx(className, s0.content);
const overlayCls = cx(overlayClassName, s0.overlay);
return (
diff --git a/src/components/Rule.tsx b/src/components/Rule.tsx
index cf5339d..0960660 100644
--- a/src/components/Rule.tsx
+++ b/src/components/Rule.tsx
@@ -1,4 +1,3 @@
-
import React from 'react';
import s0 from './Rule.module.css';
@@ -18,10 +17,10 @@ function getStyleFor({ proxy }) {
}
type Props = {
- id?: number;
- type?: string;
- payload?: string;
- proxy?: string;
+ id?: number;
+ type?: string;
+ payload?: string;
+ proxy?: string;
};
function Rule({ type, payload, proxy, id }: Props) {
diff --git a/src/components/Selection.tsx b/src/components/Selection.tsx
index 9bcb4c8..92360c7 100644
--- a/src/components/Selection.tsx
+++ b/src/components/Selection.tsx
@@ -4,13 +4,18 @@ import React from 'react';
import s from './Selection.module.css';
type SelectionProps = {
- OptionComponent?: (...args: any[]) => any;
- optionPropsList?: any[];
- selectedIndex?: number;
- onChange?: (...args: any[]) => any;
+ OptionComponent?: (...args: any[]) => any;
+ optionPropsList?: any[];
+ selectedIndex?: number;
+ onChange?: (...args: any[]) => any;
};
-export default function Selection({ OptionComponent, optionPropsList, selectedIndex, onChange, }: SelectionProps) {
+export default function Selection({
+ OptionComponent,
+ optionPropsList,
+ selectedIndex,
+ onChange,
+}: SelectionProps) {
return (
<div className={s.root}>
{optionPropsList.map((props, idx) => {
diff --git a/src/components/SvgGithub.tsx b/src/components/SvgGithub.tsx
index b400b55..45828c2 100644
--- a/src/components/SvgGithub.tsx
+++ b/src/components/SvgGithub.tsx
@@ -1,9 +1,8 @@
-
import React from 'react';
type Props = {
- width?: number;
- height?: number;
+ width?: number;
+ height?: number;
};
export default function SvgGithub({ width = 24, height = 24 }: Props = {}) {
diff --git a/src/components/ToggleSwitch.tsx b/src/components/ToggleSwitch.tsx
index 62f3418..a7d8947 100644
--- a/src/components/ToggleSwitch.tsx
+++ b/src/components/ToggleSwitch.tsx
@@ -1,13 +1,12 @@
-
import React, { useCallback, useMemo } from 'react';
import s0 from './ToggleSwitch.module.css';
type Props = {
- options?: any[];
- value?: string;
- name?: string;
- onChange?: (...args: any[]) => any;
+ options?: any[];
+ value?: string;
+ name?: string;
+ onChange?: (...args: any[]) => any;
};
function ToggleSwitch({ options, value, name, onChange }: Props) {
diff --git a/src/components/rules/RuleProviderItem.tsx b/src/components/rules/RuleProviderItem.tsx
index 3b6d93d..8cd17d2 100644
--- a/src/components/rules/RuleProviderItem.tsx
+++ b/src/components/rules/RuleProviderItem.tsx
@@ -68,4 +68,3 @@ export function RuleProviderItem({
</div>
);
}
-
diff --git a/src/components/shared/Fab.ts b/src/components/shared/Fab.ts
index 86405f0..4e2e800 100644
--- a/src/components/shared/Fab.ts
+++ b/src/components/shared/Fab.ts
@@ -1,6 +1,6 @@
import './rtf.css';
-import { Action,Fab } from 'react-tiny-fab';
+import { Action, Fab } from 'react-tiny-fab';
export const position = {
right: 10,
diff --git a/src/hooks/basic.ts b/src/hooks/basic.ts
index c8eddbc..587d92d 100644
--- a/src/hooks/basic.ts
+++ b/src/hooks/basic.ts
@@ -4,6 +4,6 @@ const { useState, useCallback } = React;
export function useToggle(initialValue = false) {
const [isOn, setState] = useState(initialValue);
- const toggle = useCallback(() => setState(x => !x), []);
+ const toggle = useCallback(() => setState((x) => !x), []);
return [isOn, toggle];
}
diff --git a/src/misc/constants.ts b/src/misc/constants.ts
index 6ac5393..5c66350 100644
--- a/src/misc/constants.ts
+++ b/src/misc/constants.ts
@@ -1,2 +1 @@
-
-// const ProxySortingOptions =
+// const ProxySortingOptions =
diff --git a/src/store/modals.ts b/src/store/modals.ts
index 135515c..3b8b488 100644
--- a/src/store/modals.ts
+++ b/src/store/modals.ts
@@ -1,14 +1,14 @@
export function openModal(modalName) {
- return dispatch => {
- dispatch(`openModal:${modalName}`, s => {
+ return (dispatch) => {
+ dispatch(`openModal:${modalName}`, (s) => {
s.modals[modalName] = true;
});
};
}
export function closeModal(modalName) {
- return dispatch => {
- dispatch(`closeModal:${modalName}`, s => {
+ return (dispatch) => {
+ dispatch(`closeModal:${modalName}`, (s) => {
s.modals[modalName] = false;
});
};