mirror of
https://github.com/zhigang1992/connect.git
synced 2026-01-13 09:00:27 +08:00
fix: lint
This commit is contained in:
committed by
Thomas Osmonson
parent
4ce2b41f81
commit
fd708ff79f
@@ -15,6 +15,7 @@
|
||||
"lint:eslint": "eslint packages/**/*.{ts,tsx}",
|
||||
"lint:fix": "eslint --ext .ts,.tsx . -f unix --fix && prettier --write **/*.{ts,tsx} *.js",
|
||||
"lint:prettier": "prettier --check **/*.{ts,tsx} *.js",
|
||||
"lint:prettier:fix": "prettier --write **/*.{ts,tsx} *.js",
|
||||
"version": "lerna bootstrap"
|
||||
},
|
||||
"prettier": "@blockstack/prettier-config",
|
||||
|
||||
@@ -26,6 +26,5 @@ if (EXT_ENV === 'web') {
|
||||
buildApp(store);
|
||||
} else {
|
||||
const store = ExtStore();
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
store.ready().then(() => buildApp(store));
|
||||
}
|
||||
|
||||
@@ -25,8 +25,7 @@ const ContinueWithAuth: React.FC = props => {
|
||||
bg={hovered ? 'rgba(0,0,0,0.02)' : 'white'}
|
||||
transform={hovered ? 'translateY(-2px)' : 'none'}
|
||||
onClick={() => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
||||
authenticate({ ...authOptions, sendToSignIn: true });
|
||||
void authenticate({ ...authOptions, sendToSignIn: true });
|
||||
}}
|
||||
{...bind}
|
||||
{...props}
|
||||
|
||||
@@ -14,7 +14,10 @@ const types = [
|
||||
];
|
||||
|
||||
const transformTextStyle = (value: string) =>
|
||||
value.replace(' ', '.').replace(' ', '.').toLowerCase();
|
||||
value
|
||||
.replace(' ', '.')
|
||||
.replace(' ', '.')
|
||||
.toLowerCase();
|
||||
|
||||
const Cell = ({ ...rest }: any) => (
|
||||
<Box width={1 / 5}>
|
||||
|
||||
@@ -26,9 +26,9 @@ const Tokens = ({
|
||||
showLineNumbers?: boolean;
|
||||
}) => {
|
||||
const bsTheme = useTheme();
|
||||
const pl = `calc(${showLineNumbers ? lineNumberWidth : '0'}px + ${
|
||||
(bsTheme as any).sizes['base'] || '16px'
|
||||
})`;
|
||||
const pl = `calc(${showLineNumbers ? lineNumberWidth : '0'}px + ${(bsTheme as any).sizes[
|
||||
'base'
|
||||
] || '16px'})`;
|
||||
|
||||
return (
|
||||
<Box pl={pl} pr="base" position="relative" zIndex={2} {...rest}>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// @ts-nocheck
|
||||
import Prism from 'prismjs';
|
||||
|
||||
(function (Prism) {
|
||||
(function(Prism) {
|
||||
// Functions to construct regular expressions
|
||||
// simple form
|
||||
// e.g. (interactive ... or (interactive)
|
||||
|
||||
@@ -79,7 +79,7 @@ interface ModalCardContainerProps extends FlexProps {
|
||||
isOpen: boolean;
|
||||
noAnimation: boolean;
|
||||
}
|
||||
// eslint-disable-next-line react/display-name
|
||||
|
||||
const ModalCardContainer = React.forwardRef<any, ModalCardContainerProps>(
|
||||
({ noAnimation, isOpen, ...rest }, ref) => (
|
||||
<Flex
|
||||
|
||||
@@ -128,7 +128,9 @@ export function mergeRefs<T>(...refs: (ReactRef<T> | undefined)[]) {
|
||||
}
|
||||
|
||||
export function genId(prefix: string) {
|
||||
return `${prefix}-${Math.random().toString(32).substr(2, 8)}`;
|
||||
return `${prefix}-${Math.random()
|
||||
.toString(32)
|
||||
.substr(2, 8)}`;
|
||||
}
|
||||
|
||||
export const makeId = (id: string, index: number) => `${id}:${index}`;
|
||||
@@ -215,7 +217,7 @@ export function error(options: { condition: boolean; message: string }) {
|
||||
export type FunctionArguments<T extends Function> = T extends (...args: infer R) => any ? R : never;
|
||||
|
||||
export function callAllHandlers<T extends (event: any) => void>(...fns: (T | undefined)[]) {
|
||||
return function (event: FunctionArguments<T>[0]) {
|
||||
return function(event: FunctionArguments<T>[0]) {
|
||||
fns.some(fn => {
|
||||
fn && fn(event);
|
||||
return event && event.defaultPrevented;
|
||||
@@ -338,11 +340,8 @@ export function split<T extends Dict, K extends keyof T>(object: T, keys: K[]) {
|
||||
export function get(obj: any, path: string | number, fallback?: any, index?: number) {
|
||||
// eslint-disable-next-line @typescript-eslint/ban-ts-ignore
|
||||
//@ts-ignore
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
path = (path?.split?.('.') ?? [path]) as string;
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
for (index = 0; index < path.length; index++) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
obj = obj ? obj[path[index]] : undefined;
|
||||
}
|
||||
return obj === undefined ? fallback : obj;
|
||||
|
||||
Reference in New Issue
Block a user