Skip to content

Commit

Permalink
style: format code with eslint
Browse files Browse the repository at this point in the history
close #63
  • Loading branch information
buqiyuan committed Sep 6, 2024
1 parent 3eb6bea commit 8c832ee
Show file tree
Hide file tree
Showing 74 changed files with 1,466 additions and 1,494 deletions.
2 changes: 0 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ about: Create a report to help us improve
Note: In order to better solve your problem, please refer to the template to provide complete information, accurately describe the problem, and the incomplete information issue will be closed.
-->


## Bug report(问题描述)

#### Steps to reproduce(问题复现步骤)
Expand All @@ -20,7 +19,6 @@ about: Create a report to help us improve

#### Screenshot or Gif(截图或动态图)


#### Link to minimal reproduction(最小可在线还原demo)

<!--
Expand Down
1 change: 0 additions & 1 deletion .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,3 @@ about: Suggest an idea for this project
---

## Feature request(新功能建议)

5 changes: 2 additions & 3 deletions .github/workflows/build-stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build Stable Image
on:
push:
branches:
- 'main'
- main

jobs:
docker:
Expand All @@ -28,7 +28,6 @@ jobs:
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}


# deploy:
# runs-on: ubuntu-latest
# needs: docker
Expand All @@ -39,7 +38,7 @@ jobs:
# host: ${{ secrets.REMOTE_HOST }}
# username: ${{ secrets.REMOTE_USERNAME }}
# password: ${{ secrets.REMOTE_PASSWORD }}
# port: ${{ secrets.REMOTE_PORT }}
# port: ${{ secrets.REMOTE_PORT }}
# script: |
# cd ${{ secrets.REMOTE_WORKDIR }}
# pnpm docker:prod:up
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/daily-curl-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Daily Curl Request

on:
schedule:
- cron: "*/5 * * * *"
- cron: '*/5 * * * *'

jobs:
run-curl:
Expand All @@ -11,4 +11,4 @@ jobs:
steps:
- name: Run Curl Request
# because: https://docs.render.com/free#spinning-down-on-idle
run: curl https://nest-admin-093x.onrender.com
run: curl https://nest-admin-093x.onrender.com
3 changes: 1 addition & 2 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.REMOTE_USERNAME }}
password: ${{ secrets.REMOTE_PASSWORD }}
port: ${{ secrets.REMOTE_PORT }}
port: ${{ secrets.REMOTE_PORT }}
script: |
cd ${{ secrets.REMOTE_WORKDIR }}
git reset --hard origin/main
Expand All @@ -26,4 +26,3 @@ jobs:
echo "${{ secrets.DEPLOY_ENV_FILE }}" > .env
echo "${{ secrets.DEPLOY_ENV_PROD_FILE }}" > .env.production
pnpm prod:pm2
7 changes: 3 additions & 4 deletions .github/workflows/sync-to-gitee.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,10 @@ jobs:
- name: Mirror the Github organization repos to Gitee.
uses: Yikun/hub-mirror-action@master
with:
src: 'github/buqiyuan'
dst: 'gitee/buqiyuan'
src: github/buqiyuan
dst: gitee/buqiyuan
dst_key: ${{ secrets.GITEE_PRIVATE_KEY }}
dst_token: ${{ secrets.GITEE_TOKEN }}
static_list: 'nest-admin'
static_list: nest-admin
force_update: true
debug: true

