@sarj/eslint-plugin 5.1.0 → 6.0.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/dist/index.cjs +209 -191
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +136 -111
- package/dist/index.d.ts +136 -111
- package/dist/index.js +206 -190
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -31,7 +31,9 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
31
31
|
var index_exports = {};
|
|
32
32
|
__export(index_exports, {
|
|
33
33
|
default: () => index_default,
|
|
34
|
-
|
|
34
|
+
recommendedRules: () => recommendedRules,
|
|
35
|
+
rules: () => rules,
|
|
36
|
+
strictRules: () => strictRules
|
|
35
37
|
});
|
|
36
38
|
module.exports = __toCommonJS(index_exports);
|
|
37
39
|
|
|
@@ -8698,203 +8700,219 @@ var rules = {
|
|
|
8698
8700
|
"prefer-non-nullable-collection": prefer_non_nullable_collection_default,
|
|
8699
8701
|
"no-async-callback-in-waitfor": no_async_callback_in_waitfor_default
|
|
8700
8702
|
};
|
|
8703
|
+
var meta = {
|
|
8704
|
+
name: "@sarj/eslint-plugin",
|
|
8705
|
+
version: "6.0.0"
|
|
8706
|
+
};
|
|
8707
|
+
var recommendedRules = {
|
|
8708
|
+
"@sarj/zod-naming-convention": "warn",
|
|
8709
|
+
"@sarj/require-assert-never": "error",
|
|
8710
|
+
"@sarj/require-zod-form-validation": "error",
|
|
8711
|
+
"@sarj/enforce-file-structure": "warn",
|
|
8712
|
+
"@sarj/no-client-side-data-fetching": "warn",
|
|
8713
|
+
"@sarj/prefer-server-actions": "warn",
|
|
8714
|
+
"@sarj/no-unnecessary-use-client": "warn",
|
|
8715
|
+
"@sarj/prefer-schema-for-api-payload": "warn",
|
|
8716
|
+
// Distilled from sarj-audit skills — warn in recommended, error in strict.
|
|
8717
|
+
"@sarj/no-sentinel-return-on-catch": "warn",
|
|
8718
|
+
"@sarj/no-log-only-catch": "warn",
|
|
8719
|
+
"@sarj/no-insecure-random-id": "warn",
|
|
8720
|
+
"@sarj/no-json-stringify-error": "warn",
|
|
8721
|
+
"@sarj/no-string-concat-in-loop": "warn",
|
|
8722
|
+
"@sarj/prefer-discriminated-union": "warn",
|
|
8723
|
+
"@sarj/no-comment-cruft": "warn",
|
|
8724
|
+
// Frontend / styling — distilled from frontend PR-review mining.
|
|
8725
|
+
"@sarj/prefer-semantic-colors": [
|
|
8726
|
+
"warn",
|
|
8727
|
+
{ requireSemanticTokens: true }
|
|
8728
|
+
],
|
|
8729
|
+
// Ported from sarj-python-lint (SARJ), corpus-validated FP~0.
|
|
8730
|
+
"@sarj/no-fat-try-blocks": "warn",
|
|
8731
|
+
"@sarj/no-cors-wildcard-with-credentials": "warn",
|
|
8732
|
+
"@sarj/no-secret-in-log": "warn",
|
|
8733
|
+
"@sarj/no-unsafe-mock-casting": "warn",
|
|
8734
|
+
"@sarj/prefer-string-literal-union": "warn",
|
|
8735
|
+
"@sarj/prefer-zod-enum": "warn",
|
|
8736
|
+
// A type hand-written beside the Zod schema it restates drifts the
|
|
8737
|
+
// moment the schema gains a field. 30,759-file, 17-repo sweep
|
|
8738
|
+
// (2026-07): 5 reports, 5 true positives, all in public repos.
|
|
8739
|
+
// `requireIdenticalShape: false` widens it to 8 reports, 1 of them noise.
|
|
8740
|
+
"@sarj/prefer-zod-infer": "warn",
|
|
8741
|
+
// Mined from 2y of PR review feedback + 5-repo code-smell audit (2026-07).
|
|
8742
|
+
"@sarj/require-fetch-timeout": "warn",
|
|
8743
|
+
"@sarj/no-silent-promise-catch": "warn",
|
|
8744
|
+
// Second SARJ port wave — the TS/Python parity gap. Each targets a
|
|
8745
|
+
// defect class seen in production Workers code: timing-leaky secret
|
|
8746
|
+
// compares, non-idempotent store writes under queue redelivery,
|
|
8747
|
+
// O(N) pagination, implicit row contracts, flaky timed tests.
|
|
8748
|
+
"@sarj/prefer-constant-time-secret-compare": "error",
|
|
8749
|
+
"@sarj/store-insert-requires-on-conflict": "warn",
|
|
8750
|
+
"@sarj/no-offset-pagination": "warn",
|
|
8751
|
+
"@sarj/no-select-star": "warn",
|
|
8752
|
+
// Uncancellable hand-rolled timers. Verified against the shipped
|
|
8753
|
+
// strict config (205 enabled rules) that nothing already reports this
|
|
8754
|
+
// position; `unicorn` 72 has no promisified-timer rule at all.
|
|
8755
|
+
"@sarj/no-hand-rolled-sleep": "warn",
|
|
8756
|
+
"@sarj/no-sleep-in-test-body": "warn",
|
|
8757
|
+
"@sarj/no-conditional-in-test": "warn",
|
|
8758
|
+
"@sarj/no-repeated-string-literal": "warn",
|
|
8759
|
+
"@sarj/no-positional-tuple-return": "warn",
|
|
8760
|
+
// Injection guard — low FP, applies to any repo touching SQL.
|
|
8761
|
+
"@sarj/no-dynamic-sql": "warn",
|
|
8762
|
+
// Mined from two years of PR review (SARJ-928). Schema-layer sibling of
|
|
8763
|
+
// `no-enum`; autofixable for inline string-literal objects.
|
|
8764
|
+
"@sarj/no-zod-native-enum": "warn",
|
|
8765
|
+
// Mined from two years of PR review — the single most frequent uncovered
|
|
8766
|
+
// theme (~37 PRs). Measured 17 hits / 1085 real TS files, all true
|
|
8767
|
+
// positives, so it is safe to run everywhere.
|
|
8768
|
+
"@sarj/prefer-module-level-constant": "warn",
|
|
8769
|
+
// Anti-comment-verbosity family (2026-07), from a 37,918-comment,
|
|
8770
|
+
// nine-repo measurement study. Each is a deletion-class finding, so each
|
|
8771
|
+
// was validated against pydantic / trio / attrs as well as the maintained
|
|
8772
|
+
// repos: `no-restated-comment` 0 hits in the flagship first-party
|
|
8773
|
+
// repo and 4 in the three famous
|
|
8774
|
+
// corpora combined; `trailing-value-narration` 18 hits, 18 true
|
|
8775
|
+
// positives; `jsdoc-restates-signature` 36 hits, 0 measured false
|
|
8776
|
+
// positives, and it offers a suggestion rather than a `--fix` because a
|
|
8777
|
+
// wrong deletion is silent information loss.
|
|
8778
|
+
"@sarj/no-restated-comment": "warn",
|
|
8779
|
+
"@sarj/jsdoc-restates-signature": "warn",
|
|
8780
|
+
"@sarj/trailing-value-narration": "warn",
|
|
8781
|
+
// The VOLUME arm of the same family (2026-07). Its siblings judge one
|
|
8782
|
+
// comment at a time and can only condemn one that adds nothing; this
|
|
8783
|
+
// one judges a TYPE, so it can report ten rows that each add a word.
|
|
8784
|
+
// 33 OSS TS repos / 46,861 files: 22 findings, all read, 0 false; zero
|
|
8785
|
+
// across ten first-party repos, where the generated-file sniff alone
|
|
8786
|
+
// removed 321 of the 407 raw hits. Measurements and the six false
|
|
8787
|
+
// positives that shaped the guards: docs/rules/no-type-member-comment-wall.md
|
|
8788
|
+
"@sarj/no-type-member-comment-wall": "warn",
|
|
8789
|
+
// The TS half of SARJ057 (2026-07). Python has caught the
|
|
8790
|
+
// assertion-FREE test since 0.15.0 (SARJ043) and had no TS
|
|
8791
|
+
// counterpart, which is how `expect(true).toBe(true); // placeholder`
|
|
8792
|
+
// survived in a first-party repo: the file HAS an assertion.
|
|
8793
|
+
// Measured across 5,819 .ts/.tsx files (1,003 of them test files) in
|
|
8794
|
+
// six internal repos plus got / hono / swr / trpc: 3 hits, 3 true
|
|
8795
|
+
// positives, 0 false positives.
|
|
8796
|
+
"@sarj/no-tautological-expect": "warn",
|
|
8797
|
+
// Substitutability: an exported service class with injected
|
|
8798
|
+
// collaborators and no interface above it can only be tested by
|
|
8799
|
+
// mocking. 11-repo sweep: 229 exported classes, 82% already carry a
|
|
8800
|
+
// port, 29 fire, 28 of them true positives.
|
|
8801
|
+
"@sarj/require-interface-for-injected-service": "warn",
|
|
8802
|
+
"@sarj/prefer-non-nullable-collection": "warn",
|
|
8803
|
+
"@sarj/no-async-callback-in-waitfor": "warn",
|
|
8804
|
+
// `strict-test-assertions` shipped in `rules` but in NEITHER preset, so a
|
|
8805
|
+
// consumer using `configs.recommended`/`configs.strict` instead of the shared
|
|
8806
|
+
// `eslint.strict.mjs` had silently never run it. `flat-presets.test.ts`
|
|
8807
|
+
// asserts strict wires every rule the plugin ships, so it cannot recur.
|
|
8808
|
+
"@sarj/strict-test-assertions": "warn"
|
|
8809
|
+
};
|
|
8810
|
+
var strictRules = {
|
|
8811
|
+
"@sarj/zod-naming-convention": "error",
|
|
8812
|
+
"@sarj/require-assert-never": "error",
|
|
8813
|
+
"@sarj/require-zod-form-validation": "error",
|
|
8814
|
+
"@sarj/enforce-file-structure": "error",
|
|
8815
|
+
"@sarj/no-raw-env": "error",
|
|
8816
|
+
"@sarj/no-enum": "error",
|
|
8817
|
+
"@sarj/no-client-side-data-fetching": "error",
|
|
8818
|
+
"@sarj/prefer-server-actions": "error",
|
|
8819
|
+
"@sarj/no-unnecessary-use-client": "error",
|
|
8820
|
+
"@sarj/prefer-schema-for-api-payload": "error",
|
|
8821
|
+
// Distilled from sarj-audit skills.
|
|
8822
|
+
"@sarj/no-sentinel-return-on-catch": "error",
|
|
8823
|
+
"@sarj/no-log-only-catch": "error",
|
|
8824
|
+
"@sarj/no-insecure-random-id": "error",
|
|
8825
|
+
"@sarj/no-json-stringify-error": "error",
|
|
8826
|
+
"@sarj/no-string-concat-in-loop": "error",
|
|
8827
|
+
"@sarj/prefer-discriminated-union": "error",
|
|
8828
|
+
"@sarj/no-comment-cruft": "error",
|
|
8829
|
+
// Frontend / styling — distilled from frontend PR-review mining. Stylistic,
|
|
8830
|
+
// no autofix → warn (rollout should prove the FP rate before raising it).
|
|
8831
|
+
"@sarj/prefer-semantic-colors": [
|
|
8832
|
+
"error",
|
|
8833
|
+
{ requireSemanticTokens: true }
|
|
8834
|
+
],
|
|
8835
|
+
// Ported from sarj-python-lint (SARJ), corpus-validated FP~0.
|
|
8836
|
+
"@sarj/no-fat-try-blocks": "error",
|
|
8837
|
+
"@sarj/no-cors-wildcard-with-credentials": "error",
|
|
8838
|
+
"@sarj/no-secret-in-log": "error",
|
|
8839
|
+
"@sarj/no-unsafe-mock-casting": "error",
|
|
8840
|
+
// Promoted to error 2026-07-25 — strict means strict (user directive).
|
|
8841
|
+
"@sarj/prefer-string-literal-union": "error",
|
|
8842
|
+
"@sarj/prefer-zod-enum": "error",
|
|
8843
|
+
// See the `recommended` block for the measured counts.
|
|
8844
|
+
"@sarj/prefer-zod-infer": "error",
|
|
8845
|
+
// Mined from 2y of PR review feedback + 5-repo code-smell audit (2026-07).
|
|
8846
|
+
"@sarj/require-fetch-timeout": "error",
|
|
8847
|
+
"@sarj/no-silent-promise-catch": "error",
|
|
8848
|
+
// Second SARJ port wave — the TS/Python parity gap.
|
|
8849
|
+
"@sarj/prefer-constant-time-secret-compare": "error",
|
|
8850
|
+
"@sarj/store-insert-requires-on-conflict": "error",
|
|
8851
|
+
"@sarj/no-offset-pagination": "error",
|
|
8852
|
+
"@sarj/no-select-star": "error",
|
|
8853
|
+
// Uncancellable hand-rolled timers. Verified against the shipped
|
|
8854
|
+
// strict config (205 enabled rules) that nothing already reports this
|
|
8855
|
+
// position; `unicorn` 72 has no promisified-timer rule at all.
|
|
8856
|
+
"@sarj/no-hand-rolled-sleep": "error",
|
|
8857
|
+
"@sarj/no-sleep-in-test-body": "error",
|
|
8858
|
+
"@sarj/no-conditional-in-test": "error",
|
|
8859
|
+
"@sarj/no-repeated-string-literal": "error",
|
|
8860
|
+
// API-shape advice rather than a runtime defect — a corpus sweep found its
|
|
8861
|
+
// only hits are parser `[value, cursor]` returns, which are conventional.
|
|
8862
|
+
// Warn even in strict until a rollout justifies more.
|
|
8863
|
+
"@sarj/no-positional-tuple-return": "error",
|
|
8864
|
+
"@sarj/no-dynamic-sql": "error",
|
|
8865
|
+
// Architectural: both need per-repo config to be meaningful, so they
|
|
8866
|
+
// are strict-only. `no-storage-in-stateless-modules` is a no-op until
|
|
8867
|
+
// its `modules` option names the directories a team declared stateless;
|
|
8868
|
+
// `no-raw-fetch-outside-clients` defaults to the `clients/` convention
|
|
8869
|
+
// and takes an `allow` list for repos that lay their client layer out
|
|
8870
|
+
// differently.
|
|
8871
|
+
"@sarj/no-raw-fetch-outside-clients": "error",
|
|
8872
|
+
"@sarj/no-storage-in-stateless-modules": "error",
|
|
8873
|
+
// Mined from two years of PR review (SARJ-928).
|
|
8874
|
+
"@sarj/no-zod-native-enum": "error",
|
|
8875
|
+
"@sarj/prefer-module-level-constant": "error",
|
|
8876
|
+
// Anti-comment-verbosity family (2026-07) — see the `recommended` block
|
|
8877
|
+
// for the measured hit counts and false-positive rates.
|
|
8878
|
+
"@sarj/no-restated-comment": "error",
|
|
8879
|
+
"@sarj/jsdoc-restates-signature": "error",
|
|
8880
|
+
"@sarj/trailing-value-narration": "error",
|
|
8881
|
+
"@sarj/no-type-member-comment-wall": "error",
|
|
8882
|
+
// TS half of SARJ057 — see the `recommended` block for the measurement.
|
|
8883
|
+
"@sarj/no-tautological-expect": "error",
|
|
8884
|
+
// Substitutability: the TS sibling of the Python `prefer-real-store-in-tests`
|
|
8885
|
+
// / `prefer-library-fake` wave. The convention already exists in the
|
|
8886
|
+
// corpus (175 `implements` clauses vs 29 hits), so strict enforces it.
|
|
8887
|
+
"@sarj/require-interface-for-injected-service": "error",
|
|
8888
|
+
"@sarj/prefer-non-nullable-collection": "error",
|
|
8889
|
+
"@sarj/no-async-callback-in-waitfor": "error",
|
|
8890
|
+
// See the `recommended` block.
|
|
8891
|
+
"@sarj/strict-test-assertions": "error"
|
|
8892
|
+
};
|
|
8701
8893
|
var plugin = {
|
|
8702
|
-
meta
|
|
8703
|
-
name: "@sarj/eslint-plugin",
|
|
8704
|
-
version: "5.1.0"
|
|
8705
|
-
},
|
|
8894
|
+
meta,
|
|
8706
8895
|
rules,
|
|
8707
8896
|
configs: {
|
|
8708
|
-
recommended: {
|
|
8709
|
-
|
|
8710
|
-
rules: {
|
|
8711
|
-
"@sarj/zod-naming-convention": "warn",
|
|
8712
|
-
"@sarj/require-assert-never": "error",
|
|
8713
|
-
"@sarj/require-zod-form-validation": "error",
|
|
8714
|
-
"@sarj/enforce-file-structure": "warn",
|
|
8715
|
-
"@sarj/no-client-side-data-fetching": "warn",
|
|
8716
|
-
"@sarj/prefer-server-actions": "warn",
|
|
8717
|
-
"@sarj/no-unnecessary-use-client": "warn",
|
|
8718
|
-
"@sarj/prefer-schema-for-api-payload": "warn",
|
|
8719
|
-
// Distilled from sarj-audit skills — warn in recommended, error in strict.
|
|
8720
|
-
"@sarj/no-sentinel-return-on-catch": "warn",
|
|
8721
|
-
"@sarj/no-log-only-catch": "warn",
|
|
8722
|
-
"@sarj/no-insecure-random-id": "warn",
|
|
8723
|
-
"@sarj/no-json-stringify-error": "warn",
|
|
8724
|
-
"@sarj/no-string-concat-in-loop": "warn",
|
|
8725
|
-
"@sarj/prefer-discriminated-union": "warn",
|
|
8726
|
-
"@sarj/no-comment-cruft": "warn",
|
|
8727
|
-
// Frontend / styling — distilled from frontend PR-review mining.
|
|
8728
|
-
"@sarj/prefer-semantic-colors": [
|
|
8729
|
-
"warn",
|
|
8730
|
-
{ requireSemanticTokens: true }
|
|
8731
|
-
],
|
|
8732
|
-
// Ported from sarj-python-lint (SARJ), corpus-validated FP~0.
|
|
8733
|
-
"@sarj/no-fat-try-blocks": "warn",
|
|
8734
|
-
"@sarj/no-cors-wildcard-with-credentials": "warn",
|
|
8735
|
-
"@sarj/no-secret-in-log": "warn",
|
|
8736
|
-
"@sarj/no-unsafe-mock-casting": "warn",
|
|
8737
|
-
"@sarj/prefer-string-literal-union": "warn",
|
|
8738
|
-
"@sarj/prefer-zod-enum": "warn",
|
|
8739
|
-
// A type hand-written beside the Zod schema it restates drifts the
|
|
8740
|
-
// moment the schema gains a field. 30,759-file, 17-repo sweep
|
|
8741
|
-
// (2026-07): 5 reports, 5 true positives, all in public repos.
|
|
8742
|
-
// `requireIdenticalShape: false` widens it to 8 reports, 1 of them noise.
|
|
8743
|
-
"@sarj/prefer-zod-infer": "warn",
|
|
8744
|
-
// Mined from 2y of PR review feedback + 5-repo code-smell audit (2026-07).
|
|
8745
|
-
"@sarj/require-fetch-timeout": "warn",
|
|
8746
|
-
"@sarj/no-silent-promise-catch": "warn",
|
|
8747
|
-
// Second SARJ port wave — the TS/Python parity gap. Each targets a
|
|
8748
|
-
// defect class seen in production Workers code: timing-leaky secret
|
|
8749
|
-
// compares, non-idempotent store writes under queue redelivery,
|
|
8750
|
-
// O(N) pagination, implicit row contracts, flaky timed tests.
|
|
8751
|
-
"@sarj/prefer-constant-time-secret-compare": "error",
|
|
8752
|
-
"@sarj/store-insert-requires-on-conflict": "warn",
|
|
8753
|
-
"@sarj/no-offset-pagination": "warn",
|
|
8754
|
-
"@sarj/no-select-star": "warn",
|
|
8755
|
-
// Uncancellable hand-rolled timers. Verified against the shipped
|
|
8756
|
-
// strict config (205 enabled rules) that nothing already reports this
|
|
8757
|
-
// position; `unicorn` 72 has no promisified-timer rule at all.
|
|
8758
|
-
"@sarj/no-hand-rolled-sleep": "warn",
|
|
8759
|
-
"@sarj/no-sleep-in-test-body": "warn",
|
|
8760
|
-
"@sarj/no-conditional-in-test": "warn",
|
|
8761
|
-
"@sarj/no-repeated-string-literal": "warn",
|
|
8762
|
-
"@sarj/no-positional-tuple-return": "warn",
|
|
8763
|
-
// Injection guard — low FP, applies to any repo touching SQL.
|
|
8764
|
-
"@sarj/no-dynamic-sql": "warn",
|
|
8765
|
-
// Mined from two years of PR review (SARJ-928). Schema-layer sibling of
|
|
8766
|
-
// `no-enum`; autofixable for inline string-literal objects.
|
|
8767
|
-
"@sarj/no-zod-native-enum": "warn",
|
|
8768
|
-
// Mined from two years of PR review — the single most frequent uncovered
|
|
8769
|
-
// theme (~37 PRs). Measured 17 hits / 1085 real TS files, all true
|
|
8770
|
-
// positives, so it is safe to run everywhere.
|
|
8771
|
-
"@sarj/prefer-module-level-constant": "warn",
|
|
8772
|
-
// Anti-comment-verbosity family (2026-07), from a 37,918-comment,
|
|
8773
|
-
// nine-repo measurement study. Each is a deletion-class finding, so each
|
|
8774
|
-
// was validated against pydantic / trio / attrs as well as the maintained
|
|
8775
|
-
// repos: `no-restated-comment` 0 hits in the flagship first-party
|
|
8776
|
-
// repo and 4 in the three famous
|
|
8777
|
-
// corpora combined; `trailing-value-narration` 18 hits, 18 true
|
|
8778
|
-
// positives; `jsdoc-restates-signature` 36 hits, 0 measured false
|
|
8779
|
-
// positives, and it offers a suggestion rather than a `--fix` because a
|
|
8780
|
-
// wrong deletion is silent information loss.
|
|
8781
|
-
"@sarj/no-restated-comment": "warn",
|
|
8782
|
-
"@sarj/jsdoc-restates-signature": "warn",
|
|
8783
|
-
"@sarj/trailing-value-narration": "warn",
|
|
8784
|
-
// The VOLUME arm of the same family (2026-07). Its siblings judge one
|
|
8785
|
-
// comment at a time and can only condemn one that adds nothing; this
|
|
8786
|
-
// one judges a TYPE, so it can report ten rows that each add a word.
|
|
8787
|
-
// 33 OSS TS repos / 46,861 files: 22 findings, all read, 0 false; zero
|
|
8788
|
-
// across ten first-party repos, where the generated-file sniff alone
|
|
8789
|
-
// removed 321 of the 407 raw hits. Measurements and the six false
|
|
8790
|
-
// positives that shaped the guards: docs/rules/no-type-member-comment-wall.md
|
|
8791
|
-
"@sarj/no-type-member-comment-wall": "warn",
|
|
8792
|
-
// The TS half of SARJ057 (2026-07). Python has caught the
|
|
8793
|
-
// assertion-FREE test since 0.15.0 (SARJ043) and had no TS
|
|
8794
|
-
// counterpart, which is how `expect(true).toBe(true); // placeholder`
|
|
8795
|
-
// survived in a first-party repo: the file HAS an assertion.
|
|
8796
|
-
// Measured across 5,819 .ts/.tsx files (1,003 of them test files) in
|
|
8797
|
-
// six internal repos plus got / hono / swr / trpc: 3 hits, 3 true
|
|
8798
|
-
// positives, 0 false positives.
|
|
8799
|
-
"@sarj/no-tautological-expect": "warn",
|
|
8800
|
-
// Substitutability: an exported service class with injected
|
|
8801
|
-
// collaborators and no interface above it can only be tested by
|
|
8802
|
-
// mocking. 11-repo sweep: 229 exported classes, 82% already carry a
|
|
8803
|
-
// port, 29 fire, 28 of them true positives.
|
|
8804
|
-
"@sarj/require-interface-for-injected-service": "warn",
|
|
8805
|
-
"@sarj/prefer-non-nullable-collection": "warn",
|
|
8806
|
-
"@sarj/no-async-callback-in-waitfor": "warn"
|
|
8807
|
-
}
|
|
8808
|
-
},
|
|
8809
|
-
strict: {
|
|
8810
|
-
plugins: ["@sarj"],
|
|
8811
|
-
rules: {
|
|
8812
|
-
"@sarj/zod-naming-convention": "error",
|
|
8813
|
-
"@sarj/require-assert-never": "error",
|
|
8814
|
-
"@sarj/require-zod-form-validation": "error",
|
|
8815
|
-
"@sarj/enforce-file-structure": "error",
|
|
8816
|
-
"@sarj/no-raw-env": "error",
|
|
8817
|
-
"@sarj/no-enum": "error",
|
|
8818
|
-
"@sarj/no-client-side-data-fetching": "error",
|
|
8819
|
-
"@sarj/prefer-server-actions": "error",
|
|
8820
|
-
"@sarj/no-unnecessary-use-client": "error",
|
|
8821
|
-
"@sarj/prefer-schema-for-api-payload": "error",
|
|
8822
|
-
// Distilled from sarj-audit skills.
|
|
8823
|
-
"@sarj/no-sentinel-return-on-catch": "error",
|
|
8824
|
-
"@sarj/no-log-only-catch": "error",
|
|
8825
|
-
"@sarj/no-insecure-random-id": "error",
|
|
8826
|
-
"@sarj/no-json-stringify-error": "error",
|
|
8827
|
-
"@sarj/no-string-concat-in-loop": "error",
|
|
8828
|
-
"@sarj/prefer-discriminated-union": "error",
|
|
8829
|
-
"@sarj/no-comment-cruft": "error",
|
|
8830
|
-
// Frontend / styling — distilled from frontend PR-review mining. Stylistic,
|
|
8831
|
-
// no autofix → warn (rollout should prove the FP rate before raising it).
|
|
8832
|
-
"@sarj/prefer-semantic-colors": [
|
|
8833
|
-
"error",
|
|
8834
|
-
{ requireSemanticTokens: true }
|
|
8835
|
-
],
|
|
8836
|
-
// Ported from sarj-python-lint (SARJ), corpus-validated FP~0.
|
|
8837
|
-
"@sarj/no-fat-try-blocks": "error",
|
|
8838
|
-
"@sarj/no-cors-wildcard-with-credentials": "error",
|
|
8839
|
-
"@sarj/no-secret-in-log": "error",
|
|
8840
|
-
"@sarj/no-unsafe-mock-casting": "error",
|
|
8841
|
-
// Promoted to error 2026-07-25 — strict means strict (user directive).
|
|
8842
|
-
"@sarj/prefer-string-literal-union": "error",
|
|
8843
|
-
"@sarj/prefer-zod-enum": "error",
|
|
8844
|
-
// See the `recommended` block for the measured counts.
|
|
8845
|
-
"@sarj/prefer-zod-infer": "error",
|
|
8846
|
-
// Mined from 2y of PR review feedback + 5-repo code-smell audit (2026-07).
|
|
8847
|
-
"@sarj/require-fetch-timeout": "error",
|
|
8848
|
-
"@sarj/no-silent-promise-catch": "error",
|
|
8849
|
-
// Second SARJ port wave — the TS/Python parity gap.
|
|
8850
|
-
"@sarj/prefer-constant-time-secret-compare": "error",
|
|
8851
|
-
"@sarj/store-insert-requires-on-conflict": "error",
|
|
8852
|
-
"@sarj/no-offset-pagination": "error",
|
|
8853
|
-
"@sarj/no-select-star": "error",
|
|
8854
|
-
// Uncancellable hand-rolled timers. Verified against the shipped
|
|
8855
|
-
// strict config (205 enabled rules) that nothing already reports this
|
|
8856
|
-
// position; `unicorn` 72 has no promisified-timer rule at all.
|
|
8857
|
-
"@sarj/no-hand-rolled-sleep": "error",
|
|
8858
|
-
"@sarj/no-sleep-in-test-body": "error",
|
|
8859
|
-
"@sarj/no-conditional-in-test": "error",
|
|
8860
|
-
"@sarj/no-repeated-string-literal": "error",
|
|
8861
|
-
// API-shape advice rather than a runtime defect — a corpus sweep found its
|
|
8862
|
-
// only hits are parser `[value, cursor]` returns, which are conventional.
|
|
8863
|
-
// Warn even in strict until a rollout justifies more.
|
|
8864
|
-
"@sarj/no-positional-tuple-return": "error",
|
|
8865
|
-
"@sarj/no-dynamic-sql": "error",
|
|
8866
|
-
// Architectural: both need per-repo config to be meaningful, so they
|
|
8867
|
-
// are strict-only. `no-storage-in-stateless-modules` is a no-op until
|
|
8868
|
-
// its `modules` option names the directories a team declared stateless;
|
|
8869
|
-
// `no-raw-fetch-outside-clients` defaults to the `clients/` convention
|
|
8870
|
-
// and takes an `allow` list for repos that lay their client layer out
|
|
8871
|
-
// differently.
|
|
8872
|
-
"@sarj/no-raw-fetch-outside-clients": "error",
|
|
8873
|
-
"@sarj/no-storage-in-stateless-modules": "error",
|
|
8874
|
-
// Mined from two years of PR review (SARJ-928).
|
|
8875
|
-
"@sarj/no-zod-native-enum": "error",
|
|
8876
|
-
"@sarj/prefer-module-level-constant": "error",
|
|
8877
|
-
// Anti-comment-verbosity family (2026-07) — see the `recommended` block
|
|
8878
|
-
// for the measured hit counts and false-positive rates.
|
|
8879
|
-
"@sarj/no-restated-comment": "error",
|
|
8880
|
-
"@sarj/jsdoc-restates-signature": "error",
|
|
8881
|
-
"@sarj/trailing-value-narration": "error",
|
|
8882
|
-
"@sarj/no-type-member-comment-wall": "error",
|
|
8883
|
-
// TS half of SARJ057 — see the `recommended` block for the measurement.
|
|
8884
|
-
"@sarj/no-tautological-expect": "error",
|
|
8885
|
-
// Substitutability: the TS sibling of the Python `prefer-real-store-in-tests`
|
|
8886
|
-
// / `prefer-library-fake` wave. The convention already exists in the
|
|
8887
|
-
// corpus (175 `implements` clauses vs 29 hits), so strict enforces it.
|
|
8888
|
-
"@sarj/require-interface-for-injected-service": "error",
|
|
8889
|
-
"@sarj/prefer-non-nullable-collection": "error",
|
|
8890
|
-
"@sarj/no-async-callback-in-waitfor": "error"
|
|
8891
|
-
}
|
|
8892
|
-
}
|
|
8897
|
+
recommended: {},
|
|
8898
|
+
strict: {}
|
|
8893
8899
|
}
|
|
8894
8900
|
};
|
|
8901
|
+
plugin.configs.recommended = {
|
|
8902
|
+
name: "@sarj/recommended",
|
|
8903
|
+
plugins: { "@sarj": plugin },
|
|
8904
|
+
rules: recommendedRules
|
|
8905
|
+
};
|
|
8906
|
+
plugin.configs.strict = {
|
|
8907
|
+
name: "@sarj/strict",
|
|
8908
|
+
plugins: { "@sarj": plugin },
|
|
8909
|
+
rules: strictRules
|
|
8910
|
+
};
|
|
8895
8911
|
var index_default = plugin;
|
|
8896
8912
|
// Annotate the CommonJS export names for ESM import in node:
|
|
8897
8913
|
0 && (module.exports = {
|
|
8898
|
-
|
|
8914
|
+
recommendedRules,
|
|
8915
|
+
rules,
|
|
8916
|
+
strictRules
|
|
8899
8917
|
});
|
|
8900
8918
|
//# sourceMappingURL=index.cjs.map
|