Skip to content

Latest commit

 

History

History
53 lines (37 loc) · 1.24 KB

fast-setup.md

File metadata and controls

53 lines (37 loc) · 1.24 KB

🚀 Fast setup

📖 This document is also available in Portuguese (Brazil)

💡 The Quickest Way (Recommended)

If you want to set up everything automatically, just run:

npx cloud-crafter-cli run quickstart-js

This command will handle all steps for you—creating necessary files, installing dependencies, and configuring ESLint, Husky, and Lint-staged. After running it, you're ready to go! 🎉

🔧 Manual Setup (Step-by-Step)

If you prefer a hands-on approach, follow these steps:

  1. Create package.json. ("y" flag tells the generator to use the defaults instead of asking questions.)
  2. Create .gitignore file.
  3. Add "node_modules" to .gitinore.
  4. Install ESLint, Husky and Lint-staged as devDependencies
npm init -y

touch .gitignore
echo 'node_modules' > .gitignore

npm i -D eslint husky lint-staged
  1. Initialize eslint configuration
npm init @eslint/config
  1. Add "lint" and "prepare" scripts to package.json scripts.
  2. Setup Lint-staged.
  3. Setup Husky "pre-commit" git hook.
npm pkg set scripts.lint="npx eslint"
npx husky init
touch .lintstagedrc
echo '{
  "*.js": "npm run lint -- --fix"
}' > .lintstagedrc

npx husky add .husky/pre-commit "npx lint-staged"