33 changes: 19 additions & 14 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
{
// Enable the ESlint flat config support
"eslint.experimental.useFlatConfig": true,

// Disable the default formatter, use eslint instead
"prettier.enable": false,
"editor.formatOnSave": false,
Expand All @@ -14,16 +11,16 @@

// Silent the stylistic rules in you IDE, but still auto fix them
"eslint.rules.customizations": [
{ "rule": "style/*", "severity": "off" },
{ "rule": "format/*", "severity": "off" },
{ "rule": "*-indent", "severity": "off" },
{ "rule": "*-spacing", "severity": "off" },
{ "rule": "*-spaces", "severity": "off" },
{ "rule": "*-order", "severity": "off" },
{ "rule": "*-dangle", "severity": "off" },
{ "rule": "*-newline", "severity": "off" },
{ "rule": "*quotes", "severity": "off" },
{ "rule": "*semi", "severity": "off" }
{ "rule": "style/*", "severity": "off", "fixable": true },
{ "rule": "format/*", "severity": "off", "fixable": true },
{ "rule": "*-indent", "severity": "off", "fixable": true },
{ "rule": "*-spacing", "severity": "off", "fixable": true },
{ "rule": "*-spaces", "severity": "off", "fixable": true },
{ "rule": "*-order", "severity": "off", "fixable": true },
{ "rule": "*-dangle", "severity": "off", "fixable": true },
{ "rule": "*-newline", "severity": "off", "fixable": true },
{ "rule": "*quotes", "severity": "off", "fixable": true },
{ "rule": "*semi", "severity": "off", "fixable": true }
],

// Enable eslint for all supported languages
Expand All @@ -39,7 +36,15 @@
"jsonc",
"yaml",
"toml",
"xml",
"gql",
"graphql"
"graphql",
"astro",
"svelte",
"css",
"less",
"scss",
"pcss",
"postcss"
]
}
4 changes: 2 additions & 2 deletions docker-compose.prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ services:
extra_hosts:
- 'host.docker.internal:host-gateway'
ports:
- '${APP_PORT}:${APP_PORT}'
- '${APP_PORT}:${APP_PORT}'
networks:
- nest_admin_net

