@noctcore/eslint-plugin-contracts 0.2.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 +5 -2
- package/dist/index.cjs +1410 -84
- package/dist/index.d.cts +94 -0
- package/dist/index.d.ts +94 -0
- package/dist/index.js +1410 -84
- package/docs/rules/fetch-must-check-ok.md +83 -0
- package/docs/rules/schema-enum-field-consistency.md +75 -0
- package/docs/rules/translation-key-exists.md +155 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -52,7 +52,10 @@ Legend: ๐ง = autofixable ยท ๐ค = ships inert / `off` in `recommended` (enabl
|
|
|
52
52
|
| [`require-registered-keys`](./docs/rules/require-registered-keys.md) | Key/name argument of a configured sink API must be an imported constant, not a raw string. | | ๐ค |
|
|
53
53
|
| [`env-var-schema-parity`](./docs/rules/env-var-schema-parity.md) | `process.env.FOO` / `import.meta.env.FOO` keys must be declared in a schema file. | | ๐ค |
|
|
54
54
|
| [`require-schema-parse-at-boundary`](./docs/rules/require-schema-parse-at-boundary.md) | Ban `JSON.parse(...) as T` / `(await res.json()) as T`; parse boundary data at runtime. | | ๐ค |
|
|
55
|
+
| [`schema-enum-field-consistency`](./docs/rules/schema-enum-field-consistency.md) | A field that is an enum in one zod object schema must not be `z.string()` in another schema of the same module. | | |
|
|
56
|
+
| [`fetch-must-check-ok`](./docs/rules/fetch-must-check-ok.md) | A fetch response must be checked with `.ok` or a status comparison before `.json()` parses its body. | | |
|
|
57
|
+
| [`translation-key-exists`](./docs/rules/translation-key-exists.md) | A static i18next / react-i18next key (`t(...)`, `i18n.t(...)`, `<Trans i18nKey>`) must exist in the catalog of the namespace in scope. | | ๐ค |
|
|
55
58
|
|
|
56
|
-
The ๐ค rules ship `off` in `recommended`: `require-registered-keys
|
|
57
|
-
nothing until their `sinks` / `schema` options are set, and `require-schema-parse-at-boundary` is a
|
|
59
|
+
The ๐ค rules ship `off` in `recommended`: `require-registered-keys`, `env-var-schema-parity` and
|
|
60
|
+
`translation-key-exists` do nothing until their `sinks` / `schema` / `catalogs` options are set, and `require-schema-parse-at-boundary` is a
|
|
58
61
|
conservative syntactic slice of a type-aware concern. Turn them on explicitly once configured.
|