Node.js, React (Vite), TypeScript, ESLint, Yarn Workspaces Monorepo Template. It contains a React application built with Vite and a minimal Node.js app skeleton. Both apps are 100% TypeScript and use a custom ESLint config.
Generate a new project from this template, clone it, install project dependencies, and start hacking: 😎
git clone git@github.com:LeeviHalme/node-react-ts.git
cd node-react-ts
yarn installBelow are the available scripts for this project:
yarn dev- Starts the Vite development serveryarn build- Builds the app for productionyarn preview- Serves the production buildyarn lint- Lints the app using ESLint
yarn dev- Starts the Nodemon watcher forsrc/index.tsyarn build- Builds the app for productionyarn start- Starts the production buildyarn lint- Lints the app using ESLint
You can also access these scripts from the project root by running: yarn workspace <workspaceName> <scriptName>.
Both apps are configured to lint using Airbnb's JavaScript Style Guide in addition to Prettier. There are also these custom rules for my personal preference:
quotes: ["error", "double"]- Enforces double quotes.react/jsx-filename-extension: [1, { "extensions": [".tsx"] }]- Allows the use of.tsxfile extensionreact/function-component-definition: ["error", { "namedComponents": "arrow-function" }]- Enforces arrow functions on functional component declarations
MIT ❤️