@cascivo/eslint-config 0.2.1 → 0.2.2

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +45 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cascivo/eslint-config",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "private": false,
5
5
  "description": "Flat ESLint config for apps using cascivo — reconciles the signal-based reactivity contract with eslint-plugin-react-hooks 7",
6
6
  "keywords": [
package/src/index.js CHANGED
@@ -93,6 +93,51 @@ export function cascivoVendoredSource(glob = 'src/components/ui/**') {
93
93
  'react/no-array-index-key': 'off', // stable-content lists key by index intentionally
94
94
  'no-shadow': 'off', // false-positives on TS declaration merging (compound components)
95
95
  'no-control-regex': 'off', // e.g. the log viewer strips ANSI escapes (\x1b) on purpose
96
+
97
+ // ---------------------------------------------------------------------------------
98
+ // Everything below was DERIVED FROM A RUN, not authored from memory.
99
+ // scripts/checks/host-lint/eslint runs real ESLint over the vendored source in CI and
100
+ // fails if any of these stops firing (a scope-off with nothing behind it is removed)
101
+ // or if a new class appears. Before that fixture existed this list covered only
102
+ // stylistic rules and the eight below were invisible — 117 errors an adopter saw and
103
+ // cascivo did not. See docs/internal/feedback/README.md, Mechanism F.
104
+ // ---------------------------------------------------------------------------------
105
+
106
+ // 34 sites. cascivo's house style PRESCRIBES the render-phase ref write:
107
+ // CLAUDE.md, "Syncing a controlled React prop into a signal" —
108
+ // const onCloseRef = useRef(onClose)
109
+ // onCloseRef.current = onClose // sync during render
110
+ // It is how a `useSignalEffect` body reaches the *current* callback without
111
+ // re-subscribing the effect to it. The remaining sites pass a ref into
112
+ // `composeRefs()`/`cloneElement()`, which the rule cannot prove is deferred.
113
+ // Rewriting 41 call sites to satisfy a rule the documented idiom contradicts is the
114
+ // wrong trade; turning it off costs you the rule's protection against genuine
115
+ // render-phase ref *reads* elsewhere in the vendored files only.
116
+ 'react-hooks/refs': 'off',
117
+
118
+ // 2 sites, both `const LinkComponent = getLinkComponent()`. The value is deliberately
119
+ // swappable at runtime via `setLinkComponent()` — that is the entire point of the
120
+ // router-integration seam — so it cannot be hoisted to module scope. The state-reset
121
+ // the rule warns about does not occur: the registry holds one stable component
122
+ // identity between `setLinkComponent` calls.
123
+ 'react-hooks/static-components': 'off',
124
+
125
+ // 69 sites. TYPE-AWARE, and its verdict depends on which `@types/react` resolves in
126
+ // YOUR project. The bulk are deliberate cross-version escape hatches:
127
+ // `{ anchorName } as CSSProperties` (CSS Anchor Positioning is absent from older
128
+ // `CSSProperties`) and `ref as never` (ref variance changed in @types/react 19).
129
+ // "Unnecessary" under one version is load-bearing under another, so removing them on
130
+ // the rule's advice would break adopters on a different version — the exact failure
131
+ // mode tracked in docs/internal/feedback as the `@types/react` mechanism.
132
+ '@typescript-eslint/no-unnecessary-type-assertion': 'off',
133
+
134
+ // 10 sites, all exhaustive-union final branches and runtime-nullable DOM reads:
135
+ // the closing `else if (placement === 'right')` of an if-chain TS has already
136
+ // narrowed, `if (phase === 'dismissing')` closing an FSM switch, `el.textContent ?? ''`
137
+ // (typed non-null on Element, nullable at runtime on some node types). Writing the
138
+ // final branch explicitly is clearer than a bare `else`, and dropping the `??` would
139
+ // be a real regression. Also type-aware, so also tsconfig-dependent.
140
+ '@typescript-eslint/no-unnecessary-condition': 'off',
96
141
  },
97
142
  linterOptions: {
98
143
  // cascivo's rule-scoped `eslint-disable` directives may target rule ids your config