networks:
nest_admin_net:
name: nest_admin_net
name: nest_admin_net
20 changes: 3 additions & 17 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,8 @@ module.exports = antfu({
'ts/consistent-type-imports': 'off',
'node/prefer-global/process': 'off',
'node/prefer-global/buffer': 'off',

'import/order': [
2,
{
'pathGroups': [
{
pattern: '~/**',
group: 'external',
position: 'after',
},
],
'alphabetize': { order: 'asc', caseInsensitive: false },
'newlines-between': 'always-and-inside-groups',
'warnOnUnassignedImports': true,
},
],

'regexp/no-super-linear-backtracking': 'off',
'regexp/no-contradiction-with-assertion': 'off',
'ts/no-unused-expressions': 'off',
},
})
73 changes: 37 additions & 36 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"prod:pm2": "cross-env NODE_ENV=production pm2 restart ecosystem.config.js",
"prod:stop": "pm2 stop ecosystem.config.js",
"prod:debug": "cross-env NODE_ENV=production nest start --debug --watch",
"lint": "eslint \"{src,apps,libs,test}/**/*.ts\" --fix",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test": "jest",
"test:watch": "jest --watch",
"doc": "compodoc -p tsconfig.json -s",
Expand All @@ -43,94 +44,94 @@
"docker:logs": "docker compose --env-file .env --env-file .env.production logs -f"
},
"dependencies": {
"@fastify/cookie": "^9.3.1",
"@fastify/multipart": "^8.2.0",
"@fastify/cookie": "^9.4.0",
"@fastify/multipart": "^8.3.0",
"@fastify/static": "^7.0.4",
"@liaoliaots/nestjs-redis": "^9.0.5",
"@nestjs-modules/mailer": "^2.0.2",
"@nestjs/axios": "^3.0.2",
"@nestjs/bull": "^10.1.1",
"@nestjs/axios": "^3.0.3",
"@nestjs/bull": "^10.2.1",
"@nestjs/cache-manager": "^2.2.2",
"@nestjs/common": "^10.3.9",
"@nestjs/config": "^3.2.2",
"@nestjs/core": "^10.3.9",
"@nestjs/common": "^10.4.1",
"@nestjs/config": "^3.2.3",
"@nestjs/core": "^10.4.1",
"@nestjs/event-emitter": "^2.0.4",
"@nestjs/jwt": "^10.2.0",
"@nestjs/passport": "^10.0.3",
"@nestjs/platform-fastify": "^10.3.9",
"@nestjs/platform-socket.io": "^10.3.9",
"@nestjs/schedule": "^4.0.2",
"@nestjs/swagger": "^7.3.1",
"@nestjs/platform-fastify": "^10.4.1",
"@nestjs/platform-socket.io": "^10.4.1",
"@nestjs/schedule": "^4.1.0",
"@nestjs/swagger": "^7.4.0",
"@nestjs/terminus": "^10.2.3",
"@nestjs/throttler": "^5.1.2",
"@nestjs/throttler": "^6.2.1",
"@nestjs/typeorm": "^10.0.2",
"@nestjs/websockets": "^10.3.9",
"@nestjs/websockets": "^10.4.1",
"@socket.io/redis-adapter": "^8.3.0",
"@socket.io/redis-emitter": "^5.1.0",
"axios": "^1.7.2",
"bull": "^4.12.9",
"cache-manager": "^5.5.3",
"cache-manager-ioredis-yet": "^2.0.4",
"axios": "^1.7.7",
"bull": "^4.16.2",
"cache-manager": "^5.7.6",
"cache-manager-ioredis-yet": "^2.1.1",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.1",
"cron": "^3.1.7",
"cron-parser": "^4.9.0",
"crypto-js": "^4.2.0",
"dayjs": "^1.11.11",
"dayjs": "^1.11.13",
"dotenv": "16.4.5",
"handlebars": "^4.7.8",
"helmet": "^7.1.0",
"ioredis": "^5.4.1",
"lodash": "^4.17.21",
"mysql2": "^3.10.0",
"mysql2": "^3.11.0",
"nanoid": "^3.3.7",
"nestjs-cls": "^4.3.0",
"nodemailer": "^6.9.13",
"nestjs-cls": "^4.4.1",
"nodemailer": "^6.9.15",
"passport": "^0.7.0",
"passport-google-oauth20": "^2.0.0",
"passport-jwt": "^4.0.1",
"passport-local": "^1.0.0",
"qiniu": "^7.12.0",
"qs": "^6.12.1",
"qs": "^6.13.0",
"reflect-metadata": "^0.2.2",
"rimraf": "^5.0.7",
"rxjs": "^7.8.1",
"socket.io": "^4.7.5",
"stacktrace-js": "^2.0.2",
"svg-captcha": "^1.4.0",
"systeminformation": "^5.22.10",
"systeminformation": "^5.23.5",
"ts-node": "^10.9.2",
"typeorm": "0.3.17",
"ua-parser-js": "^1.0.38",
"winston": "^3.13.0",
"winston": "^3.14.2",
"winston-daily-rotate-file": "^5.0.0"
},
"devDependencies": {
"@antfu/eslint-config": "^2.20.0",
"@antfu/eslint-config": "^3.3.2",
"@compodoc/compodoc": "^1.1.25",
"@nestjs/cli": "^10.3.2",
"@nestjs/schematics": "^10.1.1",
"@nestjs/testing": "^10.3.9",
"@nestjs/cli": "^10.4.5",
"@nestjs/schematics": "^10.1.4",
"@nestjs/testing": "^10.4.1",
"@types/cache-manager": "^4.0.6",
"@types/jest": "29.5.12",
"@types/lodash": "^4.17.4",
"@types/multer": "^1.4.11",
"@types/node": "^20.14.2",
"@types/lodash": "^4.17.7",
"@types/multer": "^1.4.12",
"@types/node": "^20.14.11",
"@types/passport-jwt": "^4.0.1",
"@types/qs": "^6.9.15",
"@types/supertest": "^6.0.2",
"@types/ua-parser-js": "^0.7.39",
"cross-env": "^7.0.3",
"eslint": "^9.4.0",
"eslint": "^9.9.1",
"jest": "^29.7.0",
"lint-staged": "^15.2.5",
"lint-staged": "^15.2.10",
"rimraf": "^6.0.1",
"simple-git-hooks": "^2.11.1",
"source-map-support": "^0.5.21",
"supertest": "^6.3.4",
"ts-jest": "^29.1.2",
"ts-loader": "^9.5.1",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.4.5"
"typescript": "^5.5.4"
},
"pnpm": {
"peerDependencyRules": {
Expand Down
Loading

0 comments on commit 8c832ee

Please sign in to comment.