@starci/eslint-canon-fe 1.0.1 → 1.1.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 +86 -86
- package/contract.mjs +1363 -1199
- package/contracts.ts +1 -1
- package/file-layout.mjs +364 -310
- package/index.mjs +17 -0
- package/landmark.mjs +6 -6
- package/lint-adoption.mjs +116 -116
- package/package.json +1 -1
- package/props-and-slots.mjs +339 -188
- package/props.ts +33 -33
- package/served-locale.mjs +1 -1
- package/typography.mjs +83 -83
- package/vendor-boundary.mjs +510 -526
package/README.md
CHANGED
|
@@ -1,86 +1,86 @@
|
|
|
1
|
-
# @starci/eslint-canon-fe
|
|
2
|
-
|
|
3
|
-
**58 ESLint rules, from 16 laws, that hold a React front end to one way of being written.**
|
|
4
|
-
|
|
5
|
-
Not a style pack. These rules enforce *architecture*: which tier a component belongs to, whether
|
|
6
|
-
structure may be typed as a raw class string, where a vendor primitive may be imported, which file
|
|
7
|
-
is allowed to fetch. Prettier decides how code looks; this decides what it is allowed to be.
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm i -D @starci/eslint-canon-fe
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Use it
|
|
14
|
-
|
|
15
|
-
One block in `eslint.config.mjs`. It attaches every rule at the severity the canon asks for, and
|
|
16
|
-
makes inline disable comments ineffective rather than merely discouraged.
|
|
17
|
-
|
|
18
|
-
```js
|
|
19
|
-
import starciFe, {
|
|
20
|
-
recommended,
|
|
21
|
-
linterOptions,
|
|
22
|
-
starciFeConfig,
|
|
23
|
-
} from "@starci/eslint-canon-fe"
|
|
24
|
-
|
|
25
|
-
export default [
|
|
26
|
-
// …your own ignores, language options and other plugins…
|
|
27
|
-
starciFeConfig({
|
|
28
|
-
layout: "single-app", // or "monorepo"
|
|
29
|
-
plugin: starciFe,
|
|
30
|
-
recommended,
|
|
31
|
-
linterOptions,
|
|
32
|
-
}),
|
|
33
|
-
]
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
`layout` is the one thing a repository owns. `single-app` governs `src/**`; `monorepo` governs
|
|
37
|
-
`packages/ui/src/**` and `apps/*/src/**`. **Which globs the law applies to is your fact. What the
|
|
38
|
-
law says is not** — so there is no option to switch a rule off or lower it to a warning.
|
|
39
|
-
|
|
40
|
-
Prefer to wire it by hand? Every piece is exported: `rules`, `recommended`, `linterOptions`,
|
|
41
|
-
`ruleOwners`, `audits`, `auditOwners`, `lawOwners`.
|
|
42
|
-
|
|
43
|
-
## What it actually catches
|
|
44
|
-
|
|
45
|
-
A sample, not the list:
|
|
46
|
-
|
|
47
|
-
| Rule | What it stops |
|
|
48
|
-
|---|---|
|
|
49
|
-
| `no-literal-structural-class` | Layout classes typed straight onto an element instead of named in the contract registry |
|
|
50
|
-
| `no-unknown-contract-key` | A structure key that no registry entry declares |
|
|
51
|
-
| `presentational-purity` | A drawing component that fetches, so it can never be rendered from a test |
|
|
52
|
-
| `connected-block-has-presentational-twin` | A block wired to data with no pure half to render |
|
|
53
|
-
| `no-vendor-icon-outside-icon-leaf` | A vendor glyph imported anywhere but the one leaf that wraps it |
|
|
54
|
-
| `no-arbitrary-value` · `no-fractional-step` | Values off the spacing scale, invented per call site |
|
|
55
|
-
| `no-resting-twin-component` | A hand-kept skeleton tree that drifts from the thing it stands in for |
|
|
56
|
-
| `no-inline-lint-config` | A disable comment switching the architecture off for one line |
|
|
57
|
-
| `require-export-jsdoc` | An exported symbol with no stated reason to exist |
|
|
58
|
-
| `no-second-language-in-source` | Copy hardcoded where the translation layer should own it |
|
|
59
|
-
|
|
60
|
-
Every rule names the law that declares it — `ruleOwners` maps rule name to law, so a failing build
|
|
61
|
-
line leads straight to the document that explains why.
|
|
62
|
-
|
|
63
|
-
## Why the rules are all errors
|
|
64
|
-
|
|
65
|
-
Existing debt gets fixed before adoption. Lowering architecture to `warn` teaches every later author
|
|
66
|
-
that the boundary is optional, and a boundary everyone learns is optional is not a boundary. There
|
|
67
|
-
is no staged rollout mode, on purpose.
|
|
68
|
-
|
|
69
|
-
## Companion
|
|
70
|
-
|
|
71
|
-
- **[@starci/eslint-canon-be](https://www.npmjs.com/package/@starci/eslint-canon-be)** — the
|
|
72
|
-
back-end half: 37 rules from 15 laws covering CQRS, exceptions, transport, observability and
|
|
73
|
-
end-to-end flows.
|
|
74
|
-
|
|
75
|
-
## Where the laws live
|
|
76
|
-
|
|
77
|
-
Each rule is the enforceable half of a written law. The prose — why the rule exists, what it
|
|
78
|
-
refuses, which cases sit just outside it — is published openly at
|
|
79
|
-
[starci183/starci-claude-skills](https://github.com/starci183/starci-claude-skills).
|
|
80
|
-
|
|
81
|
-
A rule that cannot be pointed at in real code is a proposal, not a law. Everything here is
|
|
82
|
-
pointed at.
|
|
83
|
-
|
|
84
|
-
## Requirements
|
|
85
|
-
|
|
86
|
-
ESLint 9+ (flat config), Node 20.9+.
|
|
1
|
+
# @starci/eslint-canon-fe
|
|
2
|
+
|
|
3
|
+
**58 ESLint rules, from 16 laws, that hold a React front end to one way of being written.**
|
|
4
|
+
|
|
5
|
+
Not a style pack. These rules enforce *architecture*: which tier a component belongs to, whether
|
|
6
|
+
structure may be typed as a raw class string, where a vendor primitive may be imported, which file
|
|
7
|
+
is allowed to fetch. Prettier decides how code looks; this decides what it is allowed to be.
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm i -D @starci/eslint-canon-fe
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Use it
|
|
14
|
+
|
|
15
|
+
One block in `eslint.config.mjs`. It attaches every rule at the severity the canon asks for, and
|
|
16
|
+
makes inline disable comments ineffective rather than merely discouraged.
|
|
17
|
+
|
|
18
|
+
```js
|
|
19
|
+
import starciFe, {
|
|
20
|
+
recommended,
|
|
21
|
+
linterOptions,
|
|
22
|
+
starciFeConfig,
|
|
23
|
+
} from "@starci/eslint-canon-fe"
|
|
24
|
+
|
|
25
|
+
export default [
|
|
26
|
+
// …your own ignores, language options and other plugins…
|
|
27
|
+
starciFeConfig({
|
|
28
|
+
layout: "single-app", // or "monorepo"
|
|
29
|
+
plugin: starciFe,
|
|
30
|
+
recommended,
|
|
31
|
+
linterOptions,
|
|
32
|
+
}),
|
|
33
|
+
]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
`layout` is the one thing a repository owns. `single-app` governs `src/**`; `monorepo` governs
|
|
37
|
+
`packages/ui/src/**` and `apps/*/src/**`. **Which globs the law applies to is your fact. What the
|
|
38
|
+
law says is not** — so there is no option to switch a rule off or lower it to a warning.
|
|
39
|
+
|
|
40
|
+
Prefer to wire it by hand? Every piece is exported: `rules`, `recommended`, `linterOptions`,
|
|
41
|
+
`ruleOwners`, `audits`, `auditOwners`, `lawOwners`.
|
|
42
|
+
|
|
43
|
+
## What it actually catches
|
|
44
|
+
|
|
45
|
+
A sample, not the list:
|
|
46
|
+
|
|
47
|
+
| Rule | What it stops |
|
|
48
|
+
|---|---|
|
|
49
|
+
| `no-literal-structural-class` | Layout classes typed straight onto an element instead of named in the contract registry |
|
|
50
|
+
| `no-unknown-contract-key` | A structure key that no registry entry declares |
|
|
51
|
+
| `presentational-purity` | A drawing component that fetches, so it can never be rendered from a test |
|
|
52
|
+
| `connected-block-has-presentational-twin` | A block wired to data with no pure half to render |
|
|
53
|
+
| `no-vendor-icon-outside-icon-leaf` | A vendor glyph imported anywhere but the one leaf that wraps it |
|
|
54
|
+
| `no-arbitrary-value` · `no-fractional-step` | Values off the spacing scale, invented per call site |
|
|
55
|
+
| `no-resting-twin-component` | A hand-kept skeleton tree that drifts from the thing it stands in for |
|
|
56
|
+
| `no-inline-lint-config` | A disable comment switching the architecture off for one line |
|
|
57
|
+
| `require-export-jsdoc` | An exported symbol with no stated reason to exist |
|
|
58
|
+
| `no-second-language-in-source` | Copy hardcoded where the translation layer should own it |
|
|
59
|
+
|
|
60
|
+
Every rule names the law that declares it — `ruleOwners` maps rule name to law, so a failing build
|
|
61
|
+
line leads straight to the document that explains why.
|
|
62
|
+
|
|
63
|
+
## Why the rules are all errors
|
|
64
|
+
|
|
65
|
+
Existing debt gets fixed before adoption. Lowering architecture to `warn` teaches every later author
|
|
66
|
+
that the boundary is optional, and a boundary everyone learns is optional is not a boundary. There
|
|
67
|
+
is no staged rollout mode, on purpose.
|
|
68
|
+
|
|
69
|
+
## Companion
|
|
70
|
+
|
|
71
|
+
- **[@starci/eslint-canon-be](https://www.npmjs.com/package/@starci/eslint-canon-be)** — the
|
|
72
|
+
back-end half: 37 rules from 15 laws covering CQRS, exceptions, transport, observability and
|
|
73
|
+
end-to-end flows.
|
|
74
|
+
|
|
75
|
+
## Where the laws live
|
|
76
|
+
|
|
77
|
+
Each rule is the enforceable half of a written law. The prose — why the rule exists, what it
|
|
78
|
+
refuses, which cases sit just outside it — is published openly at
|
|
79
|
+
[starci183/starci-claude-skills](https://github.com/starci183/starci-claude-skills).
|
|
80
|
+
|
|
81
|
+
A rule that cannot be pointed at in real code is a proposal, not a law. Everything here is
|
|
82
|
+
pointed at.
|
|
83
|
+
|
|
84
|
+
## Requirements
|
|
85
|
+
|
|
86
|
+
ESLint 9+ (flat config), Node 20.9+.
|