# Javascript Style

> JavaScript and TypeScript declaration style for lib, webpack, types — ESLint standard, modules, JSDoc.

- Skill: `contentstack/javascript-style` (Agent Skill)
- Install (CLI): `npx skillmds@latest add contentstack/javascript-style`
- Raw SKILL.md: https://api.skillmd.com/api/skills/contentstack/javascript-style/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: contentstack (https://skillmd.com/u/contentstack)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/contentstack/javascript-style

---


# JavaScript & types – Contentstack Management JavaScript SDK

## When to use

- Editing **`lib/**/*.js`**, **`webpack/**/*.js`**, **`types/**`**, or root **`*.mjs`**.
- Matching ESLint **standard** style and public JSDoc for npm consumers.

## Instructions

### Runtime & modules

- **Source** is **ES modules** under **`lib/`** (`import` / `export`). Builds target Node and browsers via Babel + Webpack (`package.json` scripts).
- **`types/`** holds public TypeScript declarations for npm; keep aligned with **`lib/`** JSDoc and exports.

### Style & tooling

- **ESLint** uses **`eslint-config-standard`** and **`@babel/eslint-parser`**; match **semicolon-free** standard style and two-space indentation as in existing **`lib/`** files.
- **Environment**: ESLint `es2020`; **`test/**/*.js`** may relax rules via **`overrides`** in **`.eslintrc.js`**.

### Patterns

- Prefer **named exports** where the codebase already does; **default exports** for factories (`contentstackClient`, HTTP client factory).
- **JSDoc** (`@memberof`, `@func`, `@param`, `@returns`, `@example`) on **public** API, consistent with **`lib/contentstack.js`** and **`lib/contentstackClient.js`**.
- **Dependencies**: **`lodash`**, **`axios`**, **`qs`**, **`@contentstack/utils`** — follow existing import paths (including **`.js`** suffixes where used).

### Logging

- Avoid noisy **`console.log`** in library code except via existing **`logHandler`** / patterns in **`lib/core/contentstackHTTPClient.js`**.
- Never log full **authtoken**, **management tokens**, or **passwords**.

