This project is a Node.js script that automates the setup of a Next.js project with TypeScript, Tailwind CSS, Prettier, and ESLint. It allows the user to select their preferred package manager and handles all necessary configurations, including setting up Prettier and ESLint with Tailwind CSS formatting, creating essential directories, and installing helpful packages like clsx and tailwind-merge.
You can use npx
to run the setup script without cloning the repository.
npx @tyecode/cc-next
This will automatically set up your Next.js project and install all necessary configurations, including TypeScript, Tailwind CSS, Prettier, and ESLint.
When you run the script, you will be prompted with the following questions:
npm
, yarn
, or pnpm
.Based on your input, the script will:
The script creates the following project structure:
my-next-app/
├── src/
│ ├── components/ # Directory for React components
│ ├── hooks/ # Directory for custom React hooks
│ └── utils/
│ └── cn.ts # Utility for managing Tailwind CSS classes
├── .eslintrc.json # ESLint configuration file
├── .prettierrc.json # Prettier configuration file
└── package.json # Project dependencies and scripts
The following dependencies are installed during the setup process:
Prettier Configuration .prettierrc.json
{
"$schema": "https://json.schemastore.org/prettierrc",
"singleQuote": false,
"trailingComma": "all",
"semi": true,
"bracketSpacing": true,
"tabWidth": 2,
"printWidth": 100,
"plugins": ["prettier-plugin-tailwindcss"]
}
ESLint Configuration .eslintrc.json
{
"extends": [
"next/core-web-vitals",
"next/typescript",
"plugin:prettier/recommended"
]
}
Contributions are welcome, and this project is a great starting point for anyone looking to get involved in open-source development. Whether you’re new to contributing or a seasoned developer, your input is valued!
Please read the Contributing guideline.
This project is licensed under the MIT License. See the LICENSE file for details.