@alextheman/eslint-plugin 4.2.5 → 4.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/dist/index.js CHANGED
@@ -1,4 +1,7 @@
1
1
  import { camelToKebab, deepCopy, deepFreeze, normalizeImportPath, omitProperties } from "@alextheman/utility";
2
+ import { AST_NODE_TYPES, ESLintUtils } from "@typescript-eslint/utils";
3
+ import z from "zod";
4
+ import js from "@eslint/js";
2
5
  import prettierConfig from "eslint-config-prettier";
3
6
  import importPlugin from "eslint-plugin-import";
4
7
  import perfectionist from "eslint-plugin-perfectionist";
@@ -11,8 +14,6 @@ import reactPlugin from "eslint-plugin-react";
11
14
  import reactRefresh from "eslint-plugin-react-refresh";
12
15
  import reactHooksPlugin from "eslint-plugin-react-hooks";
13
16
  import packageJson from "eslint-plugin-package-json";
14
- import { AST_NODE_TYPES, ESLintUtils } from "@typescript-eslint/utils";
15
- import z from "zod";
16
17
 
17
18
  //#region rolldown:runtime
18
19
  var __create = Object.create;
@@ -44,10 +45,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
44
45
  //#endregion
45
46
  //#region package.json
46
47
  var name = "@alextheman/eslint-plugin";
47
- var version = "4.2.5";
48
+ var version = "4.4.0";
48
49
 
49
50
  //#endregion
50
- //#region node_modules/globals/globals.json
51
+ //#region node_modules/.pnpm/globals@16.5.0/node_modules/globals/globals.json
51
52
  var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
52
53
  module.exports = {
53
54
  "amd": {
@@ -3395,14 +3396,68 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3395
3396
  }));
3396
3397
 
3397
3398
  //#endregion
3398
- //#region node_modules/globals/index.js
3399
+ //#region node_modules/.pnpm/globals@16.5.0/node_modules/globals/index.js
3399
3400
  var require_globals = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3400
3401
  module.exports = require_globals$1();
3401
3402
  }));
3402
3403
 
3403
3404
  //#endregion
3404
- //#region src/configs/personal/testsBase.ts
3405
+ //#region src/configs/helpers/restrictedImports/generalRestrictedImports.ts
3405
3406
  var import_globals$2 = /* @__PURE__ */ __toESM(require_globals(), 1);
