@xylabs/ts-scripts-yarn3 7.4.5 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xylabs/ts-scripts-yarn3",
3
- "version": "7.4.5",
3
+ "version": "7.4.6",
4
4
  "description": "TypeScript project scripts",
5
5
  "keywords": [
6
6
  "xylabs",
@@ -93,7 +93,7 @@
93
93
  "@types/parse-git-config": "~3.0.4",
94
94
  "@types/picomatch": "~4.0.2",
95
95
  "@types/yargs": "~17.0.35",
96
- "@xylabs/tsconfig": "~7.4.5",
96
+ "@xylabs/tsconfig": "~7.4.6",
97
97
  "esbuild": "0.27.3",
98
98
  "types-package-json": "~2.0.39",
99
99
  "typescript": "~5.9.3",
@@ -0,0 +1,55 @@
1
+ # XY Labs - Linting & ESLint Gotchas
2
+
3
+ > Auto-managed by `yarn xy claude-rules`. Do not edit manually.
4
+
5
+ ## Post-change linting
6
+
7
+ After making significant code changes, run `yarn xy lint` to verify compliance
8
+ and fix any violations before considering the task complete.
9
+
10
+ ## Non-obvious ESLint rules to follow
11
+
12
+ These are the rules most likely to be violated by generated code:
13
+
14
+ ### Complexity limits
15
+ - **`max-statements: 32`** — functions must have 32 or fewer statements. Break large functions into smaller helpers.
16
+ - **`complexity: 18`** — max cyclomatic complexity of 18 per function
17
+ - **`max-lines: 512`** — files must not exceed 512 lines (blank lines excluded)
18
+ - **`max-depth: 6`** — max nesting depth of 6 levels
19
+
20
+ ### Import style
21
+ - **`unicorn/import-style`** — use default imports for Node.js built-ins: `import PATH from 'node:path'`, not `import { resolve } from 'node:path'`
22
+ - **`no-restricted-imports`** — never import from barrel `index.ts` files (e.g. `'./index.ts'`, `'../index.ts'`). Import from the specific module file instead.
23
+
24
+ ### Object formatting
25
+ - **`@stylistic/object-curly-newline`** — objects, imports, and destructuring with 3+ properties must use multi-line formatting:
26
+ ```typescript
27
+ // wrong
28
+ const { created, templateNames, updated } = syncRuleFiles(rulesDir)
29
+
30
+ // correct
31
+ const {
32
+ created, templateNames, updated,
33
+ } = syncRuleFiles(rulesDir)
34
+ ```
35
+ - **`@stylistic/object-curly-spacing`** — always use spaces inside braces: `{ foo }` not `{foo}`
36
+
37
+ ### Expressions
38
+ - **`@typescript-eslint/no-unused-expressions`** — no standalone ternaries as statements. Use `if/else` instead of `condition ? a++ : b++`
39
+ - **`@typescript-eslint/no-unused-vars`** — prefix intentionally unused variables with `_` (e.g. `_unused`)
40
+
41
+ ### Enums are disallowed
42
+ - **`no-restricted-syntax`** — do not use TypeScript `enum`. Use a union of string literals or a `const` object instead:
43
+ ```typescript
44
+ // wrong
45
+ enum Status { Active, Inactive }
46
+
47
+ // correct
48
+ type Status = 'active' | 'inactive'
49
+ ```
50
+
51
+ ### Class member ordering
52
+ - **`@typescript-eslint/member-ordering`** — class members must be ordered: fields, constructor, accessors, methods. Within each group, order alphabetically.
53
+
54
+ ### JSX
55
+ - **`@stylistic/jsx-curly-brace-presence`** — no unnecessary braces in JSX props: `prop="value"` not `prop={"value"}`
@@ -8,3 +8,4 @@
8
8
  - Use `satisfies` for type checking without widening
9
9
  - Prefer `Record<string, T>` over index signatures
10
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