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
{ | |
"useTabs": false, | |
"semi": true, | |
"singleQuote": true, | |
"jsxSingleQuote": true, | |
"trailingComma": "es5", | |
"endOfLine": "lf" | |
} |
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 { useMemo } from 'react'; | |
import { useLocation } from 'react-router-dom'; | |
export function useQuery<T = Record<string, string | number | undefined>>() { | |
const { search } = useLocation(); | |
const searchParams = useMemo(() => new URLSearchParams(search), [search]); | |
let result: Partial<T> = {} as T; |
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
@mixin flex($justify: center, $align: center, $direction: row) { | |
display: flex; | |
flex-direction: $direction; | |
align-items: $align; | |
justify-content: $justify; | |
} |
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
{ | |
"defaultSeverity": "warning", | |
"extends": [ | |
"stylelint-config-standard-scss", | |
"stylelint-config-prettier-scss", | |
"stylelint-config-rational-order" | |
], | |
"ignoreFiles": ["**/*.js", "**/*.ts", "**/*.tsx", "**/*.jsx", "**/*.html"], | |
"rules": { | |
"order/properties-order": [[], { "severity": "warning" }], |
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
describe('testing localStorage', () => { | |
// This following snippet is from https://amitd.co/code/testing/spying-on-localstorage-in-jest | |
// Thank you so much Amit Dhamu for this implementation | |
jest.spyOn(Object.getPrototypeOf(window.localStorage), 'setItem'); | |
Object.setPrototypeOf(window.localStorage.setItem, jest.fn()); | |
it('saves to localStorage when clicked on button', () => { | |
render(<Component />); | |
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
module.exports = { | |
env: { | |
browser: true, | |
es2021: true, | |
jest: true, // Enable if testing is used on the project | |
}, | |
extends: ['plugin:react/recommended', 'plugin:import/recommended', 'airbnb'], | |
parser: '@typescript-eslint/parser', | |
parserOptions: { | |
ecmaFeatures: { |
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
// Shout out to YouTube channel "FrontDev" for this mixin | |
// that makes responsive so much easier to work with. You can check out the full tutorial on | |
// his video here: https://www.youtube.com/watch?v=1334bFDilgk&ab_channel=FrontDev | |
// Put your breakpoints here | |
$available-breakpoints: ( | |
sm: 540px, | |
md: 768px, | |
lg: 1024px | |
); |