tsconfigs

작성자: redis

RedisInsight에서 TypeScript 구성을 찾아 수정합니다. 경로 별칭 추가, 새로운 TS 영역 도입, webpack/ts-node/ESLint 경로 디버깅 시 사용합니다.

npx skills add https://github.com/redis/redisinsight --skill tsconfigs

TypeScript Configuration

RedisInsight has no root tsconfig.json. Config is split per area, each owning its own paths, includes, and consumers. ESLint uses parserOptions.project: true to auto-discover the nearest tsconfig for each linted file.

Layout

FileOwnsConsumers
redisinsight/ui/tsconfig.jsonUI source, uiSrc/*, apiClient pathsVite (UI build), ESLint UI override, npm run type-check:ui
redisinsight/api/tsconfig.jsonAPI source, src/*, tests/* pathsNestJS build, ESLint API override
redisinsight/api/tsconfig.check.jsonSame as base + strict: true (with strictPropertyInitialization and useUnknownInCatchVariables off) and noEmit: truenpm run type-check:api only — kept separate so strict mode doesn't break nest build. See the type-check-baselines skill.
redisinsight/desktop/tsconfig.jsonDesktop source. Paths desktopSrc/*, apiSrc/*, uiSrc/*, apiClient, apiClient/* for TypeScript / IDE intellisenseESLint for desktop files, TS language server
configs/tsconfig.jsonCompiler options (module: CommonJS, esModuleInterop) used by ts-node to load the .ts webpack configsts-node via TS_NODE_PROJECT set in build:main / build:main:stage / build:stage
.storybook/tsconfig.jsonStorybook framework files, extends UI tsconfigStorybook + ESLint
stories/tsconfig.jsonStory files. Extends UI tsconfig; rewires uiSrc/* to resolve from redisinsight/uiStorybook + ESLint
tests/e2e-playwright/tsconfig.jsonPlaywright E2E suiteE2E runner (sub-project with own package.json, eslint-ignored at root)

Webpack path resolution (configs/webpack.config.base.ts)

Webpack uses explicit resolve.alias entries (not tsconfig-paths-webpack-plugin):

alias: {
  desktopSrc: webpackPaths.desktopSrcPath,
  apiSrc: resolve(webpackPaths.apiPath, 'src'),
  uiSrc: webpackPaths.uiSrcPath,
  apiClient: resolve(webpackPaths.riPath, 'api-client'),
  // ...
}

If you add a new path alias used by desktop code, add it in both places: redisinsight/desktop/tsconfig.json (for TypeScript / ESLint / IDE) and configs/webpack.config.base.ts resolve.alias (for the electron bundle).

ts-node and webpack TS configs

The webpack configs in configs/ are .ts files with type annotations. When webpack --config ./configs/*.ts runs, ts-node compiles them. Three package.json scripts set TS_NODE_PROJECT=./configs/tsconfig.json so ts-node uses the right compiler options:

  • build:main
  • build:main:stage
  • build:stage

configs/tsconfig.json deliberately does not set allowJs. Any .js file inside scripts/ or configs/ must be CommonJS (require / module.exports) — Node 22's module syntax detection will treat ESM-syntax .js files as ESM and break references to __dirname. Two scripts converted for this reason: scripts/prebuild.js, scripts/DeleteSourceMaps.js.

ESLint

.eslintrc.js:

  • Root parserOptions.project: true — auto-discovers the nearest tsconfig per file.
  • API override: parserOptions.project: redisinsight/api/tsconfig.json (explicit).
  • UI override: parserOptions.project: redisinsight/ui/tsconfig.json (explicit).
  • Files in .storybook/, .github/, etc. are not linted by eslint . because ESLint skips dot-prefixed paths during directory expansion.

If you add a top-level TS folder that ESLint will reach, drop a tsconfig in it or parserOptions.project: true will fail to find one.

Common tasks

Adding a path alias used by desktop / electron

  1. Add the alias to redisinsight/desktop/tsconfig.json compilerOptions.paths.
  2. If the alias is also used by UI code, add it to redisinsight/ui/tsconfig.json.
  3. If the alias is also used by API code, add it to redisinsight/api/tsconfig.json.
  4. For aliases used by the electron bundle (anything imported from redisinsight/desktop/**), also mirror the alias into configs/webpack.config.base.ts resolve.alias. Vite resolves UI aliases from redisinsight/ui/tsconfig.json automatically.

Adding a new top-level TS folder

Create a tsconfig.json in it. Bare minimum:

{
  "extends": "../redisinsight/ui/tsconfig.json",
  "include": ["**/*"]
}

Without it, ESLint's parserOptions.project: true will error on those files.

Adding a new .ts webpack config under configs/

No action needed — configs/tsconfig.json includes **/*.

Adding a Node script that needs to run without ts-node

Place under scripts/ as CommonJS (require/module.exports). Do not use ESM syntax — configs/tsconfig.json no longer has allowJs and Node 22 will load ESM-syntax .js files as ESM (no __dirname).

redis의 다른 스킬

docs-sync
redis
마스터 브랜치의 구현 및 구성을 분석하여 docs/, README.md, 패키지별 README에서 누락되거나, 부정확하거나, 오래된 문서를 찾습니다.
official
implement-command
redis
Add a new Redis command (or command variant) to node-redis end-to-end — the `<NAME>.ts` Command file, its registration with JSDoc in the package…
official
maintainer-review
redis
GitHub 이슈 또는 풀 리퀘스트 URL을 node-redis 관리자로서 검토하고, 해당 주장이 실제인지, 실질적으로 중요한지, 이미 처리되었는지에 대한 단계적 평가를 수행합니다.
official
pr-draft-summary
redis
node-redis에 필요한 PR 준비 요약 블록, 브랜치 제안, 제목 및 초안 설명을 생성합니다. 최종 응답 전에 항상 사용해야 합니다...
official
runtime-behavior-probe
redis
임시 TypeScript 프로브 스크립트, 검증 매트릭스, 상태 제어, 결과 우선 보고서를 사용하여 runtime-behavior-probe 조사를 계획하고 실행합니다. 사용…
official
backend
redis
NestJS 백엔드 개발 패턴: RedisInsight API를 위한 모듈 구조, 서비스, 컨트롤러, DTO, 의존성 주입 및 오류 처리. 다음 경우에 사용…
official
branches
redis
소문자 케밥 케이스에 유형 접두사와 이슈/티켓 식별자를 사용하세요. 브랜치 이름은 GitHub Actions 워크플로우 규칙(.github/workflows/enforce-branch-name-rules.yml 참조)과 일치해야 합니다.
official
code-quality
redis
Code-quality standards for RedisInsight: TypeScript strictness, naming conventions (camelCase, PascalCase, UPPER_SNAKE_CASE), linting rules, no `any` without…
official