exp-node-server 1.1.7 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +82 -20
- package/dist/cli.js +525 -0
- package/package.json +29 -9
- package/templates/mongoose/.dockerignore +10 -0
- package/templates/mongoose/.env.example +56 -7
- package/templates/mongoose/.prettierignore +3 -0
- package/templates/mongoose/.prettierrc +7 -0
- package/templates/mongoose/Dockerfile +33 -0
- package/templates/mongoose/_gitignore +32 -0
- package/templates/mongoose/docker-compose.yml +21 -0
- package/templates/mongoose/eslint.config.js +35 -0
- package/templates/mongoose/package-lock.json +6377 -0
- package/templates/mongoose/package.json +49 -10
- package/templates/mongoose/readme.md +85 -0
- package/templates/mongoose/src/app/configs/index.ts +178 -26
- package/templates/mongoose/src/app/errors/zodError.ts +16 -16
- package/templates/mongoose/src/app/lib/db.ts +18 -0
- package/templates/mongoose/src/app/lib/logger.ts +12 -0
- package/templates/mongoose/src/app/middlewares/auth.ts +48 -44
- package/templates/mongoose/src/app/middlewares/global_error_handler.ts +59 -65
- package/templates/mongoose/src/app/middlewares/not_found_api.ts +7 -7
- package/templates/mongoose/src/app/middlewares/rate_limiter.ts +153 -0
- package/templates/mongoose/src/app/middlewares/request_validator.ts +11 -10
- package/templates/mongoose/src/app/middlewares/uploader.ts +17 -13
- package/templates/mongoose/src/app/modules/account/account.controller.ts +156 -0
- package/templates/mongoose/src/app/modules/account/account.interface.ts +65 -0
- package/templates/mongoose/src/app/modules/account/account.route.ts +101 -0
- package/templates/mongoose/src/app/modules/account/account.schema.ts +97 -0
- package/templates/mongoose/src/app/modules/account/account.service.ts +422 -0
- package/templates/mongoose/src/app/modules/account/account.swagger.ts +278 -0
- package/templates/mongoose/src/app/modules/account/account.validation.ts +63 -0
- package/templates/mongoose/src/app/modules/profile/profile.controller.ts +17 -0
- package/templates/mongoose/src/app/modules/profile/profile.interface.ts +7 -0
- package/templates/mongoose/src/app/modules/profile/profile.route.ts +28 -0
- package/templates/mongoose/src/app/modules/profile/profile.schema.ts +13 -0
- package/templates/mongoose/src/app/modules/profile/profile.service.ts +28 -0
- package/templates/mongoose/src/app/modules/profile/profile.swagger.ts +34 -0
- package/templates/mongoose/src/app/modules/profile/profile.validation.ts +8 -0
- package/templates/mongoose/src/app/passport-js/index.ts +87 -0
- package/templates/mongoose/src/app/passport-js/oauth-state.ts +150 -0
- package/templates/mongoose/src/app/passport-js/providers.ts +258 -0
- package/templates/mongoose/src/app/passport-js/social-account.ts +141 -0
- package/templates/mongoose/src/app/queues/agenda.ts +24 -0
- package/templates/mongoose/src/app/queues/email.queue.ts +53 -0
- package/templates/mongoose/src/app/queues/index.ts +13 -0
- package/templates/mongoose/src/app/templates/otpEmailTemplate.ts +185 -0
- package/templates/mongoose/src/app/templates/resetPasswordEmailTemplate.ts +157 -0
- package/templates/mongoose/src/app/types/error.d.ts +7 -7
- package/templates/mongoose/src/app/types/express.d.ts +11 -0
- package/templates/mongoose/src/app/types/passport-oauth1.d.ts +51 -0
- package/templates/mongoose/src/app/utils/JWT.ts +38 -18
- package/templates/mongoose/src/app/utils/app_error.ts +10 -10
- package/templates/mongoose/src/app/utils/auth_cookie.ts +27 -0
- package/templates/mongoose/src/app/utils/catch_async.ts +8 -8
- package/templates/mongoose/src/app/utils/cloudinary.ts +26 -59
- package/templates/mongoose/src/app/utils/mail_sender.ts +26 -92
- package/templates/mongoose/src/app/utils/manage_response.ts +19 -19
- package/templates/mongoose/src/app/utils/otp.ts +20 -0
- package/templates/mongoose/src/app/utils/session.ts +55 -0
- package/templates/mongoose/src/app.ts +73 -42
- package/templates/mongoose/src/routes.ts +13 -13
- package/templates/mongoose/src/server.ts +38 -18
- package/templates/mongoose/src/swaggerOptions.ts +23 -23
- package/templates/mongoose/tests/app.test.ts +97 -0
- package/templates/mongoose/tests/global-setup.ts +15 -0
- package/templates/mongoose/tests/helpers/fixtures.ts +42 -0
- package/templates/mongoose/tests/routes/account.test.ts +614 -0
- package/templates/mongoose/tests/routes/profile.test.ts +95 -0
- package/templates/mongoose/tests/routes/social.test.ts +310 -0
- package/templates/mongoose/tests/setup.ts +25 -0
- package/templates/mongoose/tsconfig.json +16 -20
- package/templates/mongoose/vitest.config.ts +43 -0
- package/templates/prisma/.dockerignore +2 -0
- package/templates/prisma/.env.example +62 -6
- package/templates/prisma/.prettierignore +3 -0
- package/templates/prisma/.prettierrc +7 -0
- package/templates/prisma/.projectrc.json +1 -1
- package/templates/prisma/Dockerfile +21 -7
- package/templates/prisma/_gitignore +35 -0
- package/templates/prisma/docker-compose.yml +8 -7
- package/templates/prisma/eslint.config.js +35 -0
- package/templates/prisma/package-lock.json +7327 -0
- package/templates/prisma/package.json +47 -9
- package/templates/prisma/prisma/schema/account.schema.prisma +92 -10
- package/templates/prisma/prisma/schema/profile.schema.prisma +8 -3
- package/templates/prisma/prisma/schema/schema.prisma +1 -2
- package/templates/prisma/prisma.config.ts +5 -5
- package/templates/prisma/readme.md +81 -0
- package/templates/prisma/src/app/configs/index.ts +175 -26
- package/templates/prisma/src/app/errors/zodError.ts +16 -16
- package/templates/prisma/src/app/lib/logger.ts +12 -0
- package/templates/prisma/src/app/lib/prisma.ts +4 -6
- package/templates/prisma/src/app/middlewares/auth.ts +37 -16
- package/templates/prisma/src/app/middlewares/global_error_handler.ts +42 -35
- package/templates/prisma/src/app/middlewares/not_found_api.ts +7 -7
- package/templates/prisma/src/app/middlewares/rate_limiter.ts +124 -0
- package/templates/prisma/src/app/middlewares/request_validator.ts +4 -3
- package/templates/prisma/src/app/middlewares/uploader.ts +17 -13
- package/templates/prisma/src/app/modules/account/account.controller.ts +74 -34
- package/templates/prisma/src/app/modules/account/account.route.ts +68 -22
- package/templates/prisma/src/app/modules/account/account.service.ts +329 -309
- package/templates/prisma/src/app/modules/account/account.swagger.ts +167 -76
- package/templates/prisma/src/app/modules/account/account.validation.ts +41 -19
- package/templates/prisma/src/app/modules/profile/profile.controller.ts +4 -4
- package/templates/prisma/src/app/modules/profile/profile.route.ts +18 -12
- package/templates/prisma/src/app/modules/profile/profile.service.ts +11 -18
- package/templates/prisma/src/app/modules/profile/profile.swagger.ts +11 -11
- package/templates/prisma/src/app/modules/profile/profile.validation.ts +2 -2
- package/templates/prisma/src/app/passport-js/index.ts +87 -0
- package/templates/prisma/src/app/passport-js/oauth-state.ts +150 -0
- package/templates/prisma/src/app/passport-js/providers.ts +263 -0
- package/templates/prisma/src/app/passport-js/social-account.ts +147 -0
- package/templates/prisma/src/app/queues/boss.ts +8 -0
- package/templates/prisma/src/app/queues/email.queue.ts +56 -0
- package/templates/prisma/src/app/queues/index.ts +14 -0
- package/templates/prisma/src/app/queues/maintenance.queue.ts +30 -0
- package/templates/prisma/src/app/templates/otpEmailTemplate.ts +185 -0
- package/templates/prisma/src/app/templates/resetPasswordEmailTemplate.ts +157 -0
- package/templates/prisma/src/app/types/error.d.ts +7 -7
- package/templates/prisma/src/app/types/express.d.ts +11 -0
- package/templates/prisma/src/app/types/passport-oauth1.d.ts +51 -0
- package/templates/prisma/src/app/utils/JWT.ts +36 -17
- package/templates/prisma/src/app/utils/app_error.ts +10 -10
- package/templates/prisma/src/app/utils/auth_cookie.ts +27 -0
- package/templates/prisma/src/app/utils/catch_async.ts +8 -8
- package/templates/prisma/src/app/utils/cloudinary.ts +26 -59
- package/templates/prisma/src/app/utils/mail_sender.ts +26 -92
- package/templates/prisma/src/app/utils/manage_response.ts +19 -19
- package/templates/prisma/src/app/utils/otp.ts +20 -0
- package/templates/prisma/src/app/utils/session.ts +57 -0
- package/templates/prisma/src/app.ts +73 -42
- package/templates/prisma/src/routes.ts +12 -10
- package/templates/prisma/src/server.ts +37 -19
- package/templates/prisma/src/swaggerOptions.ts +22 -26
- package/templates/prisma/tests/app.test.ts +86 -0
- package/templates/prisma/tests/helpers/fixtures.ts +35 -0
- package/templates/prisma/tests/helpers/prisma.ts +32 -0
- package/templates/prisma/tests/routes/account.test.ts +627 -0
- package/templates/prisma/tests/routes/profile.test.ts +91 -0
- package/templates/prisma/tests/routes/social.test.ts +317 -0
- package/templates/prisma/tests/setup.ts +10 -0
- package/templates/prisma/tsconfig.json +16 -23
- package/templates/prisma/vitest.config.ts +38 -0
- package/bin/cli.js +0 -41
- package/src/createProject.js +0 -61
- package/src/generateModule.js +0 -93
- package/src/utils/getProjectType.js +0 -13
- package/src/utils/mongoose/controllerGenerator.js +0 -70
- package/src/utils/mongoose/routeGenerator.js +0 -27
- package/src/utils/mongoose/schemaGenerator.js +0 -11
- package/src/utils/mongoose/serviceGenerator.js +0 -49
- package/src/utils/mongoose/swaggerGenerator.js +0 -112
- package/src/utils/mongoose/validationGenerator.js +0 -13
- package/src/utils/prisma/prismaSchemaGenerator.js +0 -10
- package/src/utils/prisma/prismaServiceGenerator.js +0 -47
- package/src/utils/routeInjector.js +0 -40
- package/src/utils/swaggerInjector.js +0 -52
- package/src/utils/validateModuleName.js +0 -17
- package/src/utils/validateProjectName.js +0 -15
- package/src/utils.js +0 -26
- package/templates/mongoose/src/app/errors/castError.ts +0 -23
- package/templates/mongoose/src/app/errors/duplicateError.ts +0 -26
- package/templates/mongoose/src/app/errors/validationError.ts +0 -25
- package/templates/mongoose/src/app/modules/auth/auth.controller.ts +0 -127
- package/templates/mongoose/src/app/modules/auth/auth.interface.ts +0 -24
- package/templates/mongoose/src/app/modules/auth/auth.route.ts +0 -46
- package/templates/mongoose/src/app/modules/auth/auth.schema.ts +0 -19
- package/templates/mongoose/src/app/modules/auth/auth.service.ts +0 -324
- package/templates/mongoose/src/app/modules/auth/auth.swagger.ts +0 -214
- package/templates/mongoose/src/app/modules/auth/auth.validation.ts +0 -37
- package/templates/mongoose/src/app/modules/user/user.controller.ts +0 -17
- package/templates/mongoose/src/app/modules/user/user.interface.ts +0 -15
- package/templates/mongoose/src/app/modules/user/user.route.ts +0 -20
- package/templates/mongoose/src/app/modules/user/user.schema.ts +0 -22
- package/templates/mongoose/src/app/modules/user/user.service.ts +0 -22
- package/templates/mongoose/src/app/modules/user/user.swagger.ts +0 -75
- package/templates/mongoose/src/app/modules/user/user.validation.ts +0 -18
- package/templates/mongoose/src/app/types/index.d.ts +0 -12
- package/templates/mongoose/src/app/utils/isAccountExist.ts +0 -31
- package/templates/prisma/src/app/types/index.d.ts +0 -12
- package/templates/prisma/src/app/utils/otpGenerator.ts +0 -29
package/package.json
CHANGED
|
@@ -1,19 +1,37 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "exp-node-server",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
|
+
"description": "CLI to scaffold Express + TypeScript APIs with Mongoose or Prisma, Zod validation and Swagger docs",
|
|
4
5
|
"type": "module",
|
|
5
6
|
"bin": {
|
|
6
|
-
"exp-node-server": "./
|
|
7
|
+
"exp-node-server": "./dist/cli.js"
|
|
7
8
|
},
|
|
8
9
|
"files": [
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"templates"
|
|
10
|
+
"dist",
|
|
11
|
+
"templates",
|
|
12
|
+
"!templates/*/node_modules",
|
|
13
|
+
"!templates/*/dist",
|
|
14
|
+
"!templates/*/coverage",
|
|
15
|
+
"!templates/*/.env"
|
|
12
16
|
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsup",
|
|
19
|
+
"dev": "tsup --watch",
|
|
20
|
+
"typecheck": "tsc -p .",
|
|
21
|
+
"test": "vitest run",
|
|
22
|
+
"test:watch": "vitest",
|
|
23
|
+
"prepublishOnly": "npm run typecheck && npm test && npm run build"
|
|
24
|
+
},
|
|
13
25
|
"dependencies": {
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"
|
|
26
|
+
"@inquirer/select": "^5.2.6",
|
|
27
|
+
"chalk": "^5.6.2",
|
|
28
|
+
"ora": "^9.4.1"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/node": "^20.19.43",
|
|
32
|
+
"tsup": "^8.5.1",
|
|
33
|
+
"typescript": "^7.0.2",
|
|
34
|
+
"vitest": "^3.2.7"
|
|
17
35
|
},
|
|
18
36
|
"keywords": [
|
|
19
37
|
"express",
|
|
@@ -28,7 +46,9 @@
|
|
|
28
46
|
"exp-node",
|
|
29
47
|
"server"
|
|
30
48
|
],
|
|
49
|
+
"author": "Abumahid (https://abumahid.me)",
|
|
50
|
+
"homepage": "https://www.npmjs.com/package/exp-node-server",
|
|
31
51
|
"engines": {
|
|
32
|
-
"node": ">=20.
|
|
52
|
+
"node": ">=20.17.0"
|
|
33
53
|
}
|
|
34
54
|
}
|
|
@@ -1,23 +1,72 @@
|
|
|
1
|
+
# Default Node config
|
|
1
2
|
NODE_ENV=development
|
|
2
|
-
DATABASE_URL=
|
|
3
3
|
PORT=5000
|
|
4
|
+
# Number of reverse proxies in front of the app (1 behind Caddy/Nginx). Keep 0 if exposed directly.
|
|
5
|
+
TRUST_PROXY=0
|
|
4
6
|
|
|
7
|
+
# Database config (docker-compose starts MongoDB on localhost:27017)
|
|
8
|
+
DATABASE_URL="mongodb://localhost:27017/server_db"
|
|
5
9
|
|
|
6
10
|
# JWT Configuration
|
|
11
|
+
# Each secret must be a different random value of 32+ characters: `openssl rand -hex 32`
|
|
7
12
|
ACCESS_TOKEN=
|
|
8
|
-
|
|
9
|
-
ACCESS_EXPIRES=
|
|
10
|
-
|
|
11
|
-
RESET_SECRET=
|
|
12
|
-
RESET_EXPIRES=
|
|
13
|
+
# Access tokens are short-lived; refresh tokens (opaque, rotated on every use) last longer
|
|
14
|
+
ACCESS_EXPIRES=15m
|
|
15
|
+
REFRESH_EXPIRES_DAYS=30
|
|
13
16
|
VERIFIED_TOKEN=
|
|
14
|
-
|
|
17
|
+
RESET_SECRET=
|
|
18
|
+
RESET_EXPIRES=15m
|
|
19
|
+
FRONT_END_URL=http://localhost:5173
|
|
20
|
+
# Comma separated list of allowed origins. Defaults to FRONT_END_URL.
|
|
21
|
+
CORS_ORIGINS=
|
|
15
22
|
|
|
16
23
|
# Email Configuration
|
|
17
24
|
APP_USER_EMAIL=
|
|
18
25
|
APP_PASSWORD=
|
|
26
|
+
# "From" address. Defaults to APP_USER_EMAIL.
|
|
27
|
+
MAIL_FROM=
|
|
19
28
|
|
|
20
29
|
# Cloudinary Configuration
|
|
21
30
|
CLOUD_NAME=
|
|
22
31
|
CLOUD_API_KEY=
|
|
23
32
|
CLOUD_API_SECRET=
|
|
33
|
+
|
|
34
|
+
# Swagger Config (docs are disabled in production unless ENABLE_SWAGGER=true)
|
|
35
|
+
ENABLE_SWAGGER=
|
|
36
|
+
DEVELOPMENT_BASE_URL=http://localhost:5000
|
|
37
|
+
PRODUCTION_BASE_URL=
|
|
38
|
+
|
|
39
|
+
# Social login: set IS_<PROVIDER>_LOGIN=true and fill in its credentials.
|
|
40
|
+
# After the provider, the browser is sent here with `?code=` (trade it via
|
|
41
|
+
# POST /api/auth/social/exchange) or `?error=`. Defaults to FRONT_END_URL/auth/social/callback
|
|
42
|
+
SOCIAL_REDIRECT_URL=
|
|
43
|
+
|
|
44
|
+
IS_GOOGLE_LOGIN=false
|
|
45
|
+
GOOGLE_CLIENT_ID=
|
|
46
|
+
GOOGLE_CLIENT_SECRET=
|
|
47
|
+
GOOGLE_CALLBACK_URL=http://localhost:5000/api/auth/social/google/callback
|
|
48
|
+
|
|
49
|
+
IS_FACEBOOK_LOGIN=false
|
|
50
|
+
FACEBOOK_APP_ID=
|
|
51
|
+
FACEBOOK_APP_SECRET=
|
|
52
|
+
FACEBOOK_CALLBACK_URL=http://localhost:5000/api/auth/social/facebook/callback
|
|
53
|
+
|
|
54
|
+
IS_GITHUB_LOGIN=false
|
|
55
|
+
GITHUB_CLIENT_ID=
|
|
56
|
+
GITHUB_CLIENT_SECRET=
|
|
57
|
+
GITHUB_CALLBACK_URL=http://localhost:5000/api/auth/social/github/callback
|
|
58
|
+
|
|
59
|
+
IS_TWITTER_LOGIN=false
|
|
60
|
+
TWITTER_CONSUMER_KEY=
|
|
61
|
+
TWITTER_CONSUMER_SECRET=
|
|
62
|
+
TWITTER_CALLBACK_URL=http://localhost:5000/api/auth/social/twitter/callback
|
|
63
|
+
|
|
64
|
+
IS_LINKEDIN_LOGIN=false
|
|
65
|
+
LINKEDIN_CLIENT_ID=
|
|
66
|
+
LINKEDIN_CLIENT_SECRET=
|
|
67
|
+
LINKEDIN_CALLBACK_URL=http://localhost:5000/api/auth/social/linkedin/callback
|
|
68
|
+
|
|
69
|
+
IS_DISCORD_LOGIN=false
|
|
70
|
+
DISCORD_CLIENT_ID=
|
|
71
|
+
DISCORD_CLIENT_SECRET=
|
|
72
|
+
DISCORD_CALLBACK_URL=http://localhost:5000/api/auth/social/discord/callback
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# ---------- BUILD STAGE ----------
|
|
2
|
+
FROM node:22-alpine AS builder
|
|
3
|
+
|
|
4
|
+
WORKDIR /app
|
|
5
|
+
|
|
6
|
+
# Only install deps first (cache friendly)
|
|
7
|
+
COPY package*.json ./
|
|
8
|
+
RUN npm ci
|
|
9
|
+
|
|
10
|
+
# Copy source + build
|
|
11
|
+
COPY . .
|
|
12
|
+
RUN npm run build
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
# ---------- PRODUCTION STAGE ----------
|
|
16
|
+
FROM node:22-alpine
|
|
17
|
+
|
|
18
|
+
WORKDIR /app
|
|
19
|
+
|
|
20
|
+
ENV NODE_ENV=production
|
|
21
|
+
|
|
22
|
+
# Only install production deps
|
|
23
|
+
COPY package*.json ./
|
|
24
|
+
RUN npm ci --omit=dev && npm cache clean --force
|
|
25
|
+
|
|
26
|
+
# Copy built app
|
|
27
|
+
COPY --from=builder /app/dist ./dist
|
|
28
|
+
|
|
29
|
+
USER node
|
|
30
|
+
|
|
31
|
+
EXPOSE 5000
|
|
32
|
+
|
|
33
|
+
CMD ["node", "dist/server.js"]
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Node modules
|
|
2
|
+
node_modules/
|
|
3
|
+
package-lock.json
|
|
4
|
+
|
|
5
|
+
# Build output
|
|
6
|
+
dist/
|
|
7
|
+
build/
|
|
8
|
+
|
|
9
|
+
# Env files
|
|
10
|
+
.env
|
|
11
|
+
.env.production
|
|
12
|
+
|
|
13
|
+
# Logs
|
|
14
|
+
logs/
|
|
15
|
+
*.log
|
|
16
|
+
npm-debug.log*
|
|
17
|
+
yarn-debug.log*
|
|
18
|
+
pnpm-debug.log*
|
|
19
|
+
|
|
20
|
+
# OS files
|
|
21
|
+
.DS_Store
|
|
22
|
+
Thumbs.db
|
|
23
|
+
|
|
24
|
+
# Coverage
|
|
25
|
+
coverage/
|
|
26
|
+
|
|
27
|
+
# IDE/editor
|
|
28
|
+
.vscode/
|
|
29
|
+
.idea/
|
|
30
|
+
|
|
31
|
+
# Docker
|
|
32
|
+
*.pid
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
services:
|
|
2
|
+
mongo:
|
|
3
|
+
image: mongo:8.2
|
|
4
|
+
container_name: server_database
|
|
5
|
+
restart: always
|
|
6
|
+
|
|
7
|
+
# only reachable from this machine (for local dev), not the internet
|
|
8
|
+
ports:
|
|
9
|
+
- "127.0.0.1:27017:27017"
|
|
10
|
+
|
|
11
|
+
volumes:
|
|
12
|
+
- mongo_data:/data/db
|
|
13
|
+
|
|
14
|
+
healthcheck:
|
|
15
|
+
test: ["CMD", "mongosh", "--quiet", "--eval", "db.adminCommand('ping')"]
|
|
16
|
+
interval: 5s
|
|
17
|
+
timeout: 5s
|
|
18
|
+
retries: 5
|
|
19
|
+
|
|
20
|
+
volumes:
|
|
21
|
+
mongo_data:
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import js from '@eslint/js';
|
|
2
|
+
import prettier from 'eslint-plugin-prettier';
|
|
3
|
+
import tseslint from 'typescript-eslint';
|
|
4
|
+
|
|
5
|
+
export default [
|
|
6
|
+
{
|
|
7
|
+
ignores: ['node_modules', 'dist', 'coverage'],
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
js.configs.recommended,
|
|
11
|
+
|
|
12
|
+
...tseslint.configs.recommended,
|
|
13
|
+
|
|
14
|
+
{
|
|
15
|
+
files: ['**/*.ts'],
|
|
16
|
+
languageOptions: {
|
|
17
|
+
parser: tseslint.parser,
|
|
18
|
+
},
|
|
19
|
+
plugins: {
|
|
20
|
+
prettier,
|
|
21
|
+
},
|
|
22
|
+
rules: {
|
|
23
|
+
'no-console': 'warn',
|
|
24
|
+
'@typescript-eslint/no-explicit-any': 'warn',
|
|
25
|
+
'prettier/prettier': 'error',
|
|
26
|
+
'@typescript-eslint/no-unused-vars': [
|
|
27
|
+
'error',
|
|
28
|
+
{
|
|
29
|
+
argsIgnorePattern: '^_',
|
|
30
|
+
varsIgnorePattern: '^_',
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
];
|