Skip to content

Instantly share code, notes, and snippets.

View skoch's full-sized avatar
🍋
Surly, since 1999.

Stephen Koch skoch

🍋
Surly, since 1999.
View GitHub Profile
body {
background-image: linear-gradient(
45deg,
#fff 25%,
transparent 25%,
transparent 75%,
#fff 75%
),
linear-gradient(45deg, #fff 25%, #000 25%, #000 75%, #fff 75%);
@skoch
skoch / SVGIcon.tsx
Last active September 30, 2021 17:29
import React, { ReactNode } from 'react';
interface Props {
width?: string;
height?: string;
viewBox?: string;
children: ReactNode;
}
const SVGIcon = ({ width = '20px', height = '20px', viewBox = '0 0 20 20', children }: Props) => (
@skoch
skoch / Icon.js
Created September 30, 2021 17:32
// Icon.js
import React from 'react';
import PropTypes from 'prop-types';
const Icon = (props) => {
const {
children,
size,
fill,
} = props;
@skoch
skoch / add-prettier.md
Last active March 28, 2023 18:56
You wanna add prettier? Go no further.

Add Prettier to your project!

The following process will get you all setup with a new project.

The objective is to have prettier setup from the get-go so that anything that's staged will be checked and fixed according to your defined styles. This depends on pretty-quick as well as husky.

Strategies

One thing you could do would be to create a .prettierignore file and add specific directories (or even the entire project!) and incrementally add in directories and/or single files. By doing this, you don't need to deal with your git history getting messed up, certain parts of larger codebases can be completely ignored (but why?), and certain parts can be updated by their respective maintainers.

If you are adding to an existing project, and aren't concerned about your git history, you can follow along Fix existing codebase to add and then you will need to "