@cascivo/eslint-config 0.3.0 → 0.4.0
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/README.md +2 -2
- package/package.json +5 -3
- package/src/index.d.ts +8 -0
- package/src/index.js +26 -4
- package/src/oxlintrc.json +30 -0
package/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!-- generated by scripts/readme/generate.ts — edit readme.body.md, not this file -->
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
|
-
<a href="https://cascivo.com"><img src="https://cascivo.com/
|
|
4
|
+
<a href="https://cascivo.com"><img src="https://cascivo.com/logo-mark-img-accent.svg" width="72" height="72" alt="cascivo logo"></a>
|
|
5
5
|
<h1>@cascivo/eslint-config</h1>
|
|
6
6
|
<p><strong>Flat ESLint config for apps using cascivo — reconciles the signal-based reactivity contract with eslint-plugin-react-hooks 7</strong></p>
|
|
7
7
|
|
|
@@ -26,4 +26,4 @@ pnpm add @cascivo/eslint-config
|
|
|
26
26
|
|
|
27
27
|
[cascivo.com](https://cascivo.com) · [Docs](https://cascivo.com/docs) · [Storybook](https://storybook.cascivo.com) · [GitHub](https://github.com/cascivo/cascivo) · AI agents: read [`llms.txt`](https://cascivo.com/llms.txt) (install steps + component index, plain text) or use [`@cascivo/mcp`](https://github.com/cascivo/cascivo/tree/main/packages/mcp) and [`registry.json`](https://github.com/cascivo/cascivo/blob/main/registry.json) · MIT
|
|
28
28
|
|
|
29
|
-
<div align="center"><a href="https://cascivo.com"><img src="https://cascivo.com/
|
|
29
|
+
<div align="center"><a href="https://cascivo.com"><img src="https://cascivo.com/logo-mark-img.svg" width="28" height="28" alt="cascivo"></a></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cascivo/eslint-config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
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": [
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"files": [
|
|
25
25
|
"src/**/*.js",
|
|
26
26
|
"src/**/*.d.ts",
|
|
27
|
+
"src/**/*.json",
|
|
27
28
|
"!src/**/*.test.js"
|
|
28
29
|
],
|
|
29
30
|
"type": "module",
|
|
@@ -32,14 +33,15 @@
|
|
|
32
33
|
".": {
|
|
33
34
|
"types": "./src/index.d.ts",
|
|
34
35
|
"default": "./src/index.js"
|
|
35
|
-
}
|
|
36
|
+
},
|
|
37
|
+
"./oxlintrc.json": "./src/oxlintrc.json"
|
|
36
38
|
},
|
|
37
39
|
"publishConfig": {
|
|
38
40
|
"access": "public",
|
|
39
41
|
"provenance": true
|
|
40
42
|
},
|
|
41
43
|
"dependencies": {
|
|
42
|
-
"@cascivo/eslint-plugin": "0.
|
|
44
|
+
"@cascivo/eslint-plugin": "0.2.0"
|
|
43
45
|
},
|
|
44
46
|
"scripts": {
|
|
45
47
|
"build": "echo 'eslint-config: plain ESM, no build'",
|
package/src/index.d.ts
CHANGED
|
@@ -30,6 +30,14 @@ export declare const cascivoSignals: CascadeFlatConfig
|
|
|
30
30
|
*/
|
|
31
31
|
export declare const cascivoPropVocabulary: CascadeFlatConfig
|
|
32
32
|
|
|
33
|
+
/**
|
|
34
|
+
* Enables `cascivo/token-values` at **warn** — the rule that reports a `--cascivo-*` custom
|
|
35
|
+
* property that does not exist. CSS drops an unknown custom property silently, so a
|
|
36
|
+
* misspelled token is not an error anywhere: it simply has no effect. Kept at `warn` for the
|
|
37
|
+
* same reason as `cascivoPropVocabulary`.
|
|
38
|
+
*/
|
|
39
|
+
export declare const cascivoTokenValues: CascadeFlatConfig
|
|
40
|
+
|
|
33
41
|
/**
|
|
34
42
|
* Scopes host stylistic rules off source vendored by `cascivo add`. Copy-paste path only.
|
|
35
43
|
*
|
package/src/index.js
CHANGED
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
* Prefer the pieces individually when you only vendor source, or only use the package:
|
|
48
48
|
*
|
|
49
49
|
* ```js
|
|
50
|
-
* import { cascivoSignals, cascivoPropVocabulary, cascivoVendoredSource } from '@cascivo/eslint-config'
|
|
51
|
-
* export default [...yourConfig, cascivoSignals, cascivoPropVocabulary, cascivoVendoredSource()]
|
|
50
|
+
* import { cascivoSignals, cascivoPropVocabulary, cascivoTokenValues, cascivoVendoredSource } from '@cascivo/eslint-config'
|
|
51
|
+
* export default [...yourConfig, cascivoSignals, cascivoPropVocabulary, cascivoTokenValues, cascivoVendoredSource()]
|
|
52
52
|
* ```
|
|
53
53
|
*/
|
|
54
54
|
import cascivoPlugin from '@cascivo/eslint-plugin'
|
|
@@ -168,7 +168,29 @@ export const cascivoPropVocabulary = {
|
|
|
168
168
|
rules: { 'cascivo/prop-vocabulary': 'warn' },
|
|
169
169
|
}
|
|
170
170
|
|
|
171
|
-
/**
|
|
172
|
-
|
|
171
|
+
/**
|
|
172
|
+
* The unknown-token messages, at `warn`.
|
|
173
|
+
*
|
|
174
|
+
* `--cascivo-color-acent` is not a type error, not a build error, and not a runtime error:
|
|
175
|
+
* CSS drops an unknown custom property silently, so a misspelled token simply has no effect
|
|
176
|
+
* and the search for the cause starts in the component. React's `CSSProperties` has no index
|
|
177
|
+
* signature for `--*` keys either, so every custom property in a `style` prop reaches the DOM
|
|
178
|
+
* through a cast the adopter wrote — and a cast launders a typo by definition.
|
|
179
|
+
*
|
|
180
|
+
* This rule is the editor-time half of that gap; `CascivoTokenStyle` + `satisfies` (from
|
|
181
|
+
* `@cascivo/tokens/style-contract`) is the compile-time half, and `cascivo audit --ai` is the
|
|
182
|
+
* gate. See `@cascivo/eslint-plugin`'s `token-values.js` for the full rationale.
|
|
183
|
+
*
|
|
184
|
+
* **`warn`, never `error`**, for the same reason as `prop-vocabulary`: a rule that fails a
|
|
185
|
+
* build gets this config deleted, and that takes `react-hooks/immutability` with it.
|
|
186
|
+
*/
|
|
187
|
+
export const cascivoTokenValues = {
|
|
188
|
+
name: 'cascivo/token-values',
|
|
189
|
+
plugins: { cascivo: cascivoPlugin },
|
|
190
|
+
rules: { 'cascivo/token-values': 'warn' },
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
/** Every fragment, in the order flat config wants them. Spread last. */
|
|
194
|
+
const cascivo = [cascivoSignals, cascivoPropVocabulary, cascivoTokenValues, cascivoVendoredSource()]
|
|
173
195
|
|
|
174
196
|
export default cascivo
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
// oxlint fragment for apps that use cascivo — the oxlint half of this package.
|
|
3
|
+
//
|
|
4
|
+
// `pnpm create vite --template react-ts` scaffolds oxlint with a `.oxlintrc.json`, not
|
|
5
|
+
// ESLint, so the documented remedy for the signals idiom ("add @cascivo/eslint-config and
|
|
6
|
+
// spread it into eslint.config.js") did not apply to the most common way to start a
|
|
7
|
+
// project in 2026 — the adopter had no eslint.config.js to spread into and worked the rule
|
|
8
|
+
// id out themselves (2026-08-31 report §13).
|
|
9
|
+
//
|
|
10
|
+
// Extend it from your own config:
|
|
11
|
+
//
|
|
12
|
+
// {
|
|
13
|
+
// "extends": ["./node_modules/@cascivo/eslint-config/src/oxlintrc.json"],
|
|
14
|
+
// "categories": { "correctness": "error" }
|
|
15
|
+
// }
|
|
16
|
+
//
|
|
17
|
+
// Or copy the one rule below — that is all this file is.
|
|
18
|
+
//
|
|
19
|
+
// ⚠ oxlint REJECTS a config that names a rule its build does not implement
|
|
20
|
+
// ("Rule 'immutability' not found in plugin 'react'"), so this fragment needs an oxlint
|
|
21
|
+
// recent enough to ship `react/immutability`. On an older oxlint the rule does not fire in
|
|
22
|
+
// the first place, so you need neither the fragment nor the rule.
|
|
23
|
+
"rules": {
|
|
24
|
+
// oxlint's port of `react-hooks/immutability`. It reports every `signal.value = next` —
|
|
25
|
+
// cascivo's mandatory state idiom — as "This value cannot be modified". See
|
|
26
|
+
// docs/USING-WITH-STRICT-ESLINT.md §1 for what turning it off costs; the reasoning is
|
|
27
|
+
// identical to the ESLint half of this package.
|
|
28
|
+
"react/immutability": "off"
|
|
29
|
+
}
|
|
30
|
+
}
|