@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.cjs +139 -429
- package/dist/index.d.cts +71 -1
- package/dist/index.d.ts +71 -1
- package/dist/index.js +137 -429
- package/package.json +37 -37
package/dist/index.cjs
CHANGED
|
@@ -28,6 +28,11 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
28
28
|
|
|
29
29
|
//#endregion
|
|
30
30
|
let __alextheman_utility = require("@alextheman/utility");
|
|
31
|
+
let __typescript_eslint_utils = require("@typescript-eslint/utils");
|
|
32
|
+
let zod = require("zod");
|
|
33
|
+
zod = __toESM(zod);
|
|
34
|
+
let __eslint_js = require("@eslint/js");
|
|
35
|
+
__eslint_js = __toESM(__eslint_js);
|
|
31
36
|
let eslint_config_prettier = require("eslint-config-prettier");
|
|
32
37
|
eslint_config_prettier = __toESM(eslint_config_prettier);
|
|
33
38
|
let eslint_plugin_import = require("eslint-plugin-import");
|
|
@@ -51,16 +56,13 @@ let eslint_plugin_react_hooks = require("eslint-plugin-react-hooks");
|
|
|
51
56
|
eslint_plugin_react_hooks = __toESM(eslint_plugin_react_hooks);
|
|
52
57
|
let eslint_plugin_package_json = require("eslint-plugin-package-json");
|
|
53
58
|
eslint_plugin_package_json = __toESM(eslint_plugin_package_json);
|
|
54
|
-
let __typescript_eslint_utils = require("@typescript-eslint/utils");
|
|
55
|
-
let zod = require("zod");
|
|
56
|
-
zod = __toESM(zod);
|
|
57
59
|
|
|
58
60
|
//#region package.json
|
|
59
61
|
var name = "@alextheman/eslint-plugin";
|
|
60
|
-
var version = "4.
|
|
62
|
+
var version = "4.4.0";
|
|
61
63
|
|
|
62
64
|
//#endregion
|
|
63
|
-
//#region node_modules/globals/globals.json
|
|
65
|
+
//#region node_modules/.pnpm/globals@16.5.0/node_modules/globals/globals.json
|
|
64
66
|
var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
65
67
|
module.exports = {
|
|
66
68
|
"amd": {
|
|
@@ -3408,14 +3410,68 @@ var require_globals$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
|
3408
3410
|
}));
|
|
3409
3411
|
|
|
3410
3412
|
//#endregion
|
|
3411
|
-
//#region node_modules/globals/index.js
|
|
3413
|
+
//#region node_modules/.pnpm/globals@16.5.0/node_modules/globals/index.js
|
|
3412
3414
|
var require_globals = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3413
3415
|
module.exports = require_globals$1();
|
|
3414
3416
|
}));
|
|
3415
3417
|
|
|
3416
3418
|
//#endregion
|
|
3417
|
-
//#region src/configs/
|
|
3419
|
+
//#region src/configs/helpers/restrictedImports/generalRestrictedImports.ts
|
|
3418
3420
|
var import_globals$2 = /* @__PURE__ */ __toESM(require_globals(), 1);
|
|
3421
|
+
const generalRestrictedImports = { patterns: [{
|
|
3422
|
+
group: ["node_modules"],
|
|
3423
|
+
message: "Do not import directly from node_modules."
|
|
3424
|
+
}] };
|
|
3425
|
+
var generalRestrictedImports_default = generalRestrictedImports;
|
|
3426
|
+
|
|
3427
|
+
//#endregion
|
|
3428
|
+
//#region src/utility/checkCallExpression.ts
|
|
3429
|
+
function checkCallExpression(node, objectName, propertyName) {
|
|
3430
|
+
return node.callee.type === __typescript_eslint_utils.AST_NODE_TYPES.MemberExpression && node.callee.object.type === __typescript_eslint_utils.AST_NODE_TYPES.Identifier && node.callee.object.name === objectName && node.callee.property.type === __typescript_eslint_utils.AST_NODE_TYPES.Identifier && node.callee.property.name === propertyName;
|
|
3431
|
+
}
|
|
3432
|
+
var checkCallExpression_default = checkCallExpression;
|
|
3433
|
+
|
|
3434
|
+
//#endregion
|
|
3435
|
+
//#region src/utility/combineRestrictedImports.ts
|
|
3436
|
+
function combineRestrictedImports(firstGroup, secondGroup) {
|
|
3437
|
+
const combinedGroup = {
|
|
3438
|
+
paths: [...firstGroup.paths ?? [], ...secondGroup.paths ?? []],
|
|
3439
|
+
patterns: [...firstGroup.patterns ?? [], ...secondGroup.patterns ?? []]
|
|
3440
|
+
};
|
|
3441
|
+
if (combinedGroup.paths.length === 0) return (0, __alextheman_utility.omitProperties)(combinedGroup, "paths");
|
|
3442
|
+
if (combinedGroup.patterns.length === 0) return (0, __alextheman_utility.omitProperties)(combinedGroup, "patterns");
|
|
3443
|
+
return combinedGroup;
|
|
3444
|
+
}
|
|
3445
|
+
var combineRestrictedImports_default = combineRestrictedImports;
|
|
3446
|
+
|
|
3447
|
+
//#endregion
|
|
3448
|
+
//#region src/utility/createRuleSchemaFromZodSchema.ts
|
|
3449
|
+
function createRuleSchemaFromZodSchema(schema$1) {
|
|
3450
|
+
return [(0, __alextheman_utility.omitProperties)(zod.default.toJSONSchema(schema$1), "$schema")];
|
|
3451
|
+
}
|
|
3452
|
+
var createRuleSchemaFromZodSchema_default = createRuleSchemaFromZodSchema;
|
|
3453
|
+
|
|
3454
|
+
//#endregion
|
|
3455
|
+
//#region src/utility/getImportSpecifiersAfterRemoving.ts
|
|
3456
|
+
function getImportSpecifiersAfterRemoving(context, specifiers, importToRemove) {
|
|
3457
|
+
return specifiers.filter((specifier) => {
|
|
3458
|
+
return !(specifier.imported.name === importToRemove);
|
|
3459
|
+
}).map((specifier) => {
|
|
3460
|
+
return context.sourceCode.getText(specifier);
|
|
3461
|
+
}).join(", ");
|
|
3462
|
+
}
|
|
3463
|
+
var getImportSpecifiersAfterRemoving_default = getImportSpecifiersAfterRemoving;
|
|
3464
|
+
|
|
3465
|
+
//#endregion
|
|
3466
|
+
//#region src/configs/helpers/restrictedImports/testsRestrictedImports.ts
|
|
3467
|
+
const testsRestrictedImports = combineRestrictedImports_default(generalRestrictedImports_default, { paths: [{
|
|
3468
|
+
message: "Use test functions from vitest instead.",
|
|
3469
|
+
name: "node:test"
|
|
3470
|
+
}] });
|
|
3471
|
+
var testsRestrictedImports_default = testsRestrictedImports;
|
|
3472
|
+
|
|
3473
|
+
//#endregion
|
|
3474
|
+
//#region src/configs/personal/testsBase.ts
|
|
3419
3475
|
const personalTestsBaseConfig = [{
|
|
3420
3476
|
files: ["**/*.test.{js,ts}"],
|
|
3421
3477
|
languageOptions: { globals: {
|
|
@@ -3440,10 +3496,7 @@ const personalTestsBaseConfig = [{
|
|
|
3440
3496
|
name: "expect"
|
|
3441
3497
|
}
|
|
3442
3498
|
],
|
|
3443
|
-
"no-restricted-imports": ["error",
|
|
3444
|
-
message: "Use test functions from vitest instead.",
|
|
3445
|
-
name: "node:test"
|
|
3446
|
-
}] }]
|
|
3499
|
+
"no-restricted-imports": ["error", testsRestrictedImports_default]
|
|
3447
3500
|
}
|
|
3448
3501
|
}];
|
|
3449
3502
|
var testsBase_default$1 = personalTestsBaseConfig;
|
|
@@ -3490,338 +3543,8 @@ function createCombinedTestsBaseConfig(plugin) {
|
|
|
3490
3543
|
}
|
|
3491
3544
|
var testsBase_default = createCombinedTestsBaseConfig;
|
|
3492
3545
|
|
|
3493
|
-
//#endregion
|
|
3494
|
-
//#region node_modules/@eslint/js/package.json
|
|
3495
|
-
var require_package = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3496
|
-
module.exports = {
|
|
3497
|
-
"name": "@eslint/js",
|
|
3498
|
-
"version": "9.39.1",
|
|
3499
|
-
"description": "ESLint JavaScript language implementation",
|
|
3500
|
-
"funding": "https://eslint.org/donate",
|
|
3501
|
-
"main": "./src/index.js",
|
|
3502
|
-
"types": "./types/index.d.ts",
|
|
3503
|
-
"scripts": { "test:types": "tsc -p tests/types/tsconfig.json" },
|
|
3504
|
-
"files": [
|
|
3505
|
-
"LICENSE",
|
|
3506
|
-
"README.md",
|
|
3507
|
-
"src",
|
|
3508
|
-
"types"
|
|
3509
|
-
],
|
|
3510
|
-
"publishConfig": { "access": "public" },
|
|
3511
|
-
"repository": {
|
|
3512
|
-
"type": "git",
|
|
3513
|
-
"url": "https://github.com/eslint/eslint.git",
|
|
3514
|
-
"directory": "packages/js"
|
|
3515
|
-
},
|
|
3516
|
-
"homepage": "https://eslint.org",
|
|
3517
|
-
"bugs": "https://github.com/eslint/eslint/issues/",
|
|
3518
|
-
"keywords": [
|
|
3519
|
-
"javascript",
|
|
3520
|
-
"eslint-plugin",
|
|
3521
|
-
"eslint"
|
|
3522
|
-
],
|
|
3523
|
-
"license": "MIT",
|
|
3524
|
-
"engines": { "node": "^18.18.0 || ^20.9.0 || >=21.1.0" }
|
|
3525
|
-
};
|
|
3526
|
-
}));
|
|
3527
|
-
|
|
3528
|
-
//#endregion
|
|
3529
|
-
//#region node_modules/@eslint/js/src/configs/eslint-all.js
|
|
3530
|
-
var require_eslint_all = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3531
|
-
module.exports = Object.freeze({ rules: Object.freeze({
|
|
3532
|
-
"accessor-pairs": "error",
|
|
3533
|
-
"array-callback-return": "error",
|
|
3534
|
-
"arrow-body-style": "error",
|
|
3535
|
-
"block-scoped-var": "error",
|
|
3536
|
-
"camelcase": "error",
|
|
3537
|
-
"capitalized-comments": "error",
|
|
3538
|
-
"class-methods-use-this": "error",
|
|
3539
|
-
"complexity": "error",
|
|
3540
|
-
"consistent-return": "error",
|
|
3541
|
-
"consistent-this": "error",
|
|
3542
|
-
"constructor-super": "error",
|
|
3543
|
-
"curly": "error",
|
|
3544
|
-
"default-case": "error",
|
|
3545
|
-
"default-case-last": "error",
|
|
3546
|
-
"default-param-last": "error",
|
|
3547
|
-
"dot-notation": "error",
|
|
3548
|
-
"eqeqeq": "error",
|
|
3549
|
-
"for-direction": "error",
|
|
3550
|
-
"func-name-matching": "error",
|
|
3551
|
-
"func-names": "error",
|
|
3552
|
-
"func-style": "error",
|
|
3553
|
-
"getter-return": "error",
|
|
3554
|
-
"grouped-accessor-pairs": "error",
|
|
3555
|
-
"guard-for-in": "error",
|
|
3556
|
-
"id-denylist": "error",
|
|
3557
|
-
"id-length": "error",
|
|
3558
|
-
"id-match": "error",
|
|
3559
|
-
"init-declarations": "error",
|
|
3560
|
-
"logical-assignment-operators": "error",
|
|
3561
|
-
"max-classes-per-file": "error",
|
|
3562
|
-
"max-depth": "error",
|
|
3563
|
-
"max-lines": "error",
|
|
3564
|
-
"max-lines-per-function": "error",
|
|
3565
|
-
"max-nested-callbacks": "error",
|
|
3566
|
-
"max-params": "error",
|
|
3567
|
-
"max-statements": "error",
|
|
3568
|
-
"new-cap": "error",
|
|
3569
|
-
"no-alert": "error",
|
|
3570
|
-
"no-array-constructor": "error",
|
|
3571
|
-
"no-async-promise-executor": "error",
|
|
3572
|
-
"no-await-in-loop": "error",
|
|
3573
|
-
"no-bitwise": "error",
|
|
3574
|
-
"no-caller": "error",
|
|
3575
|
-
"no-case-declarations": "error",
|
|
3576
|
-
"no-class-assign": "error",
|
|
3577
|
-
"no-compare-neg-zero": "error",
|
|
3578
|
-
"no-cond-assign": "error",
|
|
3579
|
-
"no-console": "error",
|
|
3580
|
-
"no-const-assign": "error",
|
|
3581
|
-
"no-constant-binary-expression": "error",
|
|
3582
|
-
"no-constant-condition": "error",
|
|
3583
|
-
"no-constructor-return": "error",
|
|
3584
|
-
"no-continue": "error",
|
|
3585
|
-
"no-control-regex": "error",
|
|
3586
|
-
"no-debugger": "error",
|
|
3587
|
-
"no-delete-var": "error",
|
|
3588
|
-
"no-div-regex": "error",
|
|
3589
|
-
"no-dupe-args": "error",
|
|
3590
|
-
"no-dupe-class-members": "error",
|
|
3591
|
-
"no-dupe-else-if": "error",
|
|
3592
|
-
"no-dupe-keys": "error",
|
|
3593
|
-
"no-duplicate-case": "error",
|
|
3594
|
-
"no-duplicate-imports": "error",
|
|
3595
|
-
"no-else-return": "error",
|
|
3596
|
-
"no-empty": "error",
|
|
3597
|
-
"no-empty-character-class": "error",
|
|
3598
|
-
"no-empty-function": "error",
|
|
3599
|
-
"no-empty-pattern": "error",
|
|
3600
|
-
"no-empty-static-block": "error",
|
|
3601
|
-
"no-eq-null": "error",
|
|
3602
|
-
"no-eval": "error",
|
|
3603
|
-
"no-ex-assign": "error",
|
|
3604
|
-
"no-extend-native": "error",
|
|
3605
|
-
"no-extra-bind": "error",
|
|
3606
|
-
"no-extra-boolean-cast": "error",
|
|
3607
|
-
"no-extra-label": "error",
|
|
3608
|
-
"no-fallthrough": "error",
|
|
3609
|
-
"no-func-assign": "error",
|
|
3610
|
-
"no-global-assign": "error",
|
|
3611
|
-
"no-implicit-coercion": "error",
|
|
3612
|
-
"no-implicit-globals": "error",
|
|
3613
|
-
"no-implied-eval": "error",
|
|
3614
|
-
"no-import-assign": "error",
|
|
3615
|
-
"no-inline-comments": "error",
|
|
3616
|
-
"no-inner-declarations": "error",
|
|
3617
|
-
"no-invalid-regexp": "error",
|
|
3618
|
-
"no-invalid-this": "error",
|
|
3619
|
-
"no-irregular-whitespace": "error",
|
|
3620
|
-
"no-iterator": "error",
|
|
3621
|
-
"no-label-var": "error",
|
|
3622
|
-
"no-labels": "error",
|
|
3623
|
-
"no-lone-blocks": "error",
|
|
3624
|
-
"no-lonely-if": "error",
|
|
3625
|
-
"no-loop-func": "error",
|
|
3626
|
-
"no-loss-of-precision": "error",
|
|
3627
|
-
"no-magic-numbers": "error",
|
|
3628
|
-
"no-misleading-character-class": "error",
|
|
3629
|
-
"no-multi-assign": "error",
|
|
3630
|
-
"no-multi-str": "error",
|
|
3631
|
-
"no-negated-condition": "error",
|
|
3632
|
-
"no-nested-ternary": "error",
|
|
3633
|
-
"no-new": "error",
|
|
3634
|
-
"no-new-func": "error",
|
|
3635
|
-
"no-new-native-nonconstructor": "error",
|
|
3636
|
-
"no-new-wrappers": "error",
|
|
3637
|
-
"no-nonoctal-decimal-escape": "error",
|
|
3638
|
-
"no-obj-calls": "error",
|
|
3639
|
-
"no-object-constructor": "error",
|
|
3640
|
-
"no-octal": "error",
|
|
3641
|
-
"no-octal-escape": "error",
|
|
3642
|
-
"no-param-reassign": "error",
|
|
3643
|
-
"no-plusplus": "error",
|
|
3644
|
-
"no-promise-executor-return": "error",
|
|
3645
|
-
"no-proto": "error",
|
|
3646
|
-
"no-prototype-builtins": "error",
|
|
3647
|
-
"no-redeclare": "error",
|
|
3648
|
-
"no-regex-spaces": "error",
|
|
3649
|
-
"no-restricted-exports": "error",
|
|
3650
|
-
"no-restricted-globals": "error",
|
|
3651
|
-
"no-restricted-imports": "error",
|
|
3652
|
-
"no-restricted-properties": "error",
|
|
3653
|
-
"no-restricted-syntax": "error",
|
|
3654
|
-
"no-return-assign": "error",
|
|
3655
|
-
"no-script-url": "error",
|
|
3656
|
-
"no-self-assign": "error",
|
|
3657
|
-
"no-self-compare": "error",
|
|
3658
|
-
"no-sequences": "error",
|
|
3659
|
-
"no-setter-return": "error",
|
|
3660
|
-
"no-shadow": "error",
|
|
3661
|
-
"no-shadow-restricted-names": "error",
|
|
3662
|
-
"no-sparse-arrays": "error",
|
|
3663
|
-
"no-template-curly-in-string": "error",
|
|
3664
|
-
"no-ternary": "error",
|
|
3665
|
-
"no-this-before-super": "error",
|
|
3666
|
-
"no-throw-literal": "error",
|
|
3667
|
-
"no-unassigned-vars": "error",
|
|
3668
|
-
"no-undef": "error",
|
|
3669
|
-
"no-undef-init": "error",
|
|
3670
|
-
"no-undefined": "error",
|
|
3671
|
-
"no-underscore-dangle": "error",
|
|
3672
|
-
"no-unexpected-multiline": "error",
|
|
3673
|
-
"no-unmodified-loop-condition": "error",
|
|
3674
|
-
"no-unneeded-ternary": "error",
|
|
3675
|
-
"no-unreachable": "error",
|
|
3676
|
-
"no-unreachable-loop": "error",
|
|
3677
|
-
"no-unsafe-finally": "error",
|
|
3678
|
-
"no-unsafe-negation": "error",
|
|
3679
|
-
"no-unsafe-optional-chaining": "error",
|
|
3680
|
-
"no-unused-expressions": "error",
|
|
3681
|
-
"no-unused-labels": "error",
|
|
3682
|
-
"no-unused-private-class-members": "error",
|
|
3683
|
-
"no-unused-vars": "error",
|
|
3684
|
-
"no-use-before-define": "error",
|
|
3685
|
-
"no-useless-assignment": "error",
|
|
3686
|
-
"no-useless-backreference": "error",
|
|
3687
|
-
"no-useless-call": "error",
|
|
3688
|
-
"no-useless-catch": "error",
|
|
3689
|
-
"no-useless-computed-key": "error",
|
|
3690
|
-
"no-useless-concat": "error",
|
|
3691
|
-
"no-useless-constructor": "error",
|
|
3692
|
-
"no-useless-escape": "error",
|
|
3693
|
-
"no-useless-rename": "error",
|
|
3694
|
-
"no-useless-return": "error",
|
|
3695
|
-
"no-var": "error",
|
|
3696
|
-
"no-void": "error",
|
|
3697
|
-
"no-warning-comments": "error",
|
|
3698
|
-
"no-with": "error",
|
|
3699
|
-
"object-shorthand": "error",
|
|
3700
|
-
"one-var": "error",
|
|
3701
|
-
"operator-assignment": "error",
|
|
3702
|
-
"prefer-arrow-callback": "error",
|
|
3703
|
-
"prefer-const": "error",
|
|
3704
|
-
"prefer-destructuring": "error",
|
|
3705
|
-
"prefer-exponentiation-operator": "error",
|
|
3706
|
-
"prefer-named-capture-group": "error",
|
|
3707
|
-
"prefer-numeric-literals": "error",
|
|
3708
|
-
"prefer-object-has-own": "error",
|
|
3709
|
-
"prefer-object-spread": "error",
|
|
3710
|
-
"prefer-promise-reject-errors": "error",
|
|
3711
|
-
"prefer-regex-literals": "error",
|
|
3712
|
-
"prefer-rest-params": "error",
|
|
3713
|
-
"prefer-spread": "error",
|
|
3714
|
-
"prefer-template": "error",
|
|
3715
|
-
"preserve-caught-error": "error",
|
|
3716
|
-
"radix": "error",
|
|
3717
|
-
"require-atomic-updates": "error",
|
|
3718
|
-
"require-await": "error",
|
|
3719
|
-
"require-unicode-regexp": "error",
|
|
3720
|
-
"require-yield": "error",
|
|
3721
|
-
"sort-imports": "error",
|
|
3722
|
-
"sort-keys": "error",
|
|
3723
|
-
"sort-vars": "error",
|
|
3724
|
-
"strict": "error",
|
|
3725
|
-
"symbol-description": "error",
|
|
3726
|
-
"unicode-bom": "error",
|
|
3727
|
-
"use-isnan": "error",
|
|
3728
|
-
"valid-typeof": "error",
|
|
3729
|
-
"vars-on-top": "error",
|
|
3730
|
-
"yoda": "error"
|
|
3731
|
-
}) });
|
|
3732
|
-
}));
|
|
3733
|
-
|
|
3734
|
-
//#endregion
|
|
3735
|
-
//#region node_modules/@eslint/js/src/configs/eslint-recommended.js
|
|
3736
|
-
var require_eslint_recommended = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3737
|
-
module.exports = Object.freeze({ rules: Object.freeze({
|
|
3738
|
-
"constructor-super": "error",
|
|
3739
|
-
"for-direction": "error",
|
|
3740
|
-
"getter-return": "error",
|
|
3741
|
-
"no-async-promise-executor": "error",
|
|
3742
|
-
"no-case-declarations": "error",
|
|
3743
|
-
"no-class-assign": "error",
|
|
3744
|
-
"no-compare-neg-zero": "error",
|
|
3745
|
-
"no-cond-assign": "error",
|
|
3746
|
-
"no-const-assign": "error",
|
|
3747
|
-
"no-constant-binary-expression": "error",
|
|
3748
|
-
"no-constant-condition": "error",
|
|
3749
|
-
"no-control-regex": "error",
|
|
3750
|
-
"no-debugger": "error",
|
|
3751
|
-
"no-delete-var": "error",
|
|
3752
|
-
"no-dupe-args": "error",
|
|
3753
|
-
"no-dupe-class-members": "error",
|
|
3754
|
-
"no-dupe-else-if": "error",
|
|
3755
|
-
"no-dupe-keys": "error",
|
|
3756
|
-
"no-duplicate-case": "error",
|
|
3757
|
-
"no-empty": "error",
|
|
3758
|
-
"no-empty-character-class": "error",
|
|
3759
|
-
"no-empty-pattern": "error",
|
|
3760
|
-
"no-empty-static-block": "error",
|
|
3761
|
-
"no-ex-assign": "error",
|
|
3762
|
-
"no-extra-boolean-cast": "error",
|
|
3763
|
-
"no-fallthrough": "error",
|
|
3764
|
-
"no-func-assign": "error",
|
|
3765
|
-
"no-global-assign": "error",
|
|
3766
|
-
"no-import-assign": "error",
|
|
3767
|
-
"no-invalid-regexp": "error",
|
|
3768
|
-
"no-irregular-whitespace": "error",
|
|
3769
|
-
"no-loss-of-precision": "error",
|
|
3770
|
-
"no-misleading-character-class": "error",
|
|
3771
|
-
"no-new-native-nonconstructor": "error",
|
|
3772
|
-
"no-nonoctal-decimal-escape": "error",
|
|
3773
|
-
"no-obj-calls": "error",
|
|
3774
|
-
"no-octal": "error",
|
|
3775
|
-
"no-prototype-builtins": "error",
|
|
3776
|
-
"no-redeclare": "error",
|
|
3777
|
-
"no-regex-spaces": "error",
|
|
3778
|
-
"no-self-assign": "error",
|
|
3779
|
-
"no-setter-return": "error",
|
|
3780
|
-
"no-shadow-restricted-names": "error",
|
|
3781
|
-
"no-sparse-arrays": "error",
|
|
3782
|
-
"no-this-before-super": "error",
|
|
3783
|
-
"no-undef": "error",
|
|
3784
|
-
"no-unexpected-multiline": "error",
|
|
3785
|
-
"no-unreachable": "error",
|
|
3786
|
-
"no-unsafe-finally": "error",
|
|
3787
|
-
"no-unsafe-negation": "error",
|
|
3788
|
-
"no-unsafe-optional-chaining": "error",
|
|
3789
|
-
"no-unused-labels": "error",
|
|
3790
|
-
"no-unused-private-class-members": "error",
|
|
3791
|
-
"no-unused-vars": "error",
|
|
3792
|
-
"no-useless-backreference": "error",
|
|
3793
|
-
"no-useless-catch": "error",
|
|
3794
|
-
"no-useless-escape": "error",
|
|
3795
|
-
"no-with": "error",
|
|
3796
|
-
"require-yield": "error",
|
|
3797
|
-
"use-isnan": "error",
|
|
3798
|
-
"valid-typeof": "error"
|
|
3799
|
-
}) });
|
|
3800
|
-
}));
|
|
3801
|
-
|
|
3802
|
-
//#endregion
|
|
3803
|
-
//#region node_modules/@eslint/js/src/index.js
|
|
3804
|
-
/**
|
|
3805
|
-
* @fileoverview Main package entrypoint.
|
|
3806
|
-
* @author Nicholas C. Zakas
|
|
3807
|
-
*/
|
|
3808
|
-
var require_src = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
3809
|
-
const { name: name$1, version: version$1 } = require_package();
|
|
3810
|
-
module.exports = {
|
|
3811
|
-
meta: {
|
|
3812
|
-
name: name$1,
|
|
3813
|
-
version: version$1
|
|
3814
|
-
},
|
|
3815
|
-
configs: {
|
|
3816
|
-
all: require_eslint_all(),
|
|
3817
|
-
recommended: require_eslint_recommended()
|
|
3818
|
-
}
|
|
3819
|
-
};
|
|
3820
|
-
}));
|
|
3821
|
-
|
|
3822
3546
|
//#endregion
|
|
3823
3547
|
//#region src/configs/helpers/javaScriptLanguageOptions.ts
|
|
3824
|
-
var import_src = /* @__PURE__ */ __toESM(require_src(), 1);
|
|
3825
3548
|
var import_globals$1 = /* @__PURE__ */ __toESM(require_globals(), 1);
|
|
3826
3549
|
const javaScriptLanguageOptions = { globals: {
|
|
3827
3550
|
...import_globals$1.default.node,
|
|
@@ -3842,7 +3565,7 @@ var unusedVarsIgnorePatterns_default = unusedVarsIgnorePatterns;
|
|
|
3842
3565
|
//#endregion
|
|
3843
3566
|
//#region src/configs/general/javaScriptBase.ts
|
|
3844
3567
|
const javaScriptBase = [
|
|
3845
|
-
|
|
3568
|
+
__eslint_js.default.configs.recommended,
|
|
3846
3569
|
eslint_config_prettier.default,
|
|
3847
3570
|
{
|
|
3848
3571
|
files: [
|
|
@@ -3868,10 +3591,7 @@ const javaScriptBase = [
|
|
|
3868
3591
|
"no-lonely-if": "error",
|
|
3869
3592
|
"no-new-wrappers": "error",
|
|
3870
3593
|
"no-param-reassign": "error",
|
|
3871
|
-
"no-restricted-imports": ["error",
|
|
3872
|
-
group: ["node_modules"],
|
|
3873
|
-
message: "What on Earth are you doing? Leave poor node_modules alone!"
|
|
3874
|
-
}] }],
|
|
3594
|
+
"no-restricted-imports": ["error", generalRestrictedImports_default],
|
|
3875
3595
|
"no-undef": "error",
|
|
3876
3596
|
"no-unused-vars": ["error", unusedVarsIgnorePatterns_default],
|
|
3877
3597
|
"no-useless-rename": "error",
|
|
@@ -4088,6 +3808,14 @@ const reactBase = [
|
|
|
4088
3808
|
];
|
|
4089
3809
|
var reactBase_default$1 = reactBase;
|
|
4090
3810
|
|
|
3811
|
+
//#endregion
|
|
3812
|
+
//#region src/configs/helpers/restrictedImports/reactRestrictedImports.ts
|
|
3813
|
+
const reactRestrictedImports = combineRestrictedImports_default(generalRestrictedImports_default, { patterns: [{
|
|
3814
|
+
message: "Please use `import Component from \"@mui/[package]/Component\"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.",
|
|
3815
|
+
regex: "^@mui/[^/]+$"
|
|
3816
|
+
}] });
|
|
3817
|
+
var reactRestrictedImports_default = reactRestrictedImports;
|
|
3818
|
+
|
|
4091
3819
|
//#endregion
|
|
4092
3820
|
//#region src/configs/personal/reactBase.ts
|
|
4093
3821
|
const personalReactBaseConfig = [{
|
|
@@ -4099,10 +3827,7 @@ const personalReactBaseConfig = [{
|
|
|
4099
3827
|
"react-refresh": eslint_plugin_react_refresh.default
|
|
4100
3828
|
},
|
|
4101
3829
|
rules: {
|
|
4102
|
-
"no-restricted-imports": ["error",
|
|
4103
|
-
message: "Please use `import Component from \"@mui/[package]/Component\"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.",
|
|
4104
|
-
regex: "^@mui/[^/]+$"
|
|
4105
|
-
}] }],
|
|
3830
|
+
"no-restricted-imports": ["error", reactRestrictedImports_default],
|
|
4106
3831
|
"react-hooks/exhaustive-deps": "off",
|
|
4107
3832
|
"react-hooks/refs": "off",
|
|
4108
3833
|
"react-refresh/only-export-components": "off",
|
|
@@ -4156,6 +3881,25 @@ const typeScriptBase = [
|
|
|
4156
3881
|
];
|
|
4157
3882
|
var typeScriptBase_default$1 = typeScriptBase;
|
|
4158
3883
|
|
|
3884
|
+
//#endregion
|
|
3885
|
+
//#region src/configs/helpers/restrictedImports/eslintPluginRestrictedImports.ts
|
|
3886
|
+
const eslintPluginRestrictedImports = combineRestrictedImports_default(generalRestrictedImports_default, { paths: [...[
|
|
3887
|
+
"src/alexPlugin",
|
|
3888
|
+
"src/index",
|
|
3889
|
+
"src"
|
|
3890
|
+
].map((name$1) => {
|
|
3891
|
+
return {
|
|
3892
|
+
importNames: ["default"],
|
|
3893
|
+
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.",
|
|
3894
|
+
name: name$1
|
|
3895
|
+
};
|
|
3896
|
+
}), {
|
|
3897
|
+
importNames: ["default"],
|
|
3898
|
+
message: "Please import from \"src/configs/helpers/eslint-plugin-react-hooks\" instead.",
|
|
3899
|
+
name: "eslint-plugin-react-hooks"
|
|
3900
|
+
}] });
|
|
3901
|
+
var eslintPluginRestrictedImports_default = eslintPluginRestrictedImports;
|
|
3902
|
+
|
|
4159
3903
|
//#endregion
|
|
4160
3904
|
//#region src/configs/personal/eslintPlugin.ts
|
|
4161
3905
|
function createPersonalEslintPluginConfig(plugin) {
|
|
@@ -4167,21 +3911,7 @@ function createPersonalEslintPluginConfig(plugin) {
|
|
|
4167
3911
|
},
|
|
4168
3912
|
rules: {
|
|
4169
3913
|
"@alextheman/no-plugin-configs-access-from-src-configs": "error",
|
|
4170
|
-
"no-restricted-imports": ["error",
|
|
4171
|
-
"src/alexPlugin",
|
|
4172
|
-
"src/index",
|
|
4173
|
-
"src"
|
|
4174
|
-
].map((name$2) => {
|
|
4175
|
-
return {
|
|
4176
|
-
importNames: ["default"],
|
|
4177
|
-
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.",
|
|
4178
|
-
name: name$2
|
|
4179
|
-
};
|
|
4180
|
-
}), {
|
|
4181
|
-
importNames: ["default"],
|
|
4182
|
-
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.",
|
|
4183
|
-
name: "eslint-plugin-react-hooks"
|
|
4184
|
-
}] }]
|
|
3914
|
+
"no-restricted-imports": ["error", eslintPluginRestrictedImports_default]
|
|
4185
3915
|
}
|
|
4186
3916
|
}, {
|
|
4187
3917
|
files: ["src/rules/index.ts", "src/configs/**"],
|
|
@@ -4190,27 +3920,32 @@ function createPersonalEslintPluginConfig(plugin) {
|
|
|
4190
3920
|
}
|
|
4191
3921
|
var eslintPlugin_default = createPersonalEslintPluginConfig;
|
|
4192
3922
|
|
|
3923
|
+
//#endregion
|
|
3924
|
+
//#region src/configs/helpers/restrictedImports/neurosongsBackEndRestrictedImports.ts
|
|
3925
|
+
const neurosongsBackEndRestrictedImports = combineRestrictedImports_default(generalRestrictedImports_default, { paths: [
|
|
3926
|
+
{
|
|
3927
|
+
importNames: ["setPrismaClient"],
|
|
3928
|
+
message: "Do not attempt to reset the Prisma Client outside setup files.",
|
|
3929
|
+
name: "src/database/client"
|
|
3930
|
+
},
|
|
3931
|
+
{
|
|
3932
|
+
message: "Do not use the generated Prisma types. Use the types exported from @neurosongs/types instead.",
|
|
3933
|
+
name: "@neurosongs/prisma-client/types"
|
|
3934
|
+
},
|
|
3935
|
+
{
|
|
3936
|
+
importNames: ["PrismaClient"],
|
|
3937
|
+
message: "Please use the PrismaClient from @neurosongs/types instead.",
|
|
3938
|
+
name: "@neurosongs/prisma-client/prisma"
|
|
3939
|
+
}
|
|
3940
|
+
] });
|
|
3941
|
+
var neurosongsBackEndRestrictedImports_default = neurosongsBackEndRestrictedImports;
|
|
3942
|
+
|
|
4193
3943
|
//#endregion
|
|
4194
3944
|
//#region src/configs/personal/neurosongsBackEnd.ts
|
|
4195
3945
|
const neurosongsBackEndConfig = [
|
|
4196
3946
|
{
|
|
4197
3947
|
name: "@alextheman/personal/neurosongs-back-end",
|
|
4198
|
-
rules: { "no-restricted-imports": ["error",
|
|
4199
|
-
{
|
|
4200
|
-
importNames: ["setPrismaClient"],
|
|
4201
|
-
message: "Do not attempt to reset the Prisma Client outside setup files.",
|
|
4202
|
-
name: "src/database/client"
|
|
4203
|
-
},
|
|
4204
|
-
{
|
|
4205
|
-
message: "Do not use the generated Prisma types. Use the types exported from @neurosongs/types instead.",
|
|
4206
|
-
name: "@neurosongs/prisma-client/types"
|
|
4207
|
-
},
|
|
4208
|
-
{
|
|
4209
|
-
importNames: ["PrismaClient"],
|
|
4210
|
-
message: "Please use the PrismaClient from @neurosongs/types instead.",
|
|
4211
|
-
name: "@neurosongs/prisma-client/prisma"
|
|
4212
|
-
}
|
|
4213
|
-
] }] }
|
|
3948
|
+
rules: { "no-restricted-imports": ["error", neurosongsBackEndRestrictedImports_default] }
|
|
4214
3949
|
},
|
|
4215
3950
|
{
|
|
4216
3951
|
files: ["src/database/**/*.ts", "tests/test-utilities/setup.ts"],
|
|
@@ -4227,33 +3962,32 @@ const neurosongsBackEndConfig = [
|
|
|
4227
3962
|
];
|
|
4228
3963
|
var neurosongsBackEnd_default = neurosongsBackEndConfig;
|
|
4229
3964
|
|
|
3965
|
+
//#endregion
|
|
3966
|
+
//#region src/configs/helpers/restrictedImports/neurosongsFrontEndRestrictedImports.ts
|
|
3967
|
+
const neurosongsFrontEndRestrictedImports = combineRestrictedImports_default(reactRestrictedImports_default, {
|
|
3968
|
+
paths: [{
|
|
3969
|
+
importNames: ["PrismaClient"],
|
|
3970
|
+
message: "Do not use the Prisma Client directly in the front-end. Query an endpoint from the back-end instead.",
|
|
3971
|
+
name: "@neurosongs/types"
|
|
3972
|
+
}, ...["LoaderProvider", "Loader"].map((importName) => {
|
|
3973
|
+
return {
|
|
3974
|
+
importNames: [importName],
|
|
3975
|
+
message: `Use the internal ${importName} from src/components/${importName} instead.`,
|
|
3976
|
+
name: "@alextheman/components"
|
|
3977
|
+
};
|
|
3978
|
+
})],
|
|
3979
|
+
patterns: [{
|
|
3980
|
+
group: ["@neurosongs/prisma-client"],
|
|
3981
|
+
message: "Do not use the Prisma Client directly in the front-end. Query an endpoint from the back-end instead."
|
|
3982
|
+
}]
|
|
3983
|
+
});
|
|
3984
|
+
var neurosongsFrontEndRestrictedImports_default = neurosongsFrontEndRestrictedImports;
|
|
3985
|
+
|
|
4230
3986
|
//#endregion
|
|
4231
3987
|
//#region src/configs/personal/neurosongsFrontEnd.ts
|
|
4232
3988
|
const neurosongsFrontEndConfig = [{
|
|
4233
3989
|
name: "@alextheman/personal/neurosongs-front-end",
|
|
4234
|
-
rules: { "no-restricted-imports": ["error",
|
|
4235
|
-
paths: [
|
|
4236
|
-
{
|
|
4237
|
-
importNames: ["PrismaClient"],
|
|
4238
|
-
message: "Do not use the Prisma Client directly in the front-end. Query an endpoint from the back-end instead.",
|
|
4239
|
-
name: "@neurosongs/types"
|
|
4240
|
-
},
|
|
4241
|
-
{
|
|
4242
|
-
importNames: ["LoaderProvider"],
|
|
4243
|
-
message: "Use the internal LoaderProvider from src/components/LoaderProvider instead.",
|
|
4244
|
-
name: "@alextheman/components"
|
|
4245
|
-
},
|
|
4246
|
-
{
|
|
4247
|
-
importNames: ["Loader"],
|
|
4248
|
-
message: "Use the internal Loader from src/components/Loader instead.",
|
|
4249
|
-
name: "@alextheman/components"
|
|
4250
|
-
}
|
|
4251
|
-
],
|
|
4252
|
-
patterns: [{
|
|
4253
|
-
group: ["@neurosongs/prisma-client"],
|
|
4254
|
-
message: "Do not use the Prisma Client directly in the front-end. Query an endpoint from the back-end instead."
|
|
4255
|
-
}]
|
|
4256
|
-
}] }
|
|
3990
|
+
rules: { "no-restricted-imports": ["error", neurosongsFrontEndRestrictedImports_default] }
|
|
4257
3991
|
}];
|
|
4258
3992
|
var neurosongsFrontEnd_default = neurosongsFrontEndConfig;
|
|
4259
3993
|
|
|
@@ -4410,24 +4144,6 @@ function fixOnCondition(fixable, fix) {
|
|
|
4410
4144
|
}
|
|
4411
4145
|
var fixOnCondition_default = fixOnCondition;
|
|
4412
4146
|
|
|
4413
|
-
//#endregion
|
|
4414
|
-
//#region src/utility/createRuleSchemaFromZodSchema.ts
|
|
4415
|
-
function createRuleSchemaFromZodSchema(schema$1) {
|
|
4416
|
-
return [(0, __alextheman_utility.omitProperties)(zod.default.toJSONSchema(schema$1), "$schema")];
|
|
4417
|
-
}
|
|
4418
|
-
var createRuleSchemaFromZodSchema_default = createRuleSchemaFromZodSchema;
|
|
4419
|
-
|
|
4420
|
-
//#endregion
|
|
4421
|
-
//#region src/utility/getImportSpecifiersAfterRemoving.ts
|
|
4422
|
-
function getImportSpecifiersAfterRemoving(context, specifiers, importToRemove) {
|
|
4423
|
-
return specifiers.filter((specifier) => {
|
|
4424
|
-
return !(specifier.imported.name === importToRemove);
|
|
4425
|
-
}).map((specifier) => {
|
|
4426
|
-
return context.sourceCode.getText(specifier);
|
|
4427
|
-
}).join(", ");
|
|
4428
|
-
}
|
|
4429
|
-
var getImportSpecifiersAfterRemoving_default = getImportSpecifiersAfterRemoving;
|
|
4430
|
-
|
|
4431
4147
|
//#endregion
|
|
4432
4148
|
//#region src/rules/consistent-test-function.ts
|
|
4433
4149
|
const validTestFunctionsSchema = zod.default.enum(["test", "it"]);
|
|
@@ -4526,13 +4242,6 @@ const consistentTestFunction = createRule_default({
|
|
|
4526
4242
|
});
|
|
4527
4243
|
var consistent_test_function_default = consistentTestFunction;
|
|
4528
4244
|
|
|
4529
|
-
//#endregion
|
|
4530
|
-
//#region src/utility/checkCallExpression.ts
|
|
4531
|
-
function checkCallExpression(node, objectName, propertyName) {
|
|
4532
|
-
return node.callee.type === __typescript_eslint_utils.AST_NODE_TYPES.MemberExpression && node.callee.object.type === __typescript_eslint_utils.AST_NODE_TYPES.Identifier && node.callee.object.name === objectName && node.callee.property.type === __typescript_eslint_utils.AST_NODE_TYPES.Identifier && node.callee.property.name === propertyName;
|
|
4533
|
-
}
|
|
4534
|
-
var checkCallExpression_default = checkCallExpression;
|
|
4535
|
-
|
|
4536
4245
|
//#endregion
|
|
4537
4246
|
//#region src/rules/no-isolated-tests.ts
|
|
4538
4247
|
const noIsolatedTests = createRule_default({
|
|
@@ -4853,6 +4562,7 @@ var src_default = alexPlugin_default;
|
|
|
4853
4562
|
|
|
4854
4563
|
//#endregion
|
|
4855
4564
|
exports.checkCallExpression = checkCallExpression_default;
|
|
4565
|
+
exports.combineRestrictedImports = combineRestrictedImports_default;
|
|
4856
4566
|
exports.createRuleSchemaFromZodSchema = createRuleSchemaFromZodSchema_default;
|
|
4857
4567
|
exports.default = src_default;
|
|
4858
4568
|
exports.fixOnCondition = fixOnCondition_default;
|