Guides
Prerequisites
To complete this, you will need:
A local development environment for JavaScript
Node.js (v20.x or later) and npm (v6.x or later) installed. You can follow How to Install Node.js and Create a Local Development Environment guide.
A code editor like Visual Studio Code
Initialize Your Project
First, navigate to your project's root directory in the terminal. If you don't have a project set up yet, you can create one using the following commands:
mkdir my-project
cd my-project
pnpm init -y
You'll see the following output:
Wrote to /path/to/my-project/package.json:
{
"name": "my-project",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
Setup
Install @kurocado-studio/style-guide
pnpm install --save-dev @kurocado-studio/style-guide
Install Husky
pnpm install --save-dev husky
Next, enable Git hooks:
npx husky install
Add lint-staged
to package.json
"lint-staged": {
"*": "pnpm run prettier-fix",
"**/*.{ts,tsx}": ["pnpm run prettier-fix", "pnpm run eslint-check"]
}
Other Configurations
Last modified: 27 November 2024