This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# lint-staged-around | |
# execute each lint-staged entry in sub-directories projects recursively | |
# | |
# Riakuto! Project by Klemiwary Books | |
fileTypes="js|jsx|ts|tsx|html|css|less|sass|scss|gql|graphql|json" | |
target="src|public" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Brooch { | |
pentagram = 'Silver Crystal'; | |
} | |
type Compact = { | |
silverCrystal: boolean; | |
}; | |
class CosmicCompact implements Compact { | |
silverCrystal = true; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable max-classes-per-file, no-useless-constructor, lines-between-class-members */ | |
type Result<T, E extends Error> = Ok<T, E> | Err<T, E>; | |
export class Ok<T, E extends Error> { | |
constructor(readonly val: T) {} | |
isOk = (): this is Ok<T, E> => true; | |
isErr = (): this is Err<T, E> => false; | |
} | |
export class Err<T, E extends Error> { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { argv } = require('yargs'); | |
const glob = argv._ && argv._[0]; | |
const isJsxFile = glob && /.{jsx,tsx}/.test(glob); | |
if (isJsxFile) { | |
module.exports = { | |
extends: [ | |
'stylelint-config-standard', | |
'stylelint-config-styled-components', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { getByQuery, strategies } from 'firestore-snapbox'; | |
const maxEntries = 100; | |
const maxAgeSeconds = 60 * 60; | |
const expiredDate = new Date(2020, 0, 10, 15); | |
const snap = await getByQuery(query, strategies.CacheFirst, { maxEntries, maxAgeSeconds, expiredDate }); | |
const books = snap.docs.map(doc => { ...doc, id: doc.id } as Book); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useContext, useEffect, useRef, useState } from 'react'; | |
import { Book } from 'domains/mangarel/models/book'; | |
import findBook from 'domains/mangarel/services/find-book'; | |
import { FirebaseContext } from 'contexts'; | |
const useFindBook = (id: string) => { | |
const [book, setBook] = useState<Book>(); | |
const [isLoading, setIsLoading] = useState(false); | |
const [error, setError] = useState<Error | null>(null); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { FC, useEffect, useRef } from 'react'; | |
import ListLoader from '../atoms/ListLoader'; | |
type InfinitScrollProps = { | |
loadMore?: () => void; | |
hasMore?: boolean; | |
isLoading?: boolean; | |
threshold?: number; | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { AxiosResponse } from 'axios'; | |
import { camel } from 'change-case'; | |
import { isArray, isObject, isString } from 'lodash'; | |
import { DateTime } from 'luxon'; | |
export const reform = ( | |
obj: object, | |
keyConverter: (k: string) => string, | |
): any => { | |
if (isArray(obj)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"key": "ctrl+]", | |
"command": "extension.vim_escape", | |
"when": "editorTextFocus" | |
}, | |
{ | |
"key": "ctrl+e", | |
"command": "workbench.action.toggleSidebarVisibility" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"extends": [ | |
"tslint:latest", | |
"tslint-config-airbnb", | |
"tslint-config-prettier", | |
"tslint-eslint-rules", | |
"tslint-react" | |
], | |
"rulesDirectory": [ | |
"tslint-plugin-prettier" |
NewerOlder