@alextheman/eslint-plugin 1.13.4 → 1.13.6

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 CHANGED
@@ -3706,7 +3706,7 @@ module.exports = __toCommonJS(index_exports);
3706
3706
 
3707
3707
  // package.json
3708
3708
  var name = "@alextheman/eslint-plugin";
3709
- var version = "1.13.4";
3709
+ var version = "1.13.6";
3710
3710
 
3711
3711
  // src/configs/alexPluginBase.ts
3712
3712
  function createAlexPluginBaseConfig(plugin) {
@@ -3724,9 +3724,9 @@ function createAlexPluginBaseConfig(plugin) {
3724
3724
  {
3725
3725
  files: ["**/*.test.ts"],
3726
3726
  rules: {
3727
+ "@alextheman/consistent-test-function": ["error", { preference: "test" }],
3727
3728
  "@alextheman/no-isolated-tests": "error",
3728
- "@alextheman/no-skipped-tests": "warn",
3729
- "@alextheman/consistent-test-function": ["error", { preference: "test" }]
3729
+ "@alextheman/no-skipped-tests": "warn"
3730
3730
  }
3731
3731
  }
3732
3732
  ];
@@ -3756,106 +3756,132 @@ var typeScriptBase = [
3756
3756
  import_eslint_config_prettier.default,
3757
3757
  import_eslint_plugin_package_json.default.configs.recommended,
3758
3758
  {
3759
- name: "@alextheman/eslint-config-typescript-base",
3760
3759
  files: ["**/*.ts", "**/*.tsx"],
3760
+ ignores: ["dist"],
3761
3761
  languageOptions: {
3762
+ globals: __spreadValues(__spreadValues({}, import_globals.default.node), import_globals.default.browser),
3762
3763
  parser: import_parser.default,
3763
3764
  parserOptions: {
3764
3765
  ecmaVersion: "latest",
3765
3766
  sourceType: "module"
3766
- },
3767
- globals: __spreadValues(__spreadValues({}, import_globals.default.node), import_globals.default.browser)
3768
- },
3769
- settings: {
3770
- "import/resolver": {
3771
- typescript: true,
3772
- node: true
3773
3767
  }
3774
3768
  },
3775
- ignores: ["dist"],
3769
+ name: "@alextheman/eslint-config-typescript-base",
3776
3770
  plugins: {
3777
3771
  "@typescript-eslint": import_eslint_plugin.default,
3778
3772
  import: import_eslint_plugin_import.default,
3779
- prettier: import_eslint_plugin_prettier.default,
3780
- perfectionist: import_eslint_plugin_perfectionist.default
3773
+ perfectionist: import_eslint_plugin_perfectionist.default,
3774
+ prettier: import_eslint_plugin_prettier.default
3781
3775
  },
3782
3776
  rules: {
3783
- "import/no-unresolved": "error",
3777
+ "@typescript-eslint/consistent-type-imports": "error",
3778
+ "@typescript-eslint/no-unused-vars": [
3779
+ "error",
3780
+ {
3781
+ argsIgnorePattern: "^_",
3782
+ caughtErrorsIgnorePattern: "^_",
3783
+ varsIgnorePattern: "^_"
3784
+ }
3785
+ ],
3786
+ "arrow-body-style": ["error", "always"],
3787
+ curly: ["error", "all"],
3788
+ "dot-notation": "error",
3784
3789
  eqeqeq: "error",
3790
+ "func-style": ["error", "declaration", { allowArrowFunctions: false }],
3791
+ "import/no-unresolved": "error",
3792
+ "no-cond-assign": "error",
3785
3793
  "no-console": ["error", { allow: ["warn", "error"] }],
3786
- "perfectionist/sort-imports": [
3794
+ "no-else-return": "error",
3795
+ "no-eval": "error",
3796
+ "no-implicit-coercion": ["error", { allow: ["!!"] }],
3797
+ "no-lonely-if": "error",
3798
+ "no-new-wrappers": "error",
3799
+ "no-param-reassign": "error",
3800
+ "no-restricted-imports": [
3787
3801
  "error",
3788
3802
  {
3789
- type: "alphabetical",
3790
- order: "asc",
3791
- ignoreCase: true,
3792
- partitionByComment: false,
3793
- partitionByNewLine: false,
3794
- specialCharacters: "keep",
3795
- groups: ["type", "builtin", "external", "internal", "object"],
3796
- newlinesBetween: 1,
3797
- internalPattern: ["^src/.*"]
3803
+ patterns: [
3804
+ {
3805
+ group: ["node_modules"],
3806
+ message: "What on Earth are you doing? Leave poor node_modules alone!"
3807
+ }
3808
+ ]
3798
3809
  }
3799
3810
  ],
3811
+ "no-undef": "error",
3812
+ // Disable regular no-unused-vars rule since that will flag interface declarations. Only use the TypeScript specific rule for this.
3813
+ "no-unused-vars": "off",
3814
+ "no-useless-rename": "error",
3815
+ "no-useless-return": "error",
3816
+ "operator-assignment": ["error", "always"],
3800
3817
  "perfectionist/sort-exports": [
3801
3818
  "error",
3802
3819
  {
3803
- type: "alphabetical",
3804
- order: "asc",
3820
+ customGroups: [],
3805
3821
  fallbackSort: { type: "natural" },
3822
+ groups: ["value-export", "type-export"],
3806
3823
  ignoreCase: true,
3807
- specialCharacters: "keep",
3824
+ newlinesBetween: 1,
3825
+ order: "asc",
3808
3826
  partitionByComment: false,
3809
3827
  partitionByNewLine: false,
3810
- newlinesBetween: 1,
3811
- groups: ["value-export", "type-export"],
3812
- customGroups: []
3828
+ specialCharacters: "keep",
3829
+ type: "alphabetical"
3813
3830
  }
3814
3831
  ],
3815
- "@typescript-eslint/no-unused-vars": [
3832
+ "perfectionist/sort-imports": [
3816
3833
  "error",
3817
3834
  {
3818
- argsIgnorePattern: "^_",
3819
- varsIgnorePattern: "^_",
3820
- caughtErrorsIgnorePattern: "^_"
3835
+ groups: ["type", "builtin", "external", "internal", "object"],
3836
+ ignoreCase: true,
3837
+ internalPattern: ["^src/.*"],
3838
+ newlinesBetween: 1,
3839
+ order: "asc",
3840
+ partitionByComment: false,
3841
+ partitionByNewLine: false,
3842
+ specialCharacters: "keep",
3843
+ type: "alphabetical"
3821
3844
  }
3822
3845
  ],
3823
- // Disable regular no-unused-vars rule since that will flag interface declarations. Only use the TypeScript specific rule for this.
3824
- "no-unused-vars": "off",
3825
- "func-style": ["error", "declaration", { allowArrowFunctions: false }],
3826
3846
  "prefer-arrow-callback": ["error", { allowNamedFunctions: false }],
3827
- "arrow-body-style": ["error", "always"],
3828
- curly: ["error", "all"],
3829
- "no-param-reassign": "error",
3830
- "no-useless-rename": "error",
3831
- "sort-vars": "error",
3832
- "no-cond-assign": "error",
3833
- "no-undef": "error",
3834
- "@typescript-eslint/consistent-type-imports": "error",
3847
+ "prefer-const": "error",
3848
+ "prefer-destructuring": "error",
3849
+ "prefer-template": "error",
3835
3850
  "prettier/prettier": ["warn", prettierRules_default],
3836
- "no-restricted-imports": [
3837
- "error",
3838
- {
3839
- patterns: [
3840
- {
3841
- group: ["node_modules"],
3842
- message: "What on Earth are you doing? Leave poor node_modules alone!"
3843
- }
3844
- ]
3845
- }
3846
- ]
3851
+ "sort-vars": "error"
3852
+ },
3853
+ settings: {
3854
+ "import/resolver": {
3855
+ node: true,
3856
+ typescript: true
3857
+ }
3847
3858
  }
3848
3859
  },
3849
3860
  {
3850
3861
  files: ["**/*.test.ts"],
3851
3862
  rules: {
3863
+ "no-restricted-globals": [
3864
+ "error",
3865
+ {
3866
+ message: "Do not use global describe function. Import test functions from vitest instead.",
3867
+ name: "describe"
3868
+ },
3869
+ {
3870
+ message: "Do not use global test function. Import test functions from vitest instead.",
3871
+ name: "test"
3872
+ },
3873
+ {
3874
+ message: "Do not use global expect function. Import test functions from vitest instead.",
3875
+ name: "expect"
3876
+ }
3877
+ ],
3852
3878
  "no-restricted-imports": [
3853
3879
  "error",
3854
3880
  {
3855
3881
  paths: [
3856
3882
  {
3857
- name: "node:test",
3858
- message: "Use test functions from vitest instead."
3883
+ message: "Use test functions from vitest instead.",
3884
+ name: "node:test"
3859
3885
  }
3860
3886
  ]
3861
3887
  }
@@ -3879,30 +3905,30 @@ var import_globals2 = __toESM(require_globals2(), 1);
3879
3905
  var typeScriptReactBase = [
3880
3906
  ...typeScriptBase_default,
3881
3907
  {
3882
- name: "@alextheman/eslint-config-typescript-react-base",
3883
3908
  languageOptions: {
3884
3909
  ecmaVersion: 2020,
3885
3910
  globals: import_globals2.default.browser
3886
3911
  },
3912
+ name: "@alextheman/eslint-config-typescript-react-base",
3887
3913
  plugins: {
3914
+ react: import_eslint_plugin_react.default,
3888
3915
  "react-hooks": import_eslint_plugin_react_hooks.default,
3889
- "react-refresh": import_eslint_plugin_react_refresh.default,
3890
- react: import_eslint_plugin_react.default
3916
+ "react-refresh": import_eslint_plugin_react_refresh.default
3891
3917
  },
3892
3918
  rules: __spreadProps(__spreadValues({}, import_eslint_plugin_react_hooks.default.configs.recommended.rules), {
3893
- "react-refresh/only-export-components": "off",
3894
- "react-hooks/exhaustive-deps": "off",
3895
3919
  "no-restricted-imports": [
3896
3920
  "error",
3897
3921
  {
3898
3922
  paths: [
3899
3923
  {
3900
- regex: "^@mui/[^/]+$",
3901
- message: 'Please use `import Component from "@mui/[package]/Component"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.'
3924
+ message: 'Please use `import Component from "@mui/[package]/Component"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.',
3925
+ regex: "^@mui/[^/]+$"
3902
3926
  }
3903
3927
  ]
3904
3928
  }
3905
- ]
3929
+ ],
3930
+ "react-hooks/exhaustive-deps": "off",
3931
+ "react-refresh/only-export-components": "off"
3906
3932
  })
3907
3933
  }
3908
3934
  ];
@@ -4187,7 +4213,6 @@ var noPluginConfigAccessFromSrcConfigs = createRule_default({
4187
4213
  source: node.object
4188
4214
  }
4189
4215
  });
4190
- return;
4191
4216
  }
4192
4217
  }
4193
4218
  }
package/dist/index.d.cts CHANGED
@@ -3,7 +3,7 @@ import z from 'zod';
3
3
  import { Config } from 'prettier';
4
4
 
5
5
  var name = "@alextheman/eslint-plugin";
6
- var version = "1.13.4";
6
+ var version = "1.13.6";
7
7
 
8
8
  interface AlexPlugin {
9
9
  meta: {
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ import z from 'zod';
3
3
  import { Config } from 'prettier';
4
4
 
5
5
  var name = "@alextheman/eslint-plugin";
6
- var version = "1.13.4";
6
+ var version = "1.13.6";
7
7
 
8
8
  interface AlexPlugin {
9
9
  meta: {
package/dist/index.js CHANGED
@@ -3692,7 +3692,7 @@ var require_globals2 = __commonJS({
3692
3692
 
3693
3693
  // package.json
3694
3694
  var name = "@alextheman/eslint-plugin";
3695
- var version = "1.13.4";
3695
+ var version = "1.13.6";
3696
3696
 
3697
3697
  // src/configs/alexPluginBase.ts
3698
3698
  function createAlexPluginBaseConfig(plugin) {
@@ -3710,9 +3710,9 @@ function createAlexPluginBaseConfig(plugin) {
3710
3710
  {
3711
3711
  files: ["**/*.test.ts"],
3712
3712
  rules: {
3713
+ "@alextheman/consistent-test-function": ["error", { preference: "test" }],
3713
3714
  "@alextheman/no-isolated-tests": "error",
3714
- "@alextheman/no-skipped-tests": "warn",
3715
- "@alextheman/consistent-test-function": ["error", { preference: "test" }]
3715
+ "@alextheman/no-skipped-tests": "warn"
3716
3716
  }
3717
3717
  }
3718
3718
  ];
@@ -3742,106 +3742,132 @@ var typeScriptBase = [
3742
3742
  prettierConfig,
3743
3743
  packageJson.configs.recommended,
3744
3744
  {
3745
- name: "@alextheman/eslint-config-typescript-base",
3746
3745
  files: ["**/*.ts", "**/*.tsx"],
3746
+ ignores: ["dist"],
3747
3747
  languageOptions: {
3748
+ globals: __spreadValues(__spreadValues({}, import_globals.default.node), import_globals.default.browser),
3748
3749
  parser: tsparser,
3749
3750
  parserOptions: {
3750
3751
  ecmaVersion: "latest",
3751
3752
  sourceType: "module"
3752
- },
3753
- globals: __spreadValues(__spreadValues({}, import_globals.default.node), import_globals.default.browser)
3754
- },
3755
- settings: {
3756
- "import/resolver": {
3757
- typescript: true,
3758
- node: true
3759
3753
  }
3760
3754
  },
3761
- ignores: ["dist"],
3755
+ name: "@alextheman/eslint-config-typescript-base",
3762
3756
  plugins: {
3763
3757
  "@typescript-eslint": eslintPlugin,
3764
3758
  import: importPlugin,
3765
- prettier: prettierPlugin,
3766
- perfectionist
3759
+ perfectionist,
3760
+ prettier: prettierPlugin
3767
3761
  },
3768
3762
  rules: {
3769
- "import/no-unresolved": "error",
3763
+ "@typescript-eslint/consistent-type-imports": "error",
3764
+ "@typescript-eslint/no-unused-vars": [
3765
+ "error",
3766
+ {
3767
+ argsIgnorePattern: "^_",
3768
+ caughtErrorsIgnorePattern: "^_",
3769
+ varsIgnorePattern: "^_"
3770
+ }
3771
+ ],
3772
+ "arrow-body-style": ["error", "always"],
3773
+ curly: ["error", "all"],
3774
+ "dot-notation": "error",
3770
3775
  eqeqeq: "error",
3776
+ "func-style": ["error", "declaration", { allowArrowFunctions: false }],
3777
+ "import/no-unresolved": "error",
3778
+ "no-cond-assign": "error",
3771
3779
  "no-console": ["error", { allow: ["warn", "error"] }],
3772
- "perfectionist/sort-imports": [
3780
+ "no-else-return": "error",
3781
+ "no-eval": "error",
3782
+ "no-implicit-coercion": ["error", { allow: ["!!"] }],
3783
+ "no-lonely-if": "error",
3784
+ "no-new-wrappers": "error",
3785
+ "no-param-reassign": "error",
3786
+ "no-restricted-imports": [
3773
3787
  "error",
3774
3788
  {
3775
- type: "alphabetical",
3776
- order: "asc",
3777
- ignoreCase: true,
3778
- partitionByComment: false,
3779
- partitionByNewLine: false,
3780
- specialCharacters: "keep",
3781
- groups: ["type", "builtin", "external", "internal", "object"],
3782
- newlinesBetween: 1,
3783
- internalPattern: ["^src/.*"]
3789
+ patterns: [
3790
+ {
3791
+ group: ["node_modules"],
3792
+ message: "What on Earth are you doing? Leave poor node_modules alone!"
3793
+ }
3794
+ ]
3784
3795
  }
3785
3796
  ],
3797
+ "no-undef": "error",
3798
+ // Disable regular no-unused-vars rule since that will flag interface declarations. Only use the TypeScript specific rule for this.
3799
+ "no-unused-vars": "off",
3800
+ "no-useless-rename": "error",
3801
+ "no-useless-return": "error",
3802
+ "operator-assignment": ["error", "always"],
3786
3803
  "perfectionist/sort-exports": [
3787
3804
  "error",
3788
3805
  {
3789
- type: "alphabetical",
3790
- order: "asc",
3806
+ customGroups: [],
3791
3807
  fallbackSort: { type: "natural" },
3808
+ groups: ["value-export", "type-export"],
3792
3809
  ignoreCase: true,
3793
- specialCharacters: "keep",
3810
+ newlinesBetween: 1,
3811
+ order: "asc",
3794
3812
  partitionByComment: false,
3795
3813
  partitionByNewLine: false,
3796
- newlinesBetween: 1,
3797
- groups: ["value-export", "type-export"],
3798
- customGroups: []
3814
+ specialCharacters: "keep",
3815
+ type: "alphabetical"
3799
3816
  }
3800
3817
  ],
3801
- "@typescript-eslint/no-unused-vars": [
3818
+ "perfectionist/sort-imports": [
3802
3819
  "error",
3803
3820
  {
3804
- argsIgnorePattern: "^_",
3805
- varsIgnorePattern: "^_",
3806
- caughtErrorsIgnorePattern: "^_"
3821
+ groups: ["type", "builtin", "external", "internal", "object"],
3822
+ ignoreCase: true,
3823
+ internalPattern: ["^src/.*"],
3824
+ newlinesBetween: 1,
3825
+ order: "asc",
3826
+ partitionByComment: false,
3827
+ partitionByNewLine: false,
3828
+ specialCharacters: "keep",
3829
+ type: "alphabetical"
3807
3830
  }
3808
3831
  ],
3809
- // Disable regular no-unused-vars rule since that will flag interface declarations. Only use the TypeScript specific rule for this.
3810
- "no-unused-vars": "off",
3811
- "func-style": ["error", "declaration", { allowArrowFunctions: false }],
3812
3832
  "prefer-arrow-callback": ["error", { allowNamedFunctions: false }],
3813
- "arrow-body-style": ["error", "always"],
3814
- curly: ["error", "all"],
3815
- "no-param-reassign": "error",
3816
- "no-useless-rename": "error",
3817
- "sort-vars": "error",
3818
- "no-cond-assign": "error",
3819
- "no-undef": "error",
3820
- "@typescript-eslint/consistent-type-imports": "error",
3833
+ "prefer-const": "error",
3834
+ "prefer-destructuring": "error",
3835
+ "prefer-template": "error",
3821
3836
  "prettier/prettier": ["warn", prettierRules_default],
3822
- "no-restricted-imports": [
3823
- "error",
3824
- {
3825
- patterns: [
3826
- {
3827
- group: ["node_modules"],
3828
- message: "What on Earth are you doing? Leave poor node_modules alone!"
3829
- }
3830
- ]
3831
- }
3832
- ]
3837
+ "sort-vars": "error"
3838
+ },
3839
+ settings: {
3840
+ "import/resolver": {
3841
+ node: true,
3842
+ typescript: true
3843
+ }
3833
3844
  }
3834
3845
  },
3835
3846
  {
3836
3847
  files: ["**/*.test.ts"],
3837
3848
  rules: {
3849
+ "no-restricted-globals": [
3850
+ "error",
3851
+ {
3852
+ message: "Do not use global describe function. Import test functions from vitest instead.",
3853
+ name: "describe"
3854
+ },
3855
+ {
3856
+ message: "Do not use global test function. Import test functions from vitest instead.",
3857
+ name: "test"
3858
+ },
3859
+ {
3860
+ message: "Do not use global expect function. Import test functions from vitest instead.",
3861
+ name: "expect"
3862
+ }
3863
+ ],
3838
3864
  "no-restricted-imports": [
3839
3865
  "error",
3840
3866
  {
3841
3867
  paths: [
3842
3868
  {
3843
- name: "node:test",
3844
- message: "Use test functions from vitest instead."
3869
+ message: "Use test functions from vitest instead.",
3870
+ name: "node:test"
3845
3871
  }
3846
3872
  ]
3847
3873
  }
@@ -3865,30 +3891,30 @@ import reactRefresh from "eslint-plugin-react-refresh";
3865
3891
  var typeScriptReactBase = [
3866
3892
  ...typeScriptBase_default,
3867
3893
  {
3868
- name: "@alextheman/eslint-config-typescript-react-base",
3869
3894
  languageOptions: {
3870
3895
  ecmaVersion: 2020,
3871
3896
  globals: import_globals2.default.browser
3872
3897
  },
3898
+ name: "@alextheman/eslint-config-typescript-react-base",
3873
3899
  plugins: {
3900
+ react: reactPlugin,
3874
3901
  "react-hooks": reactHooks,
3875
- "react-refresh": reactRefresh,
3876
- react: reactPlugin
3902
+ "react-refresh": reactRefresh
3877
3903
  },
3878
3904
  rules: __spreadProps(__spreadValues({}, reactHooks.configs.recommended.rules), {
3879
- "react-refresh/only-export-components": "off",
3880
- "react-hooks/exhaustive-deps": "off",
3881
3905
  "no-restricted-imports": [
3882
3906
  "error",
3883
3907
  {
3884
3908
  paths: [
3885
3909
  {
3886
- regex: "^@mui/[^/]+$",
3887
- message: 'Please use `import Component from "@mui/[package]/Component"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.'
3910
+ message: 'Please use `import Component from "@mui/[package]/Component"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.',
3911
+ regex: "^@mui/[^/]+$"
3888
3912
  }
3889
3913
  ]
3890
3914
  }
3891
- ]
3915
+ ],
3916
+ "react-hooks/exhaustive-deps": "off",
3917
+ "react-refresh/only-export-components": "off"
3892
3918
  })
3893
3919
  }
3894
3920
  ];
@@ -4173,7 +4199,6 @@ var noPluginConfigAccessFromSrcConfigs = createRule_default({
4173
4199
  source: node.object
4174
4200
  }
4175
4201
  });
4176
- return;
4177
4202
  }
4178
4203
  }
4179
4204
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/eslint-plugin",
3
- "version": "1.13.4",
3
+ "version": "1.13.6",
4
4
  "description": "A package to provide custom ESLint rules and configs",
5
5
  "license": "ISC",
6
6
  "author": "alextheman",