@xylabs/ts-scripts-yarn3 7.4.4 → 7.4.6

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.
@@ -0,0 +1,10 @@
1
+ # XY Labs - Naming Conventions
2
+
3
+ > Auto-managed by `yarn xy claude-rules`. Do not edit manually.
4
+
5
+ - Files: camelCase for modules (`myModule.ts`), PascalCase for components/classes (`MyComponent.tsx`)
6
+ - Variables/functions: camelCase
7
+ - Classes/interfaces/types: PascalCase
8
+ - Constants: UPPER_SNAKE_CASE (e.g. `MAX_RETRIES`, `DEFAULT_TIMEOUT`)
9
+ - Boolean variables: prefix with `is`, `has`, `should`, `can` (e.g. `isReady`, `hasError`)
10
+ - Event handlers: prefix with `on` (e.g. `onClick`, `onSubmit`)
@@ -0,0 +1,22 @@
1
+ # XY Labs - Style & Formatting
2
+
3
+ > Auto-managed by `yarn xy claude-rules`. Do not edit manually.
4
+
5
+ - Use TypeScript strict mode for all source files
6
+ - Use ESM (`import`/`export`) exclusively - never use CommonJS (`require`/`module.exports`)
7
+ - Prefer `const` over `let`; never use `var`
8
+ - Use standard `function` declarations for all top-level functions, even short ones (e.g. `export function foo() { ... }`)
9
+ - Use arrow functions only for callbacks, inline arguments, and closures
10
+ - Use explicit return types on exported functions
11
+ - Use `interface` over `type` for object shapes when possible
12
+ - Prefer named exports over default exports
13
+ - Use template literals over string concatenation
14
+ - Use optional chaining (`?.`) and nullish coalescing (`??`) over manual checks
15
+ - Keep files focused and small - prefer many small files over few large ones
16
+ - Use `index.ts` barrel files for clean re-exports from directories
17
+ - No unused imports or variables - the linter will catch these
18
+ - Use default imports for Node.js built-in modules: `import PATH from 'node:path'`, `import FS from 'node:fs'` — not named imports like `import { resolve } from 'node:path'` (enforced by `unicorn/import-style`)
19
+ - String quotes: single quotes for code, backticks for interpolation
20
+ - Trailing commas: always (ES5+)
21
+ - Semicolons: never (rely on ASI)
22
+ - Indent with 2 spaces
@@ -0,0 +1,11 @@
1
+ # XY Labs - TypeScript Specifics
2
+
3
+ > Auto-managed by `yarn xy claude-rules`. Do not edit manually.
4
+
5
+ - Enable `strict: true` in all tsconfig files
6
+ - Avoid `any` - use `unknown` when the type is truly unknown
7
+ - Avoid type assertions (`as`) - prefer type guards and narrowing
8
+ - Use `satisfies` for type checking without widening
9
+ - Prefer `Record<string, T>` over index signatures
10
+ - Use discriminated unions for state machines and variant types
11
+ - When a function uses `await`, its return type must be `Promise<T>` — never `Promise<Promisable<T>>`. If converting a `Promisable<T>` return type to async, replace it with `Promise<T>`, do not wrap it