A modern template for Node.js projects using TypeScript, ESLint, and Prettier.
- Node.js >= 20.0.0
- Yarn >= 1.22.0
- Node.js: >= 20.0.0
- Yarn: 1.22.22
- TypeScript: ^5.0.0
- ESLint: ^9.0.0
- Prettier: ^3.0.0
- ts-node: ^10.0.0
- @types/node: ^22.15.3
- @typescript-eslint/parser: ^6.0.0
- @typescript-eslint/eslint-plugin: ^6.0.0
- eslint-config-prettier: ^10.0.0
- Clone this repository
- Install dependencies:
yarn install
To verify that everything is working correctly:
-
Run the development server:
yarn dev
You should see the output:
Hello, TypeScript!
-
Build and run the production version:
yarn build yarn start
You should see the same output:
Hello, TypeScript!
If you see the message, your development environment is set up correctly!
yarn dev
- Run the development server using ts-nodeyarn build
- Build the TypeScript projectyarn start
- Run the built JavaScript codeyarn lint
- Run ESLint to check for code issuesyarn lint:fix
- Run ESLint and automatically fix issuesyarn format
- Format code using Prettieryarn check-format
- Check if files are properly formatted
This project uses ESLint for code linting with the following configuration:
- TypeScript support via
@typescript-eslint/parser
and@typescript-eslint/eslint-plugin
- Integration with Prettier via
eslint-config-prettier
- Custom rules:
- Enforces arrow function body style
- Disallows
var
declarations - Warns when
const
could be used - Warns on
console.log
(allowsconsole.warn
andconsole.error
)
- Ignores common directories like
node_modules
,dist
, and build outputs
Prettier is configured to format:
- TypeScript files (
.ts
) - JavaScript files (
.js
) - JSON files (
.json
) - Markdown files (
.md
)
The project uses modern TypeScript features:
- Latest JavaScript features (
ESNext
) - ESM modules with Node.js resolution
- Path aliases (
@/*
maps tosrc/*
) - Strict type checking enabled
- Source maps for debugging
- Incremental builds for faster compilation
- Support for JavaScript and JSON imports
This template includes VS Code settings for optimal development experience:
- Code Quality
- Prettier formatter
- ESLint support
- Markdown linting
- Development Experience
- Path IntelliSense (supports
@/
alias) - NPM IntelliSense
- EditorConfig support
- Environment file support
- Path IntelliSense (supports
- Git Integration
- GitLens for enhanced Git features
- Visual Aids
- Indent rainbow
- Rainbow brackets
- Color highlighting
- CSV editing support
- Format on save with Prettier
- ESLint auto-fix on save
- Consistent line endings
- Trailing whitespace trimming
- Inline suggestions enabled
- Quick string completions
├── src/ # Source files
├── dist/ # Compiled output
├── .vscode/ # VS Code settings
├── package.json # Project configuration
├── tsconfig.json # TypeScript configuration
└── .eslintrc.mjs # ESLint configuration
- Write your TypeScript code in the
src
directory - Use
yarn dev
during development - Build your project with
yarn build
- Run the production build with
yarn start
This project is private and not licensed for public use.