| name | typescript |
|---|---|
| description | TypeScript version, src layout, ESLint and Prettier, strictness, and build-time assets for @contentstack/utils |
- Editing or adding
.tsundersrc/or__test__/. - Changing compiler options, lint rules, or formatting scope.
- TypeScript ~4.9 (
package.json,tsconfig.json). - Emit:
tsc→dist/lib, declarations →dist/types/; Rollup →dist/index.es.js(rollup.config.js). - Strict:
strict: truewithstrictNullChecks: false— avoid unnecessary null/undefined leaks in public APIs when touching types.
- Library:
src/**/*.tsonly (tsconfig.jsoninclude). - Tests:
__test__/(excluded fromtscinclude; Jest/ts-jest type-checks test files). - Public API: single barrel —
src/index.tsunless you intentionally add another entry.
- Match existing naming (PascalCase types, camelCase functions; folders
Models/,nodes/,helper/,options/). - ESLint:
eslint.config.js—@typescript-eslintrecommended rules for__test__/;js.configs.recommendedfor other TS files. - Prettier:
npm run formatcoverssrc/**/*.ts; keep tests consistently formatted when you edit them.
src/assets/regions.json: Used bysrc/endpoints.ts; filled bynpm run download-regionsinprebuild. Listed in.gitignore— clones may need a successful build (or a local file) before tests pass.
- No shared logger; avoid noisy
consolein library code unless consistent with nearby patterns.