Skip to content

Commit

Permalink
Create default project config
Browse files Browse the repository at this point in the history
  • Loading branch information
volesh committed May 3, 2024
1 parent 074f5d2 commit ad46ee7
Show file tree
Hide file tree
Showing 14 changed files with 4,252 additions and 873 deletions.
5 changes: 5 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
coverage
.husky
.github
29 changes: 29 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"root": true,
"env": {
"node": true,
"jest/globals": true
},
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint", "prettier", "jest"],
"extends": ["plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended-requiring-type-checking", "eslint:recommended"],
"overrides": [
{
"files": ["src/**/*.ts"],
"rules": {
"prettier/prettier": "error",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/no-unsafe-member-access": "off"
}
},
{
"files": ["src/**/*.test.ts"],
"plugins": ["jest"],
"extends": ["plugin:jest/recommended"]
}
],
"parserOptions": {
"project": "./tsconfig.json",
"tsconfigRootDir": "."
}
}
Empty file removed .eslintrc.json
Empty file.
28 changes: 28 additions & 0 deletions .github/workflows/CICD.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CI/CD

on: "push"

jobs:
Tests:
runs-on: ubuntu-latest
name: Run Jest tests
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '20.x'
- run: npm ci
- run: npm run test


deploy:
needs: Tests
runs-on: ubuntu-latest
name: Deploy project
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3

# Describe deployment here

6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
node_modules/
.env

.vscode
.DS_Store
.eslintcache
coverage
dist
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
10 changes: 9 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,13 @@
"plugins": ["@trivago/prettier-plugin-sort-imports"],
"importOrder": ["^[./]"],
"importOrderSeparation": true,
"importOrderSortSpecifiers": true
"importOrderSortSpecifiers": true,
"overrides": [
{
"files": ["*.eslintrc", "*.json", "*.md"],
"options": {
"trailingComma": "none"
}
}
]
}
35 changes: 35 additions & 0 deletions Readmy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
### Project Setup

This project is configured with the following tools and technologies:

- **TypeScript**: For writing type-safe code.
- **ESLint**: For linting TypeScript code.
- **Prettier**: For code formatting.
- **Husky**: To set up pre-commit hooks.
- **Jest**: For testing code.

### Usage

To get started, clone this repository and install the dependencies:

```bash
git clone https://github.com/volesh/defaultProjectSetup.git
cd defaultProjectSetup
git remote set-url origin <your_repository_URL>
npm install
git push origin <branch-name>
```

### Continuous Integration/Continuous Deployment (CI/CD)

To enable CI/CD, describe the deployment steps in the `.github/workflows/CICD.yml` file. After that, remove the `.github` from the `.gitignore` file and push changes on GitHub.


### Husky Hooks

This project uses Husky to set up pre-commit hooks. It will automatically lint your code before committing.


### Contributing

Contributions are welcome! Please feel free to open issues or pull requests for any improvements or features you'd like to see.
4 changes: 4 additions & 0 deletions jest.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"preset": "ts-jest",
"testEnvironment": "node"
}
Loading

0 comments on commit ad46ee7

Please sign in to comment.