@sarj/eslint-plugin 15.20.0 → 15.21.1

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.d.cts CHANGED
@@ -190,6 +190,12 @@ interface ComponentImport {
190
190
  readonly export: string;
191
191
  }
192
192
 
193
+ interface LocalizationOptions {
194
+ readonly enabled?: boolean;
195
+ readonly allowText?: readonly string[];
196
+ readonly translationComponents?: readonly ComponentImport[];
197
+ }
198
+
193
199
  /**
194
200
  * @fileoverview _renames — every rule this plugin has renamed, old name to new; the old names no longer resolve, so this map is what says what to write instead.
195
201
  *
@@ -215,6 +221,14 @@ declare const RULES: {
215
221
  readonly checkInsets?: boolean;
216
222
  readonly allowUtilities?: readonly string[];
217
223
  }?], "physicalUtility">;
224
+ readonly "no-unlocalized-toast": DocumentedRule<readonly [(LocalizationOptions & {
225
+ readonly functions?: readonly ComponentImport[];
226
+ readonly methods?: readonly string[];
227
+ })?], "unlocalized">;
228
+ readonly "no-unlocalized-jsx-attributes": DocumentedRule<readonly [(LocalizationOptions & {
229
+ readonly attributes?: readonly string[];
230
+ })?], "unlocalized">;
231
+ readonly "no-unlocalized-jsx-text": DocumentedRule<readonly [LocalizationOptions?], "unlocalized">;
218
232
  readonly "excessive-commentary": DocumentedRule<readonly [], "excessive">;
219
233
  readonly "iac-source-coupled-test": DocumentedRule<readonly [], "rawSourceOracle">;
220
234
  readonly "duplicate-test-body": DocumentedRule<readonly [], "duplicateTestBody">;
@@ -228,6 +242,7 @@ declare const RULES: {
228
242
  readonly "no-enum": DocumentedRule<readonly [{
229
243
  ignoreFiles?: readonly string[];
230
244
  }?], "noEnum">;
245
+ readonly "no-excessive-cognitive-complexity": DocumentedRule<[], "excessiveComplexity">;
231
246
  readonly "no-fat-try-blocks": DocumentedRule<readonly [RuleOptions$1?], "fatTryBlock">;
232
247
  readonly "no-hand-rolled-sleep": DocumentedRule<readonly [{
233
248
  allowIn?: readonly string[];
@@ -344,13 +359,22 @@ declare const RULES: {
344
359
  /** @deprecated All repositories use one policy; retained for import compatibility. */
345
360
  declare const APPLICATION_ONLY_RULES: readonly [];
346
361
  /** Rules staged as non-blocking warnings while corpus adoption evidence accumulates. */
