@krizaka/config 0.4.1 → 0.5.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/eslint/plugin.js +2 -1
- package/eslint/rules.js +23 -2
- package/eslint/stack.js +3 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -119,11 +119,11 @@ The rule — on in `krizakaBase` and `krizakaNext` — refuses a name read throu
|
|
|
119
119
|
|
|
120
120
|
- a **product**: the organisation's name, the repository's own (the first word of its package.json name,
|
|
121
121
|
`acme-monorepo` → `ACME_`), or one you name — a deployment already says which product it is;
|
|
122
|
-
- a **vendor** (`BUNNY_`, `MAILGUN_`, `RESEND_`, `STRIPE_`, `GOOGLE_`, `EXPO_`, `REDIS_
|
|
122
|
+
- a **vendor** (`BUNNY_`, `MAILGUN_`, `RESEND_`, `STRIPE_`, `GOOGLE_`, `EXPO_`, `REDIS_`…): the vendor is a
|
|
123
123
|
value (`MEDIA_STORAGE_PROVIDER=bunny`, `MAIL_PROVIDER=mailgun`) and its settings sit under the context
|
|
124
124
|
(`MEDIA_STORAGE_API_KEY`, `MAIL_API_KEY`).
|
|
125
125
|
|
|
126
|
-
The platforms' own names (`GITHUB_TOKEN`, `
|
|
126
|
+
The platforms' own names (`GITHUB_TOKEN`, `EAS_BUILD`, …) pass. Tune it with
|
|
127
127
|
`envNames({ products, vendors, allow })` from `@krizaka/config/eslint/env-names`; `envNamePrefixProblem(name)` gives
|
|
128
128
|
the same verdict to a script (a `.env.example` or deployment spec check).
|
|
129
129
|
|
package/eslint/plugin.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// The `krizaka` ESLint plugin: one object carrying every rule, so that configs registering it compose (flat config
|
|
2
2
|
// refuses two different objects under the same plugin name).
|
|
3
|
-
import { envName, noDirectTanstackImport, noFetchInClientEffect, noLightVariant, noLocaleTernaryRule, noLocalTableOrForm, noRawPalette } from "./rules.js";
|
|
3
|
+
import { envName, noDirectTanstackImport, noFamilySwitcher, noFetchInClientEffect, noLightVariant, noLocaleTernaryRule, noLocalTableOrForm, noRawPalette } from "./rules.js";
|
|
4
4
|
|
|
5
5
|
/** @type {import("eslint").ESLint.Plugin} */
|
|
6
6
|
export const krizakaPlugin = {
|
|
@@ -13,6 +13,7 @@ export const krizakaPlugin = {
|
|
|
13
13
|
"no-light-variant": noLightVariant,
|
|
14
14
|
"no-raw-palette": noRawPalette,
|
|
15
15
|
"env-name": envName,
|
|
16
|
+
"no-family-switcher": noFamilySwitcher,
|
|
16
17
|
},
|
|
17
18
|
};
|
|
18
19
|
|
package/eslint/rules.js
CHANGED
|
@@ -100,6 +100,27 @@ export const noDirectTanstackImport = {
|
|
|
100
100
|
},
|
|
101
101
|
};
|
|
102
102
|
|
|
103
|
+
/** Oussama, 2026-10-22: krizaka.com is the only way back between the sites; no site carries the family switcher. */
|
|
104
|
+
/** @type {RuleModule} */
|
|
105
|
+
export const noFamilySwitcher = {
|
|
106
|
+
meta: {
|
|
107
|
+
type: "problem",
|
|
108
|
+
docs: { description: "Forbid the family switcher (NavBar.Family): krizaka.com is the only link back between the Krizaka sites." },
|
|
109
|
+
schema: [],
|
|
110
|
+
messages: {
|
|
111
|
+
family:
|
|
112
|
+
"No family switcher (NavBar.Family) on any site: krizaka.com is the only way back. The footer carries one quiet « A Krizaka project » link to https://www.krizaka.com (SiteFooter).",
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
create(context) {
|
|
116
|
+
return {
|
|
117
|
+
"JSXMemberExpression[object.name='NavBar'][property.name='Family']": (/** @type {Node} */ node) => context.report({ node, messageId: "family" }),
|
|
118
|
+
"JSXIdentifier[name='NavBarFamily']": (/** @type {Node} */ node) => context.report({ node, messageId: "family" }),
|
|
119
|
+
"ImportSpecifier[imported.name='NavBarFamily']": (/** @type {Node} */ node) => context.report({ node, messageId: "family" }),
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
|
|
103
124
|
/** S2, S3: a table is `@krizaka/ui/data-table`, a form is `@krizaka/ui/form` — except a form of a single field. */
|
|
104
125
|
/** @type {RuleModule} */
|
|
105
126
|
export const noLocalTableOrForm = {
|
|
@@ -180,11 +201,11 @@ export const ENV_VENDOR_PREFIXES = Object.freeze([
|
|
|
180
201
|
"TWILIO", "SUPABASE", "MAPBOX",
|
|
181
202
|
]);
|
|
182
203
|
|
|
183
|
-
/** Names the platforms set themselves (GitHub Actions,
|
|
204
|
+
/** Names the platforms set themselves (GitHub Actions, EAS): read, never chosen. */
|
|
184
205
|
export const ENV_PLATFORM_NAMES = Object.freeze([
|
|
185
206
|
"GITHUB_ACTIONS", "GITHUB_TOKEN", "GITHUB_SHA", "GITHUB_REF", "GITHUB_REF_NAME", "GITHUB_REPOSITORY", "GITHUB_RUN_ID",
|
|
186
207
|
"GITHUB_RUN_NUMBER", "GITHUB_WORKSPACE", "GITHUB_OUTPUT", "GITHUB_STEP_SUMMARY", "GITHUB_EVENT_NAME", "GITHUB_SERVER_URL",
|
|
187
|
-
"
|
|
208
|
+
"EAS_BUILD", "EAS_BUILD_PLATFORM", "EAS_BUILD_PROFILE",
|
|
188
209
|
"EXPO_TOKEN",
|
|
189
210
|
]);
|
|
190
211
|
|
package/eslint/stack.js
CHANGED
|
@@ -8,6 +8,7 @@ export const STACK_RULES = Object.freeze([
|
|
|
8
8
|
"krizaka/no-fetch-in-client-effect",
|
|
9
9
|
"krizaka/no-direct-tanstack-import",
|
|
10
10
|
"krizaka/no-local-table-or-form",
|
|
11
|
+
"krizaka/no-family-switcher",
|
|
11
12
|
]);
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -32,6 +33,8 @@ export function krizakaStack({
|
|
|
32
33
|
"krizaka/no-fetch-in-client-effect": severity,
|
|
33
34
|
"krizaka/no-direct-tanstack-import": severity,
|
|
34
35
|
"krizaka/no-local-table-or-form": [severity, { maxFormFields }],
|
|
36
|
+
// Never a warning: the family switcher is gone from every site (krizaka.com is the only way back).
|
|
37
|
+
"krizaka/no-family-switcher": "error",
|
|
35
38
|
},
|
|
36
39
|
},
|
|
37
40
|
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@krizaka/config",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "The shared configuration of every Krizaka JavaScript repository: ESLint flat configs (base, Next.js, the four UI rules, the three stack rules, no locale ternary), the dependency-cruiser boundary, tsconfig bases, Prettier, EditorConfig, and the krizaka-ratchet debt counter.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"krizaka",
|