@alextheman/eslint-plugin 1.14.2 → 1.15.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 CHANGED
@@ -3715,7 +3715,7 @@ module.exports = __toCommonJS(index_exports);
3715
3715
 
3716
3716
  // package.json
3717
3717
  var name = "@alextheman/eslint-plugin";
3718
- var version = "1.14.2";
3718
+ var version = "1.15.0";
3719
3719
 
3720
3720
  // src/configs/alexPluginBase.ts
3721
3721
  function createAlexPluginBaseConfig(plugin) {
@@ -3742,16 +3742,14 @@ function createAlexPluginBaseConfig(plugin) {
3742
3742
  }
3743
3743
  var alexPluginBase_default = createAlexPluginBaseConfig;
3744
3744
 
3745
- // src/configs/typeScriptBase.ts
3745
+ // src/configs/javaScriptBase.ts
3746
3746
  var import_js = __toESM(require_src(), 1);
3747
- var import_parser = __toESM(require("@typescript-eslint/parser"), 1);
3748
3747
  var import_eslint_config_prettier = __toESM(require("eslint-config-prettier"), 1);
3749
3748
  var import_eslint_plugin_import = __toESM(require("eslint-plugin-import"), 1);
3750
3749
  var import_eslint_plugin_package_json = __toESM(require("eslint-plugin-package-json"), 1);
3751
3750
  var import_eslint_plugin_perfectionist = __toESM(require("eslint-plugin-perfectionist"), 1);
3752
3751
  var import_eslint_plugin_prettier = __toESM(require("eslint-plugin-prettier"), 1);
3753
3752
  var import_globals = __toESM(require_globals2(), 1);
3754
- var import_typescript_eslint = __toESM(require("typescript-eslint"), 1);
3755
3753
 
3756
3754
  // src/configs/prettierRules.ts
3757
3755
  var prettierRules = {
@@ -3759,52 +3757,24 @@ var prettierRules = {
3759
3757
  };
3760
3758
  var prettierRules_default = prettierRules;
3761
3759
 
3762
- // src/configs/typeScriptBase.ts
3763
- var typeScriptBase = [
3764
- ...import_typescript_eslint.default.configs.recommended,
3760
+ // src/configs/javaScriptBase.ts
3761
+ var javaScriptBase = [
3765
3762
  import_js.default.configs.recommended,
3766
3763
  import_eslint_config_prettier.default,
3767
3764
  import_eslint_plugin_package_json.default.configs.recommended,
3768
3765
  {
3769
- files: ["**/*.ts", "**/*.tsx"],
3766
+ files: ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "!package.json"],
3770
3767
  ignores: ["dist"],
3771
3768
  languageOptions: {
3772
- globals: __spreadValues(__spreadValues({}, import_globals.default.node), import_globals.default.browser),
3773
- parser: import_parser.default,
3774
- parserOptions: {
3775
- ecmaVersion: "latest",
3776
- projectService: true,
3777
- sourceType: "module",
3778
- tsconfigRootDir: process.cwd()
3779
- }
3769
+ globals: __spreadValues(__spreadValues({}, import_globals.default.node), import_globals.default.browser)
3780
3770
  },
3781
- name: "@alextheman/eslint-config-typescript-base",
3771
+ name: "@alextheman/eslint-config-javascript-base",
3782
3772
  plugins: {
3783
3773
  import: import_eslint_plugin_import.default,
3784
3774
  perfectionist: import_eslint_plugin_perfectionist.default,
3785
3775
  prettier: import_eslint_plugin_prettier.default
3786
3776
  },
3787
3777
  rules: {
3788
- "@typescript-eslint/array-type": ["error", { default: "array" }],
3789
- "@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as" }],
3790
- "@typescript-eslint/consistent-type-definitions": "error",
3791
- "@typescript-eslint/consistent-type-exports": "error",
3792
- "@typescript-eslint/consistent-type-imports": "error",
3793
- "@typescript-eslint/dot-notation": "error",
3794
- "@typescript-eslint/explicit-member-accessibility": "error",
3795
- "@typescript-eslint/method-signature-style": ["error", "property"],
3796
- "@typescript-eslint/no-deprecated": "warn",
3797
- // Explicit any can be helpful sometimes, so it's not worth erroring on every single one.
3798
- "@typescript-eslint/no-explicit-any": "off",
3799
- "@typescript-eslint/no-redeclare": ["error", { ignoreDeclarationMerge: true }],
3800
- "@typescript-eslint/no-unused-vars": [
3801
- "error",
3802
- {
3803
- argsIgnorePattern: "^_",
3804
- caughtErrorsIgnorePattern: "^_",
3805
- varsIgnorePattern: "^_"
3806
- }
3807
- ],
3808
3778
  "arrow-body-style": ["error", "always"],
3809
3779
  curly: ["error", "all"],
3810
3780
  eqeqeq: "error",
@@ -3818,8 +3788,6 @@ var typeScriptBase = [
3818
3788
  "no-lonely-if": "error",
3819
3789
  "no-new-wrappers": "error",
3820
3790
  "no-param-reassign": "error",
3821
- // Disable regular no-redeclare in favour of TypeScript-specific version since that will flag type redeclarations when we do const MyType = {}; export type MyType = ...
3822
- "no-redeclare": "off",
3823
3791
  "no-restricted-imports": [
3824
3792
  "error",
3825
3793
  {
@@ -3832,8 +3800,14 @@ var typeScriptBase = [
3832
3800
  }
3833
3801
  ],
3834
3802
  "no-undef": "error",
3835
- // Disable regular no-unused-vars rule since that will flag interface declarations. Only use the TypeScript specific rule for this.
3836
- "no-unused-vars": "off",
3803
+ "no-unused-vars": [
3804
+ "error",
3805
+ {
3806
+ argsIgnorePattern: "^_",
3807
+ caughtErrorsIgnorePattern: "^_",
3808
+ varsIgnorePattern: "^_"
3809
+ }
3810
+ ],
3837
3811
  "no-useless-rename": "error",
3838
3812
  "no-useless-return": "error",
3839
3813
  "operator-assignment": ["error", "always"],
@@ -3875,13 +3849,12 @@ var typeScriptBase = [
3875
3849
  },
3876
3850
  settings: {
3877
3851
  "import/resolver": {
3878
- node: true,
3879
- typescript: true
3852
+ node: true
3880
3853
  }
3881
3854
  }
3882
3855
  },
3883
3856
  {
3884
- files: ["**/*.test.ts"],
3857
+ files: ["**/*.test.{js,ts}"],
3885
3858
  rules: {
3886
3859
  "no-restricted-globals": [
3887
3860
  "error",
@@ -3912,21 +3885,20 @@ var typeScriptBase = [
3912
3885
  }
3913
3886
  }
3914
3887
  ];
3915
- var typeScriptBase_default = typeScriptBase;
3888
+ var javaScriptBase_default = javaScriptBase;
3916
3889
 
3917
- // src/configs/alexTypeScriptBase.ts
3918
- function createAlexTypeScriptBaseConfig(plugin) {
3919
- return [...alexPluginBase_default(plugin), ...typeScriptBase_default];
3890
+ // src/configs/alexJavaScriptBase.ts
3891
+ function createAlexJavaScriptBaseConfig(plugin) {
3892
+ return [...alexPluginBase_default(plugin), ...javaScriptBase_default];
3920
3893
  }
3921
- var alexTypeScriptBase_default = createAlexTypeScriptBaseConfig;
3894
+ var alexJavaScriptBase_default = createAlexJavaScriptBaseConfig;
3922
3895
 
3923
- // src/configs/typeScriptReactBase.ts
3896
+ // src/configs/reactBase.ts
3924
3897
  var import_eslint_plugin_react = __toESM(require("eslint-plugin-react"), 1);
3925
3898
  var import_eslint_plugin_react_hooks = __toESM(require("eslint-plugin-react-hooks"), 1);
3926
3899
  var import_eslint_plugin_react_refresh = __toESM(require("eslint-plugin-react-refresh"), 1);
3927
3900
  var import_globals2 = __toESM(require_globals2(), 1);
3928
- var typeScriptReactBase = [
3929
- ...typeScriptBase_default,
3901
+ var reactBase = [
3930
3902
  {
3931
3903
  languageOptions: {
3932
3904
  ecmaVersion: 2020,
@@ -3955,14 +3927,119 @@ var typeScriptReactBase = [
3955
3927
  })
3956
3928
  }
3957
3929
  ];
3958
- var typeScriptReactBase_default = typeScriptReactBase;
3930
+ var reactBase_default = reactBase;
3931
+
3932
+ // src/configs/alexReactBase.ts
3933
+ function createAlexReactBaseConfig(plugin) {
3934
+ return [...alexPluginBase_default(plugin), ...reactBase_default];
3935
+ }
3936
+ var alexReactBase_default = createAlexReactBaseConfig;
3937
+
3938
+ // src/configs/typeScriptBase.ts
3939
+ var import_parser = __toESM(require("@typescript-eslint/parser"), 1);
3940
+ var import_typescript_eslint = __toESM(require("typescript-eslint"), 1);
3941
+ var typeScriptBase = [
3942
+ ...import_typescript_eslint.default.configs.recommended,
3943
+ ...javaScriptBase_default,
3944
+ {
3945
+ files: ["**/*.ts", "**/*.tsx"],
3946
+ languageOptions: {
3947
+ parser: import_parser.default,
3948
+ parserOptions: {
3949
+ ecmaVersion: "latest",
3950
+ projectService: true,
3951
+ sourceType: "module",
3952
+ tsconfigRootDir: process.cwd()
3953
+ }
3954
+ },
3955
+ name: "@alextheman/eslint-config-typescript-base",
3956
+ rules: {
3957
+ "@typescript-eslint/array-type": ["error", { default: "array" }],
3958
+ "@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as" }],
3959
+ "@typescript-eslint/consistent-type-definitions": "error",
3960
+ "@typescript-eslint/consistent-type-exports": "error",
3961
+ "@typescript-eslint/consistent-type-imports": "error",
3962
+ "@typescript-eslint/dot-notation": "error",
3963
+ "@typescript-eslint/explicit-member-accessibility": "error",
3964
+ "@typescript-eslint/method-signature-style": ["error", "property"],
3965
+ "@typescript-eslint/no-deprecated": "warn",
3966
+ // Explicit any can be helpful sometimes, so it's not worth erroring on every single one.
3967
+ "@typescript-eslint/no-explicit-any": "off",
3968
+ "@typescript-eslint/no-redeclare": ["error", { ignoreDeclarationMerge: true }],
3969
+ "@typescript-eslint/no-unused-vars": [
3970
+ "error",
3971
+ {
3972
+ argsIgnorePattern: "^_",
3973
+ caughtErrorsIgnorePattern: "^_",
3974
+ varsIgnorePattern: "^_"
3975
+ }
3976
+ ],
3977
+ // Disable regular no-redeclare in favour of TypeScript-specific version since that will flag type redeclarations when we do const MyType = {}; export type MyType = ...
3978
+ "no-redeclare": "off",
3979
+ // Disable no-undef because undefined variables tend to be better caught by the TypeScript compiler.
3980
+ "no-undef": "off",
3981
+ // Disable regular no-unused-vars rule since that will flag interface declarations. Only use the TypeScript specific rule for this.
3982
+ "no-unused-vars": "off"
3983
+ },
3984
+ settings: {
3985
+ "import/resolver": {
3986
+ node: true,
3987
+ typescript: true
3988
+ }
3989
+ }
3990
+ }
3991
+ ];
3992
+ var typeScriptBase_default = typeScriptBase;
3993
+
3994
+ // src/configs/alexTypeScriptBase.ts
3995
+ function createAlexTypeScriptBaseConfig(plugin) {
3996
+ return [...alexPluginBase_default(plugin), ...typeScriptBase_default];
3997
+ }
3998
+ var alexTypeScriptBase_default = createAlexTypeScriptBaseConfig;
3959
3999
 
3960
4000
  // src/configs/alexTypeScriptReactBase.ts
3961
4001
  function createAlexTypeScriptReactBaseConfig(plugin) {
3962
- return [...alexTypeScriptBase_default(plugin), ...typeScriptReactBase_default];
4002
+ return [...alexTypeScriptBase_default(plugin), ...reactBase_default];
3963
4003
  }
3964
4004
  var alexTypeScriptReactBase_default = createAlexTypeScriptReactBaseConfig;
3965
4005
 
4006
+ // src/configs/typeScriptReactBase.ts
4007
+ var import_eslint_plugin_react2 = __toESM(require("eslint-plugin-react"), 1);
4008
+ var import_eslint_plugin_react_hooks2 = __toESM(require("eslint-plugin-react-hooks"), 1);
4009
+ var import_eslint_plugin_react_refresh2 = __toESM(require("eslint-plugin-react-refresh"), 1);
4010
+ var import_globals3 = __toESM(require_globals2(), 1);
4011
+ var typeScriptReactBase = [
4012
+ ...typeScriptBase_default,
4013
+ {
4014
+ languageOptions: {
4015
+ ecmaVersion: 2020,
4016
+ globals: import_globals3.default.browser
4017
+ },
4018
+ name: "@alextheman/eslint-config-typescript-react-base",
4019
+ plugins: {
4020
+ react: import_eslint_plugin_react2.default,
4021
+ "react-hooks": import_eslint_plugin_react_hooks2.default,
4022
+ "react-refresh": import_eslint_plugin_react_refresh2.default
4023
+ },
4024
+ rules: __spreadProps(__spreadValues({}, import_eslint_plugin_react_hooks2.default.configs.recommended.rules), {
4025
+ "no-restricted-imports": [
4026
+ "error",
4027
+ {
4028
+ patterns: [
4029
+ {
4030
+ message: 'Please use `import Component from "@mui/[package]/Component"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.',
4031
+ regex: "^@mui/[^/]+$"
4032
+ }
4033
+ ]
4034
+ }
4035
+ ],
4036
+ "react-hooks/exhaustive-deps": "off",
4037
+ "react-refresh/only-export-components": "off"
4038
+ })
4039
+ }
4040
+ ];
4041
+ var typeScriptReactBase_default = typeScriptReactBase;
4042
+
3966
4043
  // src/rules/consistent-test-function.ts
3967
4044
  var import_utils2 = require("@typescript-eslint/utils");
3968
4045
  var import_zod = __toESM(require("zod"), 1);
@@ -4441,19 +4518,28 @@ var alexPlugin = {
4441
4518
  },
4442
4519
  configs: {
4443
4520
  alexPluginBase: [],
4521
+ alexJavaScriptBase: [],
4444
4522
  alexTypeScriptBase: [],
4445
4523
  alexTypeScriptReactBase: [],
4524
+ alexReactBase: [],
4525
+ javaScriptBase: [],
4446
4526
  typeScriptBase: [],
4447
- typeScriptReactBase: []
4527
+ typeScriptReactBase: [],
4528
+ reactBase: []
4448
4529
  },
4449
4530
  rules: rules_default
4450
4531
  };
4451
4532
  alexPlugin.configs = {
4452
4533
  alexPluginBase: alexPluginBase_default(alexPlugin),
4534
+ alexJavaScriptBase: alexJavaScriptBase_default(alexPlugin),
4453
4535
  alexTypeScriptBase: alexTypeScriptBase_default(alexPlugin),
4536
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
4454
4537
  alexTypeScriptReactBase: alexTypeScriptReactBase_default(alexPlugin),
4538
+ alexReactBase: alexReactBase_default(alexPlugin),
4539
+ javaScriptBase: javaScriptBase_default,
4455
4540
  typeScriptBase: typeScriptBase_default,
4456
- typeScriptReactBase: typeScriptReactBase_default
4541
+ typeScriptReactBase: typeScriptReactBase_default,
4542
+ reactBase: reactBase_default
4457
4543
  };
4458
4544
  var alexPlugin_default = alexPlugin;
4459
4545
 
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.14.2";
6
+ var version = "1.15.0";
7
7
 
8
8
  interface AlexPlugin {
9
9
  meta: {
@@ -13,10 +13,14 @@ interface AlexPlugin {
13
13
  };
14
14
  configs: {
15
15
  alexPluginBase: Linter.Config[];
16
+ alexJavaScriptBase: Linter.Config[];
16
17
  alexTypeScriptBase: Linter.Config[];
17
18
  alexTypeScriptReactBase: Linter.Config[];
19
+ alexReactBase: Linter.Config[];
20
+ javaScriptBase: Linter.Config[];
18
21
  typeScriptBase: Linter.Config[];
19
22
  typeScriptReactBase: Linter.Config[];
23
+ reactBase: Linter.Config[];
20
24
  };
21
25
  rules: Record<string, any>;
22
26
  }
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.14.2";
6
+ var version = "1.15.0";
7
7
 
8
8
  interface AlexPlugin {
9
9
  meta: {
@@ -13,10 +13,14 @@ interface AlexPlugin {
13
13
  };
14
14
  configs: {
15
15
  alexPluginBase: Linter.Config[];
16
+ alexJavaScriptBase: Linter.Config[];
16
17
  alexTypeScriptBase: Linter.Config[];
17
18
  alexTypeScriptReactBase: Linter.Config[];
19
+ alexReactBase: Linter.Config[];
20
+ javaScriptBase: Linter.Config[];
18
21
  typeScriptBase: Linter.Config[];
19
22
  typeScriptReactBase: Linter.Config[];
23
+ reactBase: Linter.Config[];
20
24
  };
21
25
  rules: Record<string, any>;
22
26
  }
package/dist/index.js CHANGED
@@ -3700,7 +3700,7 @@ var require_globals2 = __commonJS({
3700
3700
 
3701
3701
  // package.json
3702
3702
  var name = "@alextheman/eslint-plugin";
3703
- var version = "1.14.2";
3703
+ var version = "1.15.0";
3704
3704
 
3705
3705
  // src/configs/alexPluginBase.ts
3706
3706
  function createAlexPluginBaseConfig(plugin) {
@@ -3727,16 +3727,14 @@ function createAlexPluginBaseConfig(plugin) {
3727
3727
  }
3728
3728
  var alexPluginBase_default = createAlexPluginBaseConfig;
3729
3729
 
3730
- // src/configs/typeScriptBase.ts
3730
+ // src/configs/javaScriptBase.ts
3731
3731
  var import_js = __toESM(require_src(), 1);
3732
3732
  var import_globals = __toESM(require_globals2(), 1);
3733
- import tsparser from "@typescript-eslint/parser";
3734
3733
  import prettierConfig from "eslint-config-prettier";
3735
3734
  import importPlugin from "eslint-plugin-import";
3736
3735
  import packageJson from "eslint-plugin-package-json";
3737
3736
  import perfectionist from "eslint-plugin-perfectionist";
3738
3737
  import prettierPlugin from "eslint-plugin-prettier";
3739
- import tseslint from "typescript-eslint";
3740
3738
 
3741
3739
  // src/configs/prettierRules.ts
3742
3740
  var prettierRules = {
@@ -3744,52 +3742,24 @@ var prettierRules = {
3744
3742
  };
3745
3743
  var prettierRules_default = prettierRules;
3746
3744
 
3747
- // src/configs/typeScriptBase.ts
3748
- var typeScriptBase = [
3749
- ...tseslint.configs.recommended,
3745
+ // src/configs/javaScriptBase.ts
3746
+ var javaScriptBase = [
3750
3747
  import_js.default.configs.recommended,
3751
3748
  prettierConfig,
3752
3749
  packageJson.configs.recommended,
3753
3750
  {
3754
- files: ["**/*.ts", "**/*.tsx"],
3751
+ files: ["**/*.js", "**/*.jsx", "**/*.ts", "**/*.tsx", "!package.json"],
3755
3752
  ignores: ["dist"],
3756
3753
  languageOptions: {
3757
- globals: __spreadValues(__spreadValues({}, import_globals.default.node), import_globals.default.browser),
3758
- parser: tsparser,
3759
- parserOptions: {
3760
- ecmaVersion: "latest",
3761
- projectService: true,
3762
- sourceType: "module",
3763
- tsconfigRootDir: process.cwd()
3764
- }
3754
+ globals: __spreadValues(__spreadValues({}, import_globals.default.node), import_globals.default.browser)
3765
3755
  },
3766
- name: "@alextheman/eslint-config-typescript-base",
3756
+ name: "@alextheman/eslint-config-javascript-base",
3767
3757
  plugins: {
3768
3758
  import: importPlugin,
3769
3759
  perfectionist,
3770
3760
  prettier: prettierPlugin
3771
3761
  },
3772
3762
  rules: {
3773
- "@typescript-eslint/array-type": ["error", { default: "array" }],
3774
- "@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as" }],
3775
- "@typescript-eslint/consistent-type-definitions": "error",
3776
- "@typescript-eslint/consistent-type-exports": "error",
3777
- "@typescript-eslint/consistent-type-imports": "error",
3778
- "@typescript-eslint/dot-notation": "error",
3779
- "@typescript-eslint/explicit-member-accessibility": "error",
3780
- "@typescript-eslint/method-signature-style": ["error", "property"],
3781
- "@typescript-eslint/no-deprecated": "warn",
3782
- // Explicit any can be helpful sometimes, so it's not worth erroring on every single one.
3783
- "@typescript-eslint/no-explicit-any": "off",
3784
- "@typescript-eslint/no-redeclare": ["error", { ignoreDeclarationMerge: true }],
3785
- "@typescript-eslint/no-unused-vars": [
3786
- "error",
3787
- {
3788
- argsIgnorePattern: "^_",
3789
- caughtErrorsIgnorePattern: "^_",
3790
- varsIgnorePattern: "^_"
3791
- }
3792
- ],
3793
3763
  "arrow-body-style": ["error", "always"],
3794
3764
  curly: ["error", "all"],
3795
3765
  eqeqeq: "error",
@@ -3803,8 +3773,6 @@ var typeScriptBase = [
3803
3773
  "no-lonely-if": "error",
3804
3774
  "no-new-wrappers": "error",
3805
3775
  "no-param-reassign": "error",
3806
- // Disable regular no-redeclare in favour of TypeScript-specific version since that will flag type redeclarations when we do const MyType = {}; export type MyType = ...
3807
- "no-redeclare": "off",
3808
3776
  "no-restricted-imports": [
3809
3777
  "error",
3810
3778
  {
@@ -3817,8 +3785,14 @@ var typeScriptBase = [
3817
3785
  }
3818
3786
  ],
3819
3787
  "no-undef": "error",
3820
- // Disable regular no-unused-vars rule since that will flag interface declarations. Only use the TypeScript specific rule for this.
3821
- "no-unused-vars": "off",
3788
+ "no-unused-vars": [
3789
+ "error",
3790
+ {
3791
+ argsIgnorePattern: "^_",
3792
+ caughtErrorsIgnorePattern: "^_",
3793
+ varsIgnorePattern: "^_"
3794
+ }
3795
+ ],
3822
3796
  "no-useless-rename": "error",
3823
3797
  "no-useless-return": "error",
3824
3798
  "operator-assignment": ["error", "always"],
@@ -3860,13 +3834,12 @@ var typeScriptBase = [
3860
3834
  },
3861
3835
  settings: {
3862
3836
  "import/resolver": {
3863
- node: true,
3864
- typescript: true
3837
+ node: true
3865
3838
  }
3866
3839
  }
3867
3840
  },
3868
3841
  {
3869
- files: ["**/*.test.ts"],
3842
+ files: ["**/*.test.{js,ts}"],
3870
3843
  rules: {
3871
3844
  "no-restricted-globals": [
3872
3845
  "error",
@@ -3897,21 +3870,20 @@ var typeScriptBase = [
3897
3870
  }
3898
3871
  }
3899
3872
  ];
3900
- var typeScriptBase_default = typeScriptBase;
3873
+ var javaScriptBase_default = javaScriptBase;
3901
3874
 
3902
- // src/configs/alexTypeScriptBase.ts
3903
- function createAlexTypeScriptBaseConfig(plugin) {
3904
- return [...alexPluginBase_default(plugin), ...typeScriptBase_default];
3875
+ // src/configs/alexJavaScriptBase.ts
3876
+ function createAlexJavaScriptBaseConfig(plugin) {
3877
+ return [...alexPluginBase_default(plugin), ...javaScriptBase_default];
3905
3878
  }
3906
- var alexTypeScriptBase_default = createAlexTypeScriptBaseConfig;
3879
+ var alexJavaScriptBase_default = createAlexJavaScriptBaseConfig;
3907
3880
 
3908
- // src/configs/typeScriptReactBase.ts
3881
+ // src/configs/reactBase.ts
3909
3882
  var import_globals2 = __toESM(require_globals2(), 1);
3910
3883
  import reactPlugin from "eslint-plugin-react";
3911
3884
  import reactHooks from "eslint-plugin-react-hooks";
3912
3885
  import reactRefresh from "eslint-plugin-react-refresh";
3913
- var typeScriptReactBase = [
3914
- ...typeScriptBase_default,
3886
+ var reactBase = [
3915
3887
  {
3916
3888
  languageOptions: {
3917
3889
  ecmaVersion: 2020,
@@ -3940,14 +3912,119 @@ var typeScriptReactBase = [
3940
3912
  })
3941
3913
  }
3942
3914
  ];
3943
- var typeScriptReactBase_default = typeScriptReactBase;
3915
+ var reactBase_default = reactBase;
3916
+
3917
+ // src/configs/alexReactBase.ts
3918
+ function createAlexReactBaseConfig(plugin) {
3919
+ return [...alexPluginBase_default(plugin), ...reactBase_default];
3920
+ }
3921
+ var alexReactBase_default = createAlexReactBaseConfig;
3922
+
3923
+ // src/configs/typeScriptBase.ts
3924
+ import tsparser from "@typescript-eslint/parser";
3925
+ import tseslint from "typescript-eslint";
3926
+ var typeScriptBase = [
3927
+ ...tseslint.configs.recommended,
3928
+ ...javaScriptBase_default,
3929
+ {
3930
+ files: ["**/*.ts", "**/*.tsx"],
3931
+ languageOptions: {
3932
+ parser: tsparser,
3933
+ parserOptions: {
3934
+ ecmaVersion: "latest",
3935
+ projectService: true,
3936
+ sourceType: "module",
3937
+ tsconfigRootDir: process.cwd()
3938
+ }
3939
+ },
3940
+ name: "@alextheman/eslint-config-typescript-base",
3941
+ rules: {
3942
+ "@typescript-eslint/array-type": ["error", { default: "array" }],
3943
+ "@typescript-eslint/consistent-type-assertions": ["error", { assertionStyle: "as" }],
3944
+ "@typescript-eslint/consistent-type-definitions": "error",
3945
+ "@typescript-eslint/consistent-type-exports": "error",
3946
+ "@typescript-eslint/consistent-type-imports": "error",
3947
+ "@typescript-eslint/dot-notation": "error",
3948
+ "@typescript-eslint/explicit-member-accessibility": "error",
3949
+ "@typescript-eslint/method-signature-style": ["error", "property"],
3950
+ "@typescript-eslint/no-deprecated": "warn",
3951
+ // Explicit any can be helpful sometimes, so it's not worth erroring on every single one.
3952
+ "@typescript-eslint/no-explicit-any": "off",
3953
+ "@typescript-eslint/no-redeclare": ["error", { ignoreDeclarationMerge: true }],
3954
+ "@typescript-eslint/no-unused-vars": [
3955
+ "error",
3956
+ {
3957
+ argsIgnorePattern: "^_",
3958
+ caughtErrorsIgnorePattern: "^_",
3959
+ varsIgnorePattern: "^_"
3960
+ }
3961
+ ],
3962
+ // Disable regular no-redeclare in favour of TypeScript-specific version since that will flag type redeclarations when we do const MyType = {}; export type MyType = ...
3963
+ "no-redeclare": "off",
3964
+ // Disable no-undef because undefined variables tend to be better caught by the TypeScript compiler.
3965
+ "no-undef": "off",
3966
+ // Disable regular no-unused-vars rule since that will flag interface declarations. Only use the TypeScript specific rule for this.
3967
+ "no-unused-vars": "off"
3968
+ },
3969
+ settings: {
3970
+ "import/resolver": {
3971
+ node: true,
3972
+ typescript: true
3973
+ }
3974
+ }
3975
+ }
3976
+ ];
3977
+ var typeScriptBase_default = typeScriptBase;
3978
+
3979
+ // src/configs/alexTypeScriptBase.ts
3980
+ function createAlexTypeScriptBaseConfig(plugin) {
3981
+ return [...alexPluginBase_default(plugin), ...typeScriptBase_default];
3982
+ }
3983
+ var alexTypeScriptBase_default = createAlexTypeScriptBaseConfig;
3944
3984
 
3945
3985
  // src/configs/alexTypeScriptReactBase.ts
3946
3986
  function createAlexTypeScriptReactBaseConfig(plugin) {
3947
- return [...alexTypeScriptBase_default(plugin), ...typeScriptReactBase_default];
3987
+ return [...alexTypeScriptBase_default(plugin), ...reactBase_default];
3948
3988
  }
3949
3989
  var alexTypeScriptReactBase_default = createAlexTypeScriptReactBaseConfig;
3950
3990
 
3991
+ // src/configs/typeScriptReactBase.ts
3992
+ var import_globals3 = __toESM(require_globals2(), 1);
3993
+ import reactPlugin2 from "eslint-plugin-react";
3994
+ import reactHooks2 from "eslint-plugin-react-hooks";
3995
+ import reactRefresh2 from "eslint-plugin-react-refresh";
3996
+ var typeScriptReactBase = [
3997
+ ...typeScriptBase_default,
3998
+ {
3999
+ languageOptions: {
4000
+ ecmaVersion: 2020,
4001
+ globals: import_globals3.default.browser
4002
+ },
4003
+ name: "@alextheman/eslint-config-typescript-react-base",
4004
+ plugins: {
4005
+ react: reactPlugin2,
4006
+ "react-hooks": reactHooks2,
4007
+ "react-refresh": reactRefresh2
4008
+ },
4009
+ rules: __spreadProps(__spreadValues({}, reactHooks2.configs.recommended.rules), {
4010
+ "no-restricted-imports": [
4011
+ "error",
4012
+ {
4013
+ patterns: [
4014
+ {
4015
+ message: 'Please use `import Component from "@mui/[package]/Component"` instead. See https://mui.com/material-ui/guides/minimizing-bundle-size/ for more information.',
4016
+ regex: "^@mui/[^/]+$"
4017
+ }
4018
+ ]
4019
+ }
4020
+ ],
4021
+ "react-hooks/exhaustive-deps": "off",
4022
+ "react-refresh/only-export-components": "off"
4023
+ })
4024
+ }
4025
+ ];
4026
+ var typeScriptReactBase_default = typeScriptReactBase;
4027
+
3951
4028
  // src/rules/consistent-test-function.ts
3952
4029
  import { AST_NODE_TYPES } from "@typescript-eslint/utils";
3953
4030
  import z from "zod";
@@ -4426,19 +4503,28 @@ var alexPlugin = {
4426
4503
  },
4427
4504
  configs: {
4428
4505
  alexPluginBase: [],
4506
+ alexJavaScriptBase: [],
4429
4507
  alexTypeScriptBase: [],
4430
4508
  alexTypeScriptReactBase: [],
4509
+ alexReactBase: [],
4510
+ javaScriptBase: [],
4431
4511
  typeScriptBase: [],
4432
- typeScriptReactBase: []
4512
+ typeScriptReactBase: [],
4513
+ reactBase: []
4433
4514
  },
4434
4515
  rules: rules_default
4435
4516
  };
4436
4517
  alexPlugin.configs = {
4437
4518
  alexPluginBase: alexPluginBase_default(alexPlugin),
4519
+ alexJavaScriptBase: alexJavaScriptBase_default(alexPlugin),
4438
4520
  alexTypeScriptBase: alexTypeScriptBase_default(alexPlugin),
4521
+ // eslint-disable-next-line @typescript-eslint/no-deprecated
4439
4522
  alexTypeScriptReactBase: alexTypeScriptReactBase_default(alexPlugin),
4523
+ alexReactBase: alexReactBase_default(alexPlugin),
4524
+ javaScriptBase: javaScriptBase_default,
4440
4525
  typeScriptBase: typeScriptBase_default,
4441
- typeScriptReactBase: typeScriptReactBase_default
4526
+ typeScriptReactBase: typeScriptReactBase_default,
4527
+ reactBase: reactBase_default
4442
4528
  };
4443
4529
  var alexPlugin_default = alexPlugin;
4444
4530
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/eslint-plugin",
3
- "version": "1.14.2",
3
+ "version": "1.15.0",
4
4
  "description": "A package to provide custom ESLint rules and configs",
5
5
  "license": "ISC",
6
6
  "author": "alextheman",
@@ -16,8 +16,17 @@
16
16
  "change-minor": "npm version minor -m \"Change version number to v%s\"",
17
17
  "change-patch": "npm version patch -m \"Change version number to v%s\"",
18
18
  "create-local-package": "npm run build && rm -f alextheman-eslint-plugin-*.tgz && npm pack",
19
- "format": "npm run build && prettier --write --parser typescript \"src/**/*.ts\" \"tests/**/*.ts\" && eslint --fix --suppress-all \"src/**/*.ts\" \"tests/**/*.ts\" \"package.json\" && rm -f eslint-suppressions.json",
20
- "lint": "npm run build && tsc --noEmit && eslint \"src/**/*.ts\" \"tests/**/*.ts\" \"package.json\" && prettier --check --parser typescript \"src/**/*.ts\" \"tests/**/*.ts\"",
19
+ "format": "npm run build && npm run format-prettier && npm run format-eslint",
20
+ "format-eslint": "eslint --fix --suppress-all \"src/**/*.ts\" \"tests/**/*.ts\" \"package.json\" && rm -f eslint-suppressions.json",
21
+ "format-prettier": "npm run format-prettier-typescript && npm run format-prettier-javascript",
22
+ "format-prettier-javascript": "prettier --write \"./**/*.js\"",
23
+ "format-prettier-typescript": "prettier --write --parser typescript \"./**/*.ts\"",
24
+ "lint": "npm run build && npm run lint-tsc && npm run lint-eslint && npm run lint-prettier",
25
+ "lint-eslint": "eslint \"src/**/*.ts\" \"tests/**/*.ts\" \"package.json\"",
26
+ "lint-prettier": "npm run lint-prettier-typescript && npm run lint-prettier-javascript",
27
+ "lint-prettier-javascript": "prettier --check \"./**/*.js\"",
28
+ "lint-prettier-typescript": "prettier --check --parser typescript \"./**/*.ts\"",
29
+ "lint-tsc": "tsc --noEmit",
21
30
  "prepare": "husky",
22
31
  "test": "vitest run",
23
32
  "test-watch": "vitest",
@@ -25,22 +34,22 @@
25
34
  },
26
35
  "dependencies": {
27
36
  "common-tags": "^1.8.2",
28
- "eslint-plugin-package-json": "^0.56.3",
29
- "zod": "^4.1.9"
37
+ "eslint-plugin-package-json": "^0.57.0",
38
+ "zod": "^4.1.12"
30
39
  },
31
40
  "devDependencies": {
32
41
  "@types/common-tags": "^1.8.4",
33
42
  "@types/eslint": "^9.6.1",
34
- "@types/node": "^24.5.2",
35
- "@typescript-eslint/rule-tester": "^8.44.0",
36
- "@typescript-eslint/utils": "^8.44.0",
43
+ "@types/node": "^24.8.1",
44
+ "@typescript-eslint/rule-tester": "^8.46.1",
45
+ "@typescript-eslint/utils": "^8.46.1",
37
46
  "eslint-plugin-eslint-plugin": "^7.0.0",
38
47
  "globals": "^16.4.0",
39
48
  "husky": "^9.1.7",
40
- "jiti": "^2.5.1",
49
+ "jiti": "^2.6.1",
41
50
  "prettier": "^3.6.2",
42
51
  "tsup": "^8.5.0",
43
- "typescript": "^5.9.2",
52
+ "typescript": "^5.9.3",
44
53
  "vite-tsconfig-paths": "^5.1.4",
45
54
  "vitest": "^3.2.4"
46
55
  },