3407
+ const generalRestrictedImports = { patterns: [{
3408
+ group: ["node_modules"],
3409
+ message: "Do not import directly from node_modules."
3410
+ }] };
3411
+ var generalRestrictedImports_default = generalRestrictedImports;
3412
+
3413
+ //#endregion
3414
+ //#region src/utility/checkCallExpression.ts
3415
+ function checkCallExpression(node, objectName, propertyName) {
3416
+ return node.callee.type === AST_NODE_TYPES.MemberExpression && node.callee.object.type === AST_NODE_TYPES.Identifier && node.callee.object.name === objectName && node.callee.property.type === AST_NODE_TYPES.Identifier && node.callee.property.name === propertyName;
3417
+ }
3418
+ var checkCallExpression_default = checkCallExpression;
3419
+
3420
+ //#endregion
3421
+ //#region src/utility/combineRestrictedImports.ts
3422
+ function combineRestrictedImports(firstGroup, secondGroup) {
3423
+ const combinedGroup = {
3424
+ paths: [...firstGroup.paths ?? [], ...secondGroup.paths ?? []],
3425
+ patterns: [...firstGroup.patterns ?? [], ...secondGroup.patterns ?? []]
3426
+ };
3427
+ if (combinedGroup.paths.length === 0) return omitProperties(combinedGroup, "paths");
3428
+ if (combinedGroup.patterns.length === 0) return omitProperties(combinedGroup, "patterns");
3429
+ return combinedGroup;
3430
+ }
3431
+ var combineRestrictedImports_default = combineRestrictedImports;
3432
+
3433
+ //#endregion
3434
+ //#region src/utility/createRuleSchemaFromZodSchema.ts
3435
+ function createRuleSchemaFromZodSchema(schema$1) {
3436
+ return [omitProperties(z.toJSONSchema(schema$1), "$schema")];
3437
+ }
3438
+ var createRuleSchemaFromZodSchema_default = createRuleSchemaFromZodSchema;
3439
+
3440
+ //#endregion
3441
+ //#region src/utility/getImportSpecifiersAfterRemoving.ts
3442
+ function getImportSpecifiersAfterRemoving(context, specifiers, importToRemove) {
3443
+ return specifiers.filter((specifier) => {
3444
+ return !(specifier.imported.name === importToRemove);
3445
+ }).map((specifier) => {
3446
+ return context.sourceCode.getText(specifier);
3447
+ }).join(", ");
3448
+ }
3449
+ var getImportSpecifiersAfterRemoving_default = getImportSpecifiersAfterRemoving;
3450
+
3451
+ //#endregion
3452
+ //#region src/configs/helpers/restrictedImports/testsRestrictedImports.ts
3453
+ const testsRestrictedImports = combineRestrictedImports_default(generalRestrictedImports_default, { paths: [{
3454
+ message: "Use test functions from vitest instead.",
3455
+ name: "node:test"
3456
+ }] });
3457
+ var testsRestrictedImports_default = testsRestrictedImports;
3458
+
3459
+ //#endregion
3460
+ //#region src/configs/personal/testsBase.ts
3406
3461
  const personalTestsBaseConfig = [{
3407
3462
  files: ["**/*.test.{js,ts}"],
3408
3463
  languageOptions: { globals: {
@@ -3427,10 +3482,7 @@ const personalTestsBaseConfig = [{
3427
3482
  name: "expect"
3428
3483
  }
3429
3484
  ],
3430
- "no-restricted-imports": ["error", { paths: [{
3431
- message: "Use test functions from vitest instead.",
3432
- name: "node:test"
3433
- }] }]
3485
+ "no-restricted-imports": ["error", testsRestrictedImports_default]
3434
3486
  }
3435
3487
  }];
3436
3488
  var testsBase_default$1 = personalTestsBaseConfig;
@@ -3477,338 +3529,8 @@ function createCombinedTestsBaseConfig(plugin) {
3477
3529
  }
3478
3530
  var testsBase_default = createCombinedTestsBaseConfig;
3479
3531
 
3480
- //#endregion
3481
- //#region node_modules/@eslint/js/package.json
3482
- var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3483
- module.exports = {
3484
- "name": "@eslint/js",
3485
- "version": "9.39.1",
3486
- "description": "ESLint JavaScript language implementation",
3487
- "funding": "https://eslint.org/donate",
3488
- "main": "./src/index.js",
3489
- "types": "./types/index.d.ts",
3490
- "scripts": { "test:types": "tsc -p tests/types/tsconfig.json" },
3491
- "files": [
3492
- "LICENSE",
3493
- "README.md",
3494
- "src",
3495
- "types"
3496
- ],
3497
- "publishConfig": { "access": "public" },
3498
- "repository": {
3499
- "type": "git",
3500
- "url": "https://github.com/eslint/eslint.git",
3501
- "directory": "packages/js"
3502
- },
3503
- "homepage": "https://eslint.org",
3504
- "bugs": "https://github.com/eslint/eslint/issues/",
3505
- "keywords": [
3506
- "javascript",
3507
- "eslint-plugin",
3508
- "eslint"
3509
- ],
3510
- "license": "MIT",
3511
- "engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }
3512
- };
3513
- }));
3514
-
3515
- //#endregion
3516
- //#region node_modules/@eslint/js/src/configs/eslint-all.js
3517
- var require_eslint_all = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3518
- module.exports = Object.freeze({ rules: Object.freeze({
3519
- "accessor-pairs": "error",
3520
- "array-callback-return": "error",
3521
- "arrow-body-style": "error",
3522
- "block-scoped-var": "error",
3523
- "camelcase": "error",
3524
- "capitalized-comments": "error",
3525
- "class-methods-use-this": "error",
3526
- "complexity": "error",
3527
- "consistent-return": "error",
3528
- "consistent-this": "error",
3529
- "constructor-super": "error",
3530
- "curly": "error",
3531
- "default-case": "error",
3532
- "default-case-last": "error",
3533
- "default-param-last": "error",
3534
- "dot-notation": "error",
3535
- "eqeqeq": "error",
3536
- "for-direction": "error",
3537
- "func-name-matching": "error",
3538
- "func-names": "error",
3539
- "func-style": "error",
3540
- "getter-return": "error",
3541
- "grouped-accessor-pairs": "error",
3542
- "guard-for-in": "error",
3543
- "id-denylist": "error",
3544
- "id-length": "error",
3545
- "id-match": "error",
3546
- "init-declarations": "error",
3547
- "logical-assignment-operators": "error",
3548
- "max-classes-per-file": "error",
3549
- "max-depth": "error",
3550
- "max-lines": "error",
3551
- "max-lines-per-function": "error",
3552
- "max-nested-callbacks": "error",
3553
- "max-params": "error",
3554
- "max-statements": "error",
3555
- "new-cap": "error",
3556
- "no-alert": "error",
3557
- "no-array-constructor": "error",
3558
- "no-async-promise-executor": "error",
3559
- "no-await-in-loop": "error",
3560
- "no-bitwise": "error",
3561
- "no-caller": "error",
3562
- "no-case-declarations": "error",
3563
- "no-class-assign": "error",
3564
- "no-compare-neg-zero": "error",
3565
- "no-cond-assign": "error",
3566
- "no-console": "error",
3567
- "no-const-assign": "error",
3568
- "no-constant-binary-expression": "error",
3569
- "no-constant-condition": "error",
3570
- "no-constructor-return": "error",
3571
- "no-continue": "error",
3572
- "no-control-regex": "error",
3573
- "no-debugger": "error",
3574
- "no-delete-var": "error",
3575
- "no-div-regex": "error",
3576
- "no-dupe-args": "error",
3577
- "no-dupe-class-members": "error",
3578
- "no-dupe-else-if": "error",
3579
- "no-dupe-keys": "error",
3580
- "no-duplicate-case": "error",
3581
- "no-duplicate-imports": "error",
3582
- "no-else-return": "error",
3583
- "no-empty": "error",
3584
- "no-empty-character-class": "error",
3585
- "no-empty-function": "error",
3586
- "no-empty-pattern": "error",
3587
- "no-empty-static-block": "error",
3588
- "no-eq-null": "error",
3589
- "no-eval": "error",
3590
- "no-ex-assign": "error",
3591
- "no-extend-native": "error",
3592
- "no-extra-bind": "error",
3593
- "no-extra-boolean-cast": "error",
3594
- "no-extra-label": "error",
3595
- "no-fallthrough": "error",
3596
- "no-func-assign": "error",
3597
- "no-global-assign": "error",
3598
- "no-implicit-coercion": "error",
3599
- "no-implicit-globals": "error",
3600
- "no-implied-eval": "error",
3601
- "no-import-assign": "error",
3602
- "no-inline-comments": "error",
3603
- "no-inner-declarations": "error",
3604
- "no-invalid-regexp": "error",
3605
- "no-invalid-this": "error",
3606
- "no-irregular-whitespace": "error",
3607
- "no-iterator": "error",
3608
- "no-label-var": "error",
3609
- "no-labels": "error",
3610
- "no-lone-blocks": "error",
3611
- "no-lonely-if": "error",
3612
- "no-loop-func": "error",
3613
- "no-loss-of-precision": "error",
3614
- "no-magic-numbers": "error",
3615
- "no-misleading-character-class": "error",
3616
- "no-multi-assign": "error",
3617
- "no-multi-str": "error",
3618
- "no-negated-condition": "error",
3619
- "no-nested-ternary": "error",
3620
- "no-new": "error",
3621
- "no-new-func": "error",
3622
- "no-new-native-nonconstructor": "error",
3623
- "no-new-wrappers": "error",
3624
- "no-nonoctal-decimal-escape": "error",
3625
- "no-obj-calls": "error",
3626
- "no-object-constructor": "error",
3627
- "no-octal": "error",
3628
- "no-octal-escape": "error",
3629
- "no-param-reassign": "error",
3630
- "no-plusplus": "error",
3631
- "no-promise-executor-return": "error",
3632
- "no-proto": "error",
3633
- "no-prototype-builtins": "error",
3634
- "no-redeclare": "error",
3635
- "no-regex-spaces": "error",
3636
- "no-restricted-exports": "error",
3637
- "no-restricted-globals": "error",
3638
- "no-restricted-imports": "error",
3639
- "no-restricted-properties": "error",
3640
- "no-restricted-syntax": "error",
3641
- "no-return-assign": "error",
3642
- "no-script-url": "error",
3643
- "no-self-assign": "error",
3644
- "no-self-compare": "error",
3645
- "no-sequences": "error",
3646
- "no-setter-return": "error",
3647
- "no-shadow": "error",
3648
- "no-shadow-restricted-names": "error",
3649
- "no-sparse-arrays": "error",
3650
- "no-template-curly-in-string": "error",
3651
- "no-ternary": "error",
3652
- "no-this-before-super": "error",
3653
- "no-throw-literal": "error",
3654
- "no-unassigned-vars": "error",
3655
- "no-undef": "error",
3656
- "no-undef-init": "error",
3657
- "no-undefined": "error",
3658
- "no-underscore-dangle": "error",
3659
- "no-unexpected-multiline": "error",
3660
- "no-unmodified-loop-condition": "error",
3661
- "no-unneeded-ternary": "error",
3662
- "no-unreachable": "error",
3663
- "no-unreachable-loop": "error",
3664
- "no-unsafe-finally": "error",
3665
- "no-unsafe-negation": "error",
3666
- "no-unsafe-optional-chaining": "error",
3667
- "no-unused-expressions": "error",
3668
- "no-unused-labels": "error",
3669
- "no-unused-private-class-members": "error",
3670
- "no-unused-vars": "error",
3671
- "no-use-before-define": "error",
3672
- "no-useless-assignment": "error",
3673
- "no-useless-backreference": "error",
3674
- "no-useless-call": "error",
3675
- "no-useless-catch": "error",
3676
- "no-useless-computed-key": "error",
3677
- "no-useless-concat": "error",
3678
- "no-useless-constructor": "error",
3679
- "no-useless-escape": "error",
3680
- "no-useless-rename": "error",
3681
- "no-useless-return": "error",
3682
- "no-var": "error",
3683
- "no-void": "error",
3684
- "no-warning-comments": "error",
3685
- "no-with": "error",
3686
- "object-shorthand": "error",
3687
- "one-var": "error",
3688
- "operator-assignment": "error",
3689
- "prefer-arrow-callback": "error",
3690
- "prefer-const": "error",
3691
- "prefer-destructuring": "error",
3692
- "prefer-exponentiation-operator": "error",
3693
- "prefer-named-capture-group": "error",
3694
- "prefer-numeric-literals": "error",
3695
- "prefer-object-has-own": "error",
3696
- "prefer-object-spread": "error",
3697
- "prefer-promise-reject-errors": "error",
3698
- "prefer-regex-literals": "error",
3699
- "prefer-rest-params": "error",
3700
- "prefer-spread": "error",
3701
- "prefer-template": "error",
3702
- "preserve-caught-error": "error",
3703
- "radix": "error",
3704
- "require-atomic-updates": "error",
3705
- "require-await": "error",
3706
- "require-unicode-regexp": "error",
3707
- "require-yield": "error",
3708
- "sort-imports": "error",
3709
- "sort-keys": "error",
3710
- "sort-vars": "error",
3711
- "strict": "error",
3712
- "symbol-description": "error",
3713
- "unicode-bom": "error",
3714
- "use-isnan": "error",
3715
- "valid-typeof": "error",
3716
- "vars-on-top": "error",
3717
- "yoda": "error"
3718
- }) });
3719
- }));
3720
-
3721
- //#endregion
3722
- //#region node_modules/@eslint/js/src/configs/eslint-recommended.js
3723
- var require_eslint_recommended = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3724
- module.exports = Object.freeze({ rules: Object.freeze({
3725
- "constructor-super": "error",
3726
- "for-direction": "error",
3727
- "getter-return": "error",
3728
- "no-async-promise-executor": "error",
3729
- "no-case-declarations": "error",
3730
- "no-class-assign": "error",
3731
- "no-compare-neg-zero": "error",
3732
- "no-cond-assign": "error",
3733
- "no-const-assign": "error",
3734
- "no-constant-binary-expression": "error",
3735
- "no-constant-condition": "error",
3736
- "no-control-regex": "error",
3737
- "no-debugger": "error",
3738
- "no-delete-var": "error",
3739
- "no-dupe-args": "error",
3740
- "no-dupe-class-members": "error",
3741
- "no-dupe-else-if": "error",
3742
- "no-dupe-keys": "error",
3743
- "no-duplicate-case": "error",
3744
- "no-empty": "error",
3745
- "no-empty-character-class": "error",
3746
- "no-empty-pattern": "error",
3747
- "no-empty-static-block": "error",
3748
- "no-ex-assign": "error",
3749
- "no-extra-boolean-cast": "error",
3750
- "no-fallthrough": "error",
3751
- "no-func-assign": "error",
3752
- "no-global-assign": "error",
3753
- "no-import-assign": "error",
3754
- "no-invalid-regexp": "error",
3755
- "no-irregular-whitespace": "error",
3756
- "no-loss-of-precision": "error",
3757
- "no-misleading-character-class": "error",
3758
- "no-new-native-nonconstructor": "error",
3759
- "no-nonoctal-decimal-escape": "error",
3760
- "no-obj-calls": "error",
3761
- "no-octal": "error",
3762
- "no-prototype-builtins": "error",
3763
- "no-redeclare": "error",
3764
- "no-regex-spaces": "error",
3765
- "no-self-assign": "error",
3766
- "no-setter-return": "error",
3767
- "no-shadow-restricted-names": "error",
3768
- "no-sparse-arrays": "error",
3769
- "no-this-before-super": "error",
3770
- "no-undef": "error",
3771
- "no-unexpected-multiline": "error",
3772
- "no-unreachable": "error",
3773
- "no-unsafe-finally": "error",
3774
- "no-unsafe-negation": "error",
3775
- "no-unsafe-optional-chaining": "error",
3776
- "no-unused-labels": "error",
3777
- "no-unused-private-class-members": "error",
3778
- "no-unused-vars": "error",
3779
- "no-useless-backreference": "error",
3780
- "no-useless-catch": "error",
3781
- "no-useless-escape": "error",
3782
- "no-with": "error",
3783
- "require-yield": "error",
3784
- "use-isnan": "error",
3785
- "valid-typeof": "error"
3786
- }) });
3787
- }));
3788
-
3789
- //#endregion
3790
- //#region node_modules/@eslint/js/src/index.js
3791
- /**
3792
- * @fileoverview Main package entrypoint.
3793
- * @author Nicholas C. Zakas
3794
- */
3795
- var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
3796
- const { name: name$1, version: version$1 } = require_package();
3797
- module.exports = {
3798
- meta: {
3799
- name: name$1,
3800
- version: version$1
3801
- },
3802
- configs: {
3803
- all: require_eslint_all(),
3804
- recommended: require_eslint_recommended()
3805
- }
3806
- };
3807
- }));
3808
-
3809
3532
  //#endregion