347
- declare const ADVISORY_RULES: readonly ["@sarj/excessive-commentary", "@sarj/no-bespoke-api-case-conversion", "@sarj/no-detached-global-fetch", "@sarj/no-in-operator-on-built-in-collections", "@sarj/no-json-stringify-object-equality", "@sarj/no-redundant-optional-array-default", "@sarj/no-restated-comment", "@sarj/no-restated-jsdoc", "@sarj/prefer-logical-tailwind-utilities", "@sarj/prefer-millisecond-control-duration-schema", "@sarj/prefer-module-level-refined-schema", "@sarj/prefer-multi-value-zod-literal", "@sarj/prefer-named-callback-domain", "@sarj/prefer-named-complex-return-type", "@sarj/prefer-node-crypto-hash", "@sarj/prefer-node-fs-promises", "@sarj/prefer-nullish-filter-predicate", "@sarj/prefer-shared-zod-enum", "@sarj/prefer-switch-for-repeated-equality", "@sarj/prefer-whole-object-assertion", "@sarj/prefer-zod-parse-output-type", "@sarj/require-interface-for-exported-class", "@sarj/require-sql-access-class", "@sarj/sole-export-matches-filename"];
362
+ declare const ADVISORY_RULES: readonly ["@sarj/excessive-commentary", "@sarj/no-bespoke-api-case-conversion", "@sarj/no-detached-global-fetch", "@sarj/no-in-operator-on-built-in-collections", "@sarj/no-json-stringify-object-equality", "@sarj/no-redundant-optional-array-default", "@sarj/no-restated-comment", "@sarj/no-restated-jsdoc", "@sarj/no-unlocalized-jsx-attributes", "@sarj/no-unlocalized-jsx-text", "@sarj/no-unlocalized-toast", "@sarj/prefer-logical-tailwind-utilities", "@sarj/prefer-millisecond-control-duration-schema", "@sarj/prefer-module-level-refined-schema", "@sarj/prefer-multi-value-zod-literal", "@sarj/prefer-named-callback-domain", "@sarj/prefer-named-complex-return-type", "@sarj/prefer-node-crypto-hash", "@sarj/prefer-node-fs-promises", "@sarj/prefer-nullish-filter-predicate", "@sarj/prefer-shared-zod-enum", "@sarj/prefer-switch-for-repeated-equality", "@sarj/prefer-whole-object-assertion", "@sarj/prefer-zod-parse-output-type", "@sarj/require-interface-for-exported-class", "@sarj/require-sql-access-class", "@sarj/sole-export-matches-filename"];
348
363
  declare const RECOMMENDED_RULES: {
349
364
  readonly "@sarj/require-button-accessible-name": "error";
350
365
  readonly "@sarj/require-svg-accessible-name": "error";
351
366
  readonly "@sarj/prefer-logical-tailwind-utilities": readonly ["warn", {
352
367
  readonly enabled: false;
353
368
  }];
369
+ readonly "@sarj/no-unlocalized-toast": readonly ["warn", {
370
+ readonly enabled: false;
371
+ }];
372
+ readonly "@sarj/no-unlocalized-jsx-attributes": readonly ["warn", {
373
+ readonly enabled: false;
374
+ }];
375
+ readonly "@sarj/no-unlocalized-jsx-text": readonly ["warn", {
376
+ readonly enabled: false;
377
+ }];
354
378
  readonly "no-restricted-imports": readonly ["error", {
355
379
  readonly paths: {
356
380
  name: "request" | "node-fetch" | "cross-fetch" | "isomorphic-fetch" | "axios" | "moment" | "dayjs" | "lodash" | "lodash-es" | "underscore" | "classnames" | "joi" | "yup" | "superstruct" | "io-ts" | "runtypes" | "jsonwebtoken" | "express" | "koa" | "jest" | "mocha" | "sinon" | "commander" | "yargs" | "bluebird" | "rimraf" | "fs-extra" | "abort-controller" | "querystring" | "dotenv" | "chalk" | "faker" | "node-sass" | "tslint";
@@ -537,6 +561,7 @@ declare const RECOMMENDED_RULES: {
537
561
  readonly "@sarj/prefer-native-random-uuid": "error";
538
562
  readonly "@sarj/prefer-shadcn-primitives": "error";
539
563
  readonly "@sarj/excessive-commentary": "warn";
564
+ readonly "@sarj/no-excessive-cognitive-complexity": "error";
540
565
  readonly "@sarj/interface-contract-members-private": "error";
541
566
  readonly "@sarj/iac-source-coupled-test": "error";
542
567
  readonly "@sarj/duplicate-test-body": "error";
@@ -641,6 +666,15 @@ declare const STRICT_RULES: {
641
666
  readonly "@sarj/prefer-logical-tailwind-utilities": readonly ["warn", {
642
667
  readonly enabled: false;
643
668
  }];
669
+ readonly "@sarj/no-unlocalized-toast": readonly ["warn", {
670
+ readonly enabled: false;
671
+ }];
672
+ readonly "@sarj/no-unlocalized-jsx-attributes": readonly ["warn", {
673
+ readonly enabled: false;
674
+ }];
675
+ readonly "@sarj/no-unlocalized-jsx-text": readonly ["warn", {
676
+ readonly enabled: false;
677
+ }];
644
678
  readonly "no-restricted-imports": readonly ["error", {
645
679
  readonly paths: {
646
680
  name: "request" | "node-fetch" | "cross-fetch" | "isomorphic-fetch" | "axios" | "moment" | "dayjs" | "lodash" | "lodash-es" | "underscore" | "classnames" | "joi" | "yup" | "superstruct" | "io-ts" | "runtypes" | "jsonwebtoken" | "express" | "koa" | "jest" | "mocha" | "sinon" | "commander" | "yargs" | "bluebird" | "rimraf" | "fs-extra" | "abort-controller" | "querystring" | "dotenv" | "chalk" | "faker" | "node-sass" | "tslint";
@@ -827,6 +861,7 @@ declare const STRICT_RULES: {
827
861
  readonly "@sarj/prefer-native-random-uuid": "error";
828
862
  readonly "@sarj/prefer-shadcn-primitives": "error";
829
863
  readonly "@sarj/excessive-commentary": "warn";
864
+ readonly "@sarj/no-excessive-cognitive-complexity": "error";
830
865
  readonly "@sarj/interface-contract-members-private": "error";
831
866
  readonly "@sarj/iac-source-coupled-test": "error";
832
867
  readonly "@sarj/duplicate-test-body": "error";
@@ -937,7 +972,7 @@ type FlatPreset = {
937
972
  declare const PLUGIN: {
938
973
  readonly meta: {
939
974
  readonly name: "@sarj/eslint-plugin";
940
- readonly version: "15.20.0";
975
+ readonly version: "15.21.1";
941
976
  };
942
977
  readonly rules: {
943
978
  readonly "require-button-accessible-name": DocumentedRule<readonly [{
@@ -950,6 +985,14 @@ declare const PLUGIN: {
950
985
  readonly checkInsets?: boolean;
951
986
  readonly allowUtilities?: readonly string[];
952
987
  }?], "physicalUtility">;
988
+ readonly "no-unlocalized-toast": DocumentedRule<readonly [(LocalizationOptions & {
989
+ readonly functions?: readonly ComponentImport[];
990
+ readonly methods?: readonly string[];
991
+ })?], "unlocalized">;
992
+ readonly "no-unlocalized-jsx-attributes": DocumentedRule<readonly [(LocalizationOptions & {
993
+ readonly attributes?: readonly string[];
994
+ })?], "unlocalized">;
995
+ readonly "no-unlocalized-jsx-text": DocumentedRule<readonly [LocalizationOptions?], "unlocalized">;
953
996
  readonly "excessive-commentary": DocumentedRule<readonly [], "excessive">;
954
997
  readonly "iac-source-coupled-test": DocumentedRule<readonly [], "rawSourceOracle">;
955
998
  readonly "duplicate-test-body": DocumentedRule<readonly [], "duplicateTestBody">;
@@ -963,6 +1006,7 @@ declare const PLUGIN: {
963
1006
  readonly "no-enum": DocumentedRule<readonly [{
964
1007
  ignoreFiles?: readonly string[];
965
1008
  }?], "noEnum">;
1009
+ readonly "no-excessive-cognitive-complexity": DocumentedRule<[], "excessiveComplexity">;
966
1010
  readonly "no-fat-try-blocks": DocumentedRule<readonly [RuleOptions$1?], "fatTryBlock">;
967
1011
  readonly "no-hand-rolled-sleep": DocumentedRule<readonly [{
968
1012
  allowIn?: readonly string[];
package/dist/index.d.ts CHANGED
@@ -190,6 +190,12 @@ interface ComponentImport {
190
190
  readonly export: string;
191
191
  }
192
192
 
193
+ interface LocalizationOptions {
194
+ readonly enabled?: boolean;
195
+ readonly allowText?: readonly string[];
196
+ readonly translationComponents?: readonly ComponentImport[];
197
+ }
198
+
193
199
  /**
194
200
  * @fileoverview _renames — every rule this plugin has renamed, old name to new; the old names no longer resolve, so this map is what says what to write instead.
195
201
  *
@@ -215,6 +221,14 @@ declare const RULES: {
215
221
  readonly checkInsets?: boolean;
216
222
  readonly allowUtilities?: readonly string[];
217
223
  }?], "physicalUtility">;
224
+ readonly "no-unlocalized-toast": DocumentedRule<readonly [(LocalizationOptions & {
225
+ readonly functions?: readonly ComponentImport[];
226
+ readonly methods?: readonly string[];
227
+ })?], "unlocalized">;
228
+ readonly "no-unlocalized-jsx-attributes": DocumentedRule<readonly [(LocalizationOptions & {
229
+ readonly attributes?: readonly string[];
230
+ })?], "unlocalized">;
231
+ readonly "no-unlocalized-jsx-text": DocumentedRule<readonly [LocalizationOptions?], "unlocalized">;
218
232
  readonly "excessive-commentary": DocumentedRule<readonly [], "excessive">;
219
233
  readonly "iac-source-coupled-test": DocumentedRule<readonly [], "rawSourceOracle">;
220
234
  readonly "duplicate-test-body": DocumentedRule<readonly [], "duplicateTestBody">;
@@ -228,6 +242,7 @@ declare const RULES: {
228
242
  readonly "no-enum": DocumentedRule<readonly [{
229
243
  ignoreFiles?: readonly string[];
230
244
  }?], "noEnum">;
245
+ readonly "no-excessive-cognitive-complexity": DocumentedRule<[], "excessiveComplexity">;
231
246
  readonly "no-fat-try-blocks": DocumentedRule<readonly [RuleOptions$1?], "fatTryBlock">;
232
247
  readonly "no-hand-rolled-sleep": DocumentedRule<readonly [{
233
248
  allowIn?: readonly string[];
@@ -344,13 +359,22 @@ declare const RULES: {
344
359
  /** @deprecated All repositories use one policy; retained for import compatibility. */
345
360
  declare const APPLICATION_ONLY_RULES: readonly [];
346
361
  /** Rules staged as non-blocking warnings while corpus adoption evidence accumulates. */
347
- declare const ADVISORY_RULES: readonly ["@sarj/excessive-commentary", "@sarj/no-bespoke-api-case-conversion", "@sarj/no-detached-global-fetch", "@sarj/no-in-operator-on-built-in-collections", "@sarj/no-json-stringify-object-equality", "@sarj/no-redundant-optional-array-default", "@sarj/no-restated-comment", "@sarj/no-restated-jsdoc", "@sarj/prefer-logical-tailwind-utilities", "@sarj/prefer-millisecond-control-duration-schema", "@sarj/prefer-module-level-refined-schema", "@sarj/prefer-multi-value-zod-literal", "@sarj/prefer-named-callback-domain", "@sarj/prefer-named-complex-return-type", "@sarj/prefer-node-crypto-hash", "@sarj/prefer-node-fs-promises", "@sarj/prefer-nullish-filter-predicate", "@sarj/prefer-shared-zod-enum", "@sarj/prefer-switch-for-repeated-equality", "@sarj/prefer-whole-object-assertion", "@sarj/prefer-zod-parse-output-type", "@sarj/require-interface-for-exported-class", "@sarj/require-sql-access-class", "@sarj/sole-export-matches-filename"];
362
+ declare const ADVISORY_RULES: readonly ["@sarj/excessive-commentary", "@sarj/no-bespoke-api-case-conversion", "@sarj/no-detached-global-fetch", "@sarj/no-in-operator-on-built-in-collections", "@sarj/no-json-stringify-object-equality", "@sarj/no-redundant-optional-array-default", "@sarj/no-restated-comment", "@sarj/no-restated-jsdoc", "@sarj/no-unlocalized-jsx-attributes", "@sarj/no-unlocalized-jsx-text", "@sarj/no-unlocalized-toast", "@sarj/prefer-logical-tailwind-utilities", "@sarj/prefer-millisecond-control-duration-schema", "@sarj/prefer-module-level-refined-schema", "@sarj/prefer-multi-value-zod-literal", "@sarj/prefer-named-callback-domain", "@sarj/prefer-named-complex-return-type", "@sarj/prefer-node-crypto-hash", "@sarj/prefer-node-fs-promises", "@sarj/prefer-nullish-filter-predicate", "@sarj/prefer-shared-zod-enum", "@sarj/prefer-switch-for-repeated-equality", "@sarj/prefer-whole-object-assertion", "@sarj/prefer-zod-parse-output-type", "@sarj/require-interface-for-exported-class", "@sarj/require-sql-access-class", "@sarj/sole-export-matches-filename"];
348
363
  declare const RECOMMENDED_RULES: {
349
364
  readonly "@sarj/require-button-accessible-name": "error";
350
365
  readonly "@sarj/require-svg-accessible-name": "error";
351
366
  readonly "@sarj/prefer-logical-tailwind-utilities": readonly ["warn", {
352
367
  readonly enabled: false;
353
368
  }];
369
+ readonly "@sarj/no-unlocalized-toast": readonly ["warn", {
370
+ readonly enabled: false;
371
+ }];
372
+ readonly "@sarj/no-unlocalized-jsx-attributes": readonly ["warn", {
373
+ readonly enabled: false;
374
+ }];
375
+ readonly "@sarj/no-unlocalized-jsx-text": readonly ["warn", {
376
+ readonly enabled: false;
377
+ }];
354
378
  readonly "no-restricted-imports": readonly ["error", {
355
379
  readonly paths: {
356
380
  name: "request" | "node-fetch" | "cross-fetch" | "isomorphic-fetch" | "axios" | "moment" | "dayjs" | "lodash" | "lodash-es" | "underscore" | "classnames" | "joi" | "yup" | "superstruct" | "io-ts" | "runtypes" | "jsonwebtoken" | "express" | "koa" | "jest" | "mocha" | "sinon" | "commander" | "yargs" | "bluebird" | "rimraf" | "fs-extra" | "abort-controller" | "querystring" | "dotenv" | "chalk" | "faker" | "node-sass" | "tslint";
@@ -537,6 +561,7 @@ declare const RECOMMENDED_RULES: {
537
561
  readonly "@sarj/prefer-native-random-uuid": "error";
538
562
  readonly "@sarj/prefer-shadcn-primitives": "error";
539
563
  readonly "@sarj/excessive-commentary": "warn";
564
+ readonly "@sarj/no-excessive-cognitive-complexity": "error";
540
565
  readonly "@sarj/interface-contract-members-private": "error";
541
566
  readonly "@sarj/iac-source-coupled-test": "error";
542
567
  readonly "@sarj/duplicate-test-body": "error";
@@ -641,6 +666,15 @@ declare const STRICT_RULES: {
641
666
  readonly "@sarj/prefer-logical-tailwind-utilities": readonly ["warn", {
642
667
  readonly enabled: false;
643
668
  }];
669
+ readonly "@sarj/no-unlocalized-toast": readonly ["warn", {
670
+ readonly enabled: false;
671
+ }];
672
+ readonly "@sarj/no-unlocalized-jsx-attributes": readonly ["warn", {
673
+ readonly enabled: false;
674
+ }];
675
+ readonly "@sarj/no-unlocalized-jsx-text": readonly ["warn", {
676
+ readonly enabled: false;
677
+ }];
644
678
  readonly "no-restricted-imports": readonly ["error", {
645
679
  readonly paths: {
646
680
  name: "request" | "node-fetch" | "cross-fetch" | "isomorphic-fetch" | "axios" | "moment" | "dayjs" | "lodash" | "lodash-es" | "underscore" | "classnames" | "joi" | "yup" | "superstruct" | "io-ts" | "runtypes" | "jsonwebtoken" | "express" | "koa" | "jest" | "mocha" | "sinon" | "commander" | "yargs" | "bluebird" | "rimraf" | "fs-extra" | "abort-controller" | "querystring" | "dotenv" | "chalk" | "faker" | "node-sass" | "tslint";
@@ -827,6 +861,7 @@ declare const STRICT_RULES: {
827
861
  readonly "@sarj/prefer-native-random-uuid": "error";
828
862
  readonly "@sarj/prefer-shadcn-primitives": "error";
829
863
  readonly "@sarj/excessive-commentary": "warn";
864
+ readonly "@sarj/no-excessive-cognitive-complexity": "error";
830
865
  readonly "@sarj/interface-contract-members-private": "error";
831
866
  readonly "@sarj/iac-source-coupled-test": "error";
832
867
  readonly "@sarj/duplicate-test-body": "error";
@@ -937,7 +972,7 @@ type FlatPreset = {
937
972
  declare const PLUGIN: {
938
973
  readonly meta: {
939
974
  readonly name: "@sarj/eslint-plugin";
940
- readonly version: "15.20.0";
975
+ readonly version: "15.21.1";
941
976
  };
942
977
  readonly rules: {
943
978
  readonly "require-button-accessible-name": DocumentedRule<readonly [{
@@ -950,6 +985,14 @@ declare const PLUGIN: {
950
985
  readonly checkInsets?: boolean;
951
986
  readonly allowUtilities?: readonly string[];
952
987
  }?], "physicalUtility">;
988
+ readonly "no-unlocalized-toast": DocumentedRule<readonly [(LocalizationOptions & {
989
+ readonly functions?: readonly ComponentImport[];
990
+ readonly methods?: readonly string[];
991
+ })?], "unlocalized">;
992
+ readonly "no-unlocalized-jsx-attributes": DocumentedRule<readonly [(LocalizationOptions & {
993
+ readonly attributes?: readonly string[];
994
+ })?], "unlocalized">;
995
+ readonly "no-unlocalized-jsx-text": DocumentedRule<readonly [LocalizationOptions?], "unlocalized">;
953
996
  readonly "excessive-commentary": DocumentedRule<readonly [], "excessive">;
954
997
  readonly "iac-source-coupled-test": DocumentedRule<readonly [], "rawSourceOracle">;
955
998
  readonly "duplicate-test-body": DocumentedRule<readonly [], "duplicateTestBody">;
@@ -963,6 +1006,7 @@ declare const PLUGIN: {
963
1006
  readonly "no-enum": DocumentedRule<readonly [{
964
1007
  ignoreFiles?: readonly string[];
965
1008
  }?], "noEnum">;
1009
+ readonly "no-excessive-cognitive-complexity": DocumentedRule<[], "excessiveComplexity">;
966
1010
  readonly "no-fat-try-blocks": DocumentedRule<readonly [RuleOptions$1?], "fatTryBlock">;
967
1011
  readonly "no-hand-rolled-sleep": DocumentedRule<readonly [{
968
1012
  allowIn?: readonly string[];