We want a react app with, Typescript, Jest, Eslint, Prettier, and React Testing Library all ready to go.
TLDR: The npm install commands
If you want you can just clone the repo
Start a new project
Then add Snowpack
Setup React
Linting
At this point we have a dilemma. With Webpack I would install and setup xo-cli, however XO does not have a CLI plugin for snowpack. We have two options either we create our own plugin, or simply use the XO eslint config. Writing a snowpack-plugin seems pretty straight forward; but it’s my weekend and I’ve not yet decided to use this toolchain in my day to day job — so quick wins for the win… I have a toolchain to configure so I can build my app. Onwards!
Add eslint-config-xo
Setup eslint
and prettier
Add an eslintConfig
to your package.json
Install Jest & React Testing Library
Install SCSS
support
Install your types
Setup Babel & Jest
Create a babel.config.js
create a setupTests.ts
Create a jest.config.js
Create a src
directory
Setup Typescript by creating a tsconfig.json
Create a snowpack.config.json
Add build rules to your .gitignore
Setup a basic structure for your React app
Create a components folder and create an App.tsx
Create a styles
folder
Reset your css
Create a new file styles/config/_reset.scss
and add your reset.
I’m using Andy Bell’s modern-css-reset
Comments
Add your comment