3810
3533
  //#region src/configs/helpers/javaScriptLanguageOptions.ts
3811
- var import_src = /* @__PURE__ */ __toESM(require_src(), 1);
3812
3534
  var import_globals$1 = /* @__PURE__ */ __toESM(require_globals(), 1);
3813
3535
  const javaScriptLanguageOptions = { globals: {
3814
3536
  ...import_globals$1.default.node,
@@ -3829,7 +3551,7 @@ var unusedVarsIgnorePatterns_default = unusedVarsIgnorePatterns;
3829
3551
  //#endregion
3830
3552
  //#region src/configs/general/javaScriptBase.ts
3831
3553
  const javaScriptBase = [
3832
- import_src.default.configs.recommended,
3554
+ js.configs.recommended,
3833
3555
  prettierConfig,
3834
3556
  {
3835
3557
  files: [
@@ -3855,10 +3577,7 @@ const javaScriptBase = [
3855
3577
  "no-lonely-if": "error",
3856
3578
  "no-new-wrappers": "error",
3857
3579
  "no-param-reassign": "error",
3858
- "no-restricted-imports": ["error", { patterns: [{
3859
- group: ["node_modules"],
3860
- message: "What on Earth are you doing? Leave poor node_modules alone!"
3861
- }] }],
3580
+ "no-restricted-imports": ["error", generalRestrictedImports_default],
3862
3581
  "no-undef": "error",
3863
3582
  "no-unused-vars": ["error", unusedVarsIgnorePatterns_default],
3864
3583
  "no-useless-rename": "error",
@@ -4075,6 +3794,14 @@ const reactBase = [
4075
3794
  ];
4076
3795
  var reactBase_default$1 = reactBase;
4077
3796
 
3797
+ //#endregion
3798
+ //#region src/configs/helpers/restrictedImports/reactRestrictedImports.ts
3799
+ const reactRestrictedImports = combineRestrictedImports_default(generalRestrictedImports_default, { patterns: [{
3800
+ message: "Please use `import Component from \"@mui/[package]/Component\"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.",
3801
+ regex: "^@mui/[^/]+$"
3802
+ }] });
3803
+ var reactRestrictedImports_default = reactRestrictedImports;
3804
+
4078
3805
  //#endregion
4079
3806
  //#region src/configs/personal/reactBase.ts
4080
3807
  const personalReactBaseConfig = [{
@@ -4086,10 +3813,7 @@ const personalReactBaseConfig = [{
4086
3813
  "react-refresh": reactRefresh
4087
3814
  },
4088
3815
  rules: {
4089
- "no-restricted-imports": ["error", { patterns: [{
4090
- message: "Please use `import Component from \"@mui/[package]/Component\"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.",
4091
- regex: "^@mui/[^/]+$"
4092
- }] }],
3816
+ "no-restricted-imports": ["error", reactRestrictedImports_default],
4093
3817
  "react-hooks/exhaustive-deps": "off",
4094
3818
  "react-hooks/refs": "off",
4095
3819
  "react-refresh/only-export-components": "off",
@@ -4143,6 +3867,25 @@ const typeScriptBase = [
4143
3867
  ];
4144
3868
  var typeScriptBase_default$1 = typeScriptBase;
4145
3869
 
3870
+ //#endregion
3871
+ //#region src/configs/helpers/restrictedImports/eslintPluginRestrictedImports.ts
3872
+ const eslintPluginRestrictedImports = combineRestrictedImports_default(generalRestrictedImports_default, { paths: [...[
3873
+ "src/alexPlugin",
3874
+ "src/index",
3875
+ "src"
3876
+ ].map((name$1) => {
3877
+ return {
3878
+ importNames: ["default"],
3879
+ message: "Do not import the plugin directly from the config files. Please create a function that takes in the plugin and returns the config instead.",
3880
+ name: name$1
3881
+ };
3882
+ }), {
3883
+ importNames: ["default"],
3884
+ message: "Please import from \"src/configs/helpers/eslint-plugin-react-hooks\" instead.",
3885
+ name: "eslint-plugin-react-hooks"
3886
+ }] });
3887
+ var eslintPluginRestrictedImports_default = eslintPluginRestrictedImports;
3888
+
4146
3889
  //#endregion
4147
3890
  //#region src/configs/personal/eslintPlugin.ts
4148
3891
  function createPersonalEslintPluginConfig(plugin) {
@@ -4154,21 +3897,7 @@ function createPersonalEslintPluginConfig(plugin) {
4154
3897
  },
4155
3898
  rules: {
4156
3899
  "@alextheman/no-plugin-configs-access-from-src-configs": "error",
4157
- "no-restricted-imports": ["error", { paths: [...[
4158
- "src/alexPlugin",
4159
- "src/index",
4160
- "src"
4161
- ].map((name$2) => {
4162
- return {
4163
- importNames: ["default"],
4164
- message: "Do not import the plugin directly from the config files. Please create a function that takes in the plugin and returns the config instead.",
4165
- name: name$2
4166
- };
4167
- }), {
4168
- importNames: ["default"],
4169
- message: "Please import from \"src/configs/helpers/eslint-plugin-react-hooks\" instead so you don't have to deal with eslint-plugin-react-hooks' ridiculous plugin typing.",
4170
- name: "eslint-plugin-react-hooks"
4171
- }] }]
3900
+ "no-restricted-imports": ["error", eslintPluginRestrictedImports_default]
4172
3901
  }
4173
3902
  }, {
4174
3903
  files: ["src/rules/index.ts", "src/configs/**"],
@@ -4177,27 +3906,32 @@ function createPersonalEslintPluginConfig(plugin) {
4177
3906
  }
4178
3907
  var eslintPlugin_default = createPersonalEslintPluginConfig;
4179
3908
 
3909
+ //#endregion
3910
+ //#region src/configs/helpers/restrictedImports/neurosongsBackEndRestrictedImports.ts
3911
+ const neurosongsBackEndRestrictedImports = combineRestrictedImports_default(generalRestrictedImports_default, { paths: [
3912
+ {
3913
+ importNames: ["setPrismaClient"],
3914
+ message: "Do not attempt to reset the Prisma Client outside setup files.",
3915
+ name: "src/database/client"
3916
+ },
3917
+ {
3918
+ message: "Do not use the generated Prisma types. Use the types exported from @neurosongs/types instead.",
3919
+ name: "@neurosongs/prisma-client/types"
3920
+ },
3921
+ {
3922
+ importNames: ["PrismaClient"],
3923
+ message: "Please use the PrismaClient from @neurosongs/types instead.",
3924
+ name: "@neurosongs/prisma-client/prisma"
3925
+ }
3926
+ ] });
3927
+ var neurosongsBackEndRestrictedImports_default = neurosongsBackEndRestrictedImports;
3928
+
4180
3929
  //#endregion
4181
3930
  //#region src/configs/personal/neurosongsBackEnd.ts
4182
3931
  const neurosongsBackEndConfig = [
4183
3932
  {
4184
3933
  name: "@alextheman/personal/neurosongs-back-end",
4185
- rules: { "no-restricted-imports": ["error", { paths: [
4186
- {
4187
- importNames: ["setPrismaClient"],
4188
- message: "Do not attempt to reset the Prisma Client outside setup files.",
4189
- name: "src/database/client"
4190
- },
4191
- {
4192
- message: "Do not use the generated Prisma types. Use the types exported from @neurosongs/types instead.",
4193
- name: "@neurosongs/prisma-client/types"
4194
- },
4195
- {
4196
- importNames: ["PrismaClient"],
4197
- message: "Please use the PrismaClient from @neurosongs/types instead.",
4198
- name: "@neurosongs/prisma-client/prisma"
4199
- }
4200
- ] }] }
3934
+ rules: { "no-restricted-imports": ["error", neurosongsBackEndRestrictedImports_default] }
4201
3935
  },
4202
3936
  {
4203
3937
  files: ["src/database/**/*.ts", "tests/test-utilities/setup.ts"],
@@ -4214,33 +3948,32 @@ const neurosongsBackEndConfig = [
4214
3948
  ];
4215
3949
  var neurosongsBackEnd_default = neurosongsBackEndConfig;
4216
3950
 
3951
+ //#endregion
3952
+ //#region src/configs/helpers/restrictedImports/neurosongsFrontEndRestrictedImports.ts
3953
+ const neurosongsFrontEndRestrictedImports = combineRestrictedImports_default(reactRestrictedImports_default, {
3954
+ paths: [{
3955
+ importNames: ["PrismaClient"],
3956
+ message: "Do not use the Prisma Client directly in the front-end. Query an endpoint from the back-end instead.",
3957
+ name: "@neurosongs/types"
3958
+ }, ...["LoaderProvider", "Loader"].map((importName) => {
3959
+ return {
3960
+ importNames: [importName],
3961
+ message: `Use the internal ${importName} from src/components/${importName} instead.`,
3962
+ name: "@alextheman/components"
3963
+ };
3964
+ })],
3965
+ patterns: [{
3966
+ group: ["@neurosongs/prisma-client"],
3967
+ message: "Do not use the Prisma Client directly in the front-end. Query an endpoint from the back-end instead."
3968
+ }]
3969
+ });
3970
+ var neurosongsFrontEndRestrictedImports_default = neurosongsFrontEndRestrictedImports;
3971
+
4217
3972
  //#endregion
4218
3973
  //#region src/configs/personal/neurosongsFrontEnd.ts
4219
3974
  const neurosongsFrontEndConfig = [{
4220
3975
  name: "@alextheman/personal/neurosongs-front-end",
4221
- rules: { "no-restricted-imports": ["error", {
4222
- paths: [
4223
- {
4224
- importNames: ["PrismaClient"],
4225
- message: "Do not use the Prisma Client directly in the front-end. Query an endpoint from the back-end instead.",
4226
- name: "@neurosongs/types"
4227
- },
4228
- {
4229
- importNames: ["LoaderProvider"],
4230
- message: "Use the internal LoaderProvider from src/components/LoaderProvider instead.",
4231
- name: "@alextheman/components"
4232
- },
4233
- {
4234
- importNames: ["Loader"],
4235
- message: "Use the internal Loader from src/components/Loader instead.",
4236
- name: "@alextheman/components"
4237
- }
4238
- ],
4239
- patterns: [{
4240
- group: ["@neurosongs/prisma-client"],
4241
- message: "Do not use the Prisma Client directly in the front-end. Query an endpoint from the back-end instead."
4242
- }]
4243
- }] }
3976
+ rules: { "no-restricted-imports": ["error", neurosongsFrontEndRestrictedImports_default] }
4244
3977
  }];
4245
3978
  var neurosongsFrontEnd_default = neurosongsFrontEndConfig;
4246
3979
 
@@ -4397,24 +4130,6 @@ function fixOnCondition(fixable, fix) {
4397
4130
  }
4398
4131
  var fixOnCondition_default = fixOnCondition;
4399
4132
 
4400
- //#endregion
4401
- //#region src/utility/createRuleSchemaFromZodSchema.ts
4402
- function createRuleSchemaFromZodSchema(schema$1) {
4403
- return [omitProperties(z.toJSONSchema(schema$1), "$schema")];
4404
- }
4405
- var createRuleSchemaFromZodSchema_default = createRuleSchemaFromZodSchema;
4406
-
4407
- //#endregion
4408
- //#region src/utility/getImportSpecifiersAfterRemoving.ts
4409
- function getImportSpecifiersAfterRemoving(context, specifiers, importToRemove) {
4410
- return specifiers.filter((specifier) => {
4411
- return !(specifier.imported.name === importToRemove);
4412
- }).map((specifier) => {
4413
- return context.sourceCode.getText(specifier);
4414
- }).join(", ");
4415
- }
4416
- var getImportSpecifiersAfterRemoving_default = getImportSpecifiersAfterRemoving;
4417
-
4418
4133
  //#endregion
4419
4134
  //#region src/rules/consistent-test-function.ts
4420
4135
  const validTestFunctionsSchema = z.enum(["test", "it"]);
@@ -4513,13 +4228,6 @@ const consistentTestFunction = createRule_default({
4513
4228
  });
4514
4229
  var consistent_test_function_default = consistentTestFunction;
4515
4230
 
4516
- //#endregion
4517
- //#region src/utility/checkCallExpression.ts
4518
- function checkCallExpression(node, objectName, propertyName) {
4519
- return node.callee.type === AST_NODE_TYPES.MemberExpression && node.callee.object.type === AST_NODE_TYPES.Identifier && node.callee.object.name === objectName && node.callee.property.type === AST_NODE_TYPES.Identifier && node.callee.property.name === propertyName;
4520
- }
4521
- var checkCallExpression_default = checkCallExpression;
4522
-
4523
4231
  //#endregion
4524
4232
  //#region src/rules/no-isolated-tests.ts
4525
4233
  const noIsolatedTests = createRule_default({
@@ -4839,4 +4547,4 @@ var alexPlugin_default = alexPlugin;
4839
4547
  var src_default = alexPlugin_default;
4840
4548
 
4841
4549
  //#endregion
4842
- export { checkCallExpression_default as checkCallExpression, createRuleSchemaFromZodSchema_default as createRuleSchemaFromZodSchema, src_default as default, fixOnCondition_default as fixOnCondition, getImportSpecifiersAfterRemoving_default as getImportSpecifiersAfterRemoving, parseConsistentTestFunctionOptions, parseNoNamespaceImportsOptions, parseNoRelativeImportsOptions, parseStandardiseErrorMessagesOptions, parseTestFunction, parseUseNormalizedImportsOptions, prettierRules_default as prettierRules, reactLanguageOptions_default as reactLanguageOptions, sortExports_default as sortExports, sortImports_default as sortImports, sortObjects_default as sortObjects, typeScriptLanguageOptions_default as typeScriptLanguageOptions, unusedVarsIgnorePatterns_default as unusedVarsIgnorePatterns, vitestConfig_default as vitestConfig };
4550
+ export { checkCallExpression_default as checkCallExpression, combineRestrictedImports_default as combineRestrictedImports, createRuleSchemaFromZodSchema_default as createRuleSchemaFromZodSchema, src_default as default, fixOnCondition_default as fixOnCondition, getImportSpecifiersAfterRemoving_default as getImportSpecifiersAfterRemoving, parseConsistentTestFunctionOptions, parseNoNamespaceImportsOptions, parseNoRelativeImportsOptions, parseStandardiseErrorMessagesOptions, parseTestFunction, parseUseNormalizedImportsOptions, prettierRules_default as prettierRules, reactLanguageOptions_default as reactLanguageOptions, sortExports_default as sortExports, sortImports_default as sortImports, sortObjects_default as sortObjects, typeScriptLanguageOptions_default as typeScriptLanguageOptions, unusedVarsIgnorePatterns_default as unusedVarsIgnorePatterns, vitestConfig_default as vitestConfig };