@alextheman/eslint-plugin 2.0.0 → 2.1.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 = "2.0.0";
3718
+ var version = "2.1.0";
3719
3719
 
3720
3720
  // src/configs/general/javaScriptBase.ts
3721
3721
  var import_js = __toESM(require_src(), 1);
@@ -3868,16 +3868,46 @@ var javaScriptBase = [
3868
3868
  ];
3869
3869
  var javaScriptBase_default = javaScriptBase;
3870
3870
 
3871
+ // src/configs/plugin/pluginBase.ts
3872
+ function createPluginBaseConfig(plugin) {
3873
+ return [
3874
+ {
3875
+ plugins: {
3876
+ "@alextheman": plugin
3877
+ },
3878
+ rules: {
3879
+ "@alextheman/no-namespace-imports": "error",
3880
+ "@alextheman/no-relative-imports": "error",
3881
+ "@alextheman/use-object-shorthand": "error"
3882
+ }
3883
+ }
3884
+ ];
3885
+ }
3886
+ var pluginBase_default = createPluginBaseConfig;
3887
+
3888
+ // src/configs/combined/javaScriptBase.ts
3889
+ function createCombinedJavaScriptBaseConfig(plugin) {
3890
+ return [...pluginBase_default(plugin), ...javaScriptBase_default];
3891
+ }
3892
+ var javaScriptBase_default2 = createCombinedJavaScriptBaseConfig;
3893
+
3871
3894
  // src/configs/general/reactBase.ts
3872
3895
  var import_eslint_plugin_react = __toESM(require("eslint-plugin-react"), 1);
3873
3896
  var import_eslint_plugin_react_hooks = __toESM(require("eslint-plugin-react-hooks"), 1);
3874
3897
  var import_eslint_plugin_react_refresh = __toESM(require("eslint-plugin-react-refresh"), 1);
3875
3898
  var import_globals2 = __toESM(require_globals2(), 1);
3876
3899
  var reactBase = [
3900
+ import_eslint_plugin_react.default.configs.flat.recommended,
3901
+ import_eslint_plugin_react.default.configs.flat["jsx-runtime"],
3877
3902
  {
3878
3903
  languageOptions: {
3879
3904
  ecmaVersion: 2020,
3880
- globals: import_globals2.default.browser
3905
+ globals: import_globals2.default.browser,
3906
+ parserOptions: {
3907
+ ecmaFeatures: {
3908
+ jsx: true
3909
+ }
3910
+ }
3881
3911
  },
3882
3912
  name: "@alextheman/eslint-config-react-base",
3883
3913
  plugins: {
@@ -3885,7 +3915,7 @@ var reactBase = [
3885
3915
  "react-hooks": import_eslint_plugin_react_hooks.default,
3886
3916
  "react-refresh": import_eslint_plugin_react_refresh.default
3887
3917
  },
3888
- rules: __spreadProps(__spreadValues(__spreadValues({}, import_eslint_plugin_react_hooks.default.configs.recommended.rules), import_eslint_plugin_react.default.configs.recommended.rules), {
3918
+ rules: __spreadProps(__spreadValues({}, import_eslint_plugin_react_hooks.default.configs.recommended.rules), {
3889
3919
  "no-restricted-imports": [
3890
3920
  "error",
3891
3921
  {
@@ -3899,11 +3929,46 @@ var reactBase = [
3899
3929
  ],
3900
3930
  "react-hooks/exhaustive-deps": "off",
3901
3931
  "react-refresh/only-export-components": "off"
3902
- })
3932
+ }),
3933
+ settings: {
3934
+ react: {
3935
+ version: "detect"
3936
+ }
3937
+ }
3903
3938
  }
3904
3939
  ];
3905
3940
  var reactBase_default = reactBase;
3906
3941
 
3942
+ // src/configs/combined/reactBase.ts
3943
+ function createCombinedReactBaseConfig(plugin) {
3944
+ return [...pluginBase_default(plugin), ...reactBase_default];
3945
+ }
3946
+ var reactBase_default2 = createCombinedReactBaseConfig;
3947
+
3948
+ // src/configs/plugin/testsBase.ts
3949
+ function createPluginTestsBaseConfig(plugin) {
3950
+ return [
3951
+ {
3952
+ files: ["**/*.test.ts"],
3953
+ plugins: {
3954
+ "@alextheman": plugin
3955
+ },
3956
+ rules: {
3957
+ "@alextheman/consistent-test-function": ["error", { preference: "test" }],
3958
+ "@alextheman/no-isolated-tests": "error",
3959
+ "@alextheman/no-skipped-tests": "warn"
3960
+ }
3961
+ }
3962
+ ];
3963
+ }
3964
+ var testsBase_default2 = createPluginTestsBaseConfig;
3965
+
3966
+ // src/configs/combined/testsBase.ts
3967
+ function createCombinedTestsBaseConfig(plugin) {
3968
+ return [...pluginBase_default(plugin), ...testsBase_default];
3969
+ }
3970
+ var testsBase_default3 = createCombinedTestsBaseConfig;
3971
+
3907
3972
  // src/configs/general/typeScriptBase.ts
3908
3973
  var import_parser = __toESM(require("@typescript-eslint/parser"), 1);
3909
3974
  var import_typescript_eslint = __toESM(require("typescript-eslint"), 1);
@@ -3960,65 +4025,24 @@ var typeScriptBase = [
3960
4025
  ];
3961
4026
  var typeScriptBase_default = typeScriptBase;
3962
4027
 
3963
- // src/configs/plugin/pluginBase.ts
3964
- function createPluginBaseConfig(plugin) {
3965
- return [
3966
- {
3967
- plugins: {
3968
- "@alextheman": plugin
3969
- },
3970
- rules: {
3971
- "@alextheman/no-namespace-imports": "error",
3972
- "@alextheman/no-relative-imports": "error",
3973
- "@alextheman/use-object-shorthand": "error"
3974
- }
3975
- }
3976
- ];
3977
- }
3978
- var pluginBase_default = createPluginBaseConfig;
3979
-
3980
- // src/configs/plugin/testsBase.ts
3981
- function createPluginTestsBaseConfig(plugin) {
3982
- return [
3983
- {
3984
- files: ["**/*.test.ts"],
3985
- plugins: {
3986
- "@alextheman": plugin
3987
- },
3988
- rules: {
3989
- "@alextheman/consistent-test-function": ["error", { preference: "test" }],
3990
- "@alextheman/no-isolated-tests": "error",
3991
- "@alextheman/no-skipped-tests": "warn"
3992
- }
3993
- }
3994
- ];
3995
- }
3996
- var testsBase_default2 = createPluginTestsBaseConfig;
3997
-
3998
- // src/configs/combined/javaScriptBase.ts
3999
- function createCombinedJavaScriptBaseConfig(plugin) {
4000
- return [...pluginBase_default(plugin), ...javaScriptBase_default];
4001
- }
4002
- var javaScriptBase_default2 = createCombinedJavaScriptBaseConfig;
4003
-
4004
- // src/configs/combined/reactBase.ts
4005
- function createCombinedReactBaseConfig(plugin) {
4006
- return [...pluginBase_default(plugin), ...reactBase_default];
4007
- }
4008
- var reactBase_default2 = createCombinedReactBaseConfig;
4009
-
4010
- // src/configs/combined/testsBase.ts
4011
- function createCombinedTestsBaseConfig(plugin) {
4012
- return [...pluginBase_default(plugin), ...testsBase_default];
4013
- }
4014
- var testsBase_default3 = createCombinedTestsBaseConfig;
4015
-
4016
4028
  // src/configs/combined/typeScriptBase.ts
4017
4029
  function createCombinedTypeScriptBaseConfig(plugin) {
4018
4030
  return [...pluginBase_default(plugin), ...typeScriptBase_default];
4019
4031
  }
4020
4032
  var typeScriptBase_default2 = createCombinedTypeScriptBaseConfig;
4021
4033
 
4034
+ // src/configs/combined/typeScriptReactBase.ts
4035
+ function createCombinedTypeScriptReactBaseConfig(plugin) {
4036
+ return [...pluginBase_default(plugin), ...typeScriptBase_default, ...reactBase_default];
4037
+ }
4038
+ var typeScriptReactBase_default = createCombinedTypeScriptReactBaseConfig;
4039
+
4040
+ // src/configs/combined/javaScriptReactBase.ts
4041
+ function createCombinedJavaScriptReactBaseConfig(plugin) {
4042
+ return [...pluginBase_default(plugin), ...javaScriptBase_default, ...reactBase_default];
4043
+ }
4044
+ var javaScriptReactBase_default = createCombinedJavaScriptReactBaseConfig;
4045
+
4022
4046
  // src/rules/consistent-test-function.ts
4023
4047
  var import_utils2 = require("@typescript-eslint/utils");
4024
4048
  var import_zod = __toESM(require("zod"), 1);
@@ -4542,7 +4566,9 @@ alexPlugin.configs = createPluginConfigs_default({
4542
4566
  javaScript: javaScriptBase_default2(alexPlugin),
4543
4567
  typeScript: typeScriptBase_default2(alexPlugin),
4544
4568
  react: reactBase_default2(alexPlugin),
4545
- tests: testsBase_default3(alexPlugin)
4569
+ tests: testsBase_default3(alexPlugin),
4570
+ typeScriptReact: typeScriptReactBase_default(alexPlugin),
4571
+ javaScriptReact: javaScriptReactBase_default(alexPlugin)
4546
4572
  }
4547
4573
  });
4548
4574
  var alexPlugin_default = alexPlugin;
package/dist/index.d.cts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { Linter } from 'eslint';
2
- import { Config } from 'prettier';
3
2
  import z from 'zod';
3
+ import { Config } from 'prettier';
4
4
 
5
5
  var name = "@alextheman/eslint-plugin";
6
- var version = "2.0.0";
6
+ var version = "2.1.0";
7
7
 
8
8
  interface AlexPluginConfigs {
9
9
  general: {
@@ -21,6 +21,8 @@ interface AlexPluginConfigs {
21
21
  typeScript: Linter.Config[];
22
22
  react: Linter.Config[];
23
23
  tests: Linter.Config[];
24
+ typeScriptReact: Linter.Config[];
25
+ javaScriptReact: Linter.Config[];
24
26
  };
25
27
  }
26
28
  declare function createPluginConfigs(config: AlexPluginConfigs): Record<`${string}/${string}`, Linter.Config[]>;
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { Linter } from 'eslint';
2
- import { Config } from 'prettier';
3
2
  import z from 'zod';
3
+ import { Config } from 'prettier';
4
4
 
5
5
  var name = "@alextheman/eslint-plugin";
6
- var version = "2.0.0";
6
+ var version = "2.1.0";
7
7
 
8
8
  interface AlexPluginConfigs {
9
9
  general: {
@@ -21,6 +21,8 @@ interface AlexPluginConfigs {
21
21
  typeScript: Linter.Config[];
22
22
  react: Linter.Config[];
23
23
  tests: Linter.Config[];
24
+ typeScriptReact: Linter.Config[];
25
+ javaScriptReact: Linter.Config[];
24
26
  };
25
27
  }
26
28
  declare function createPluginConfigs(config: AlexPluginConfigs): Record<`${string}/${string}`, Linter.Config[]>;
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 = "2.0.0";
3703
+ var version = "2.1.0";
3704
3704
 
3705
3705
  // src/configs/general/javaScriptBase.ts
3706
3706
  var import_js = __toESM(require_src(), 1);
@@ -3853,16 +3853,46 @@ var javaScriptBase = [
3853
3853
  ];
3854
3854
  var javaScriptBase_default = javaScriptBase;
3855
3855
 
3856
+ // src/configs/plugin/pluginBase.ts
3857
+ function createPluginBaseConfig(plugin) {
3858
+ return [
3859
+ {
3860
+ plugins: {
3861
+ "@alextheman": plugin
3862
+ },
3863
+ rules: {
3864
+ "@alextheman/no-namespace-imports": "error",
3865
+ "@alextheman/no-relative-imports": "error",
3866
+ "@alextheman/use-object-shorthand": "error"
3867
+ }
3868
+ }
3869
+ ];
3870
+ }
3871
+ var pluginBase_default = createPluginBaseConfig;
3872
+
3873
+ // src/configs/combined/javaScriptBase.ts
3874
+ function createCombinedJavaScriptBaseConfig(plugin) {
3875
+ return [...pluginBase_default(plugin), ...javaScriptBase_default];
3876
+ }
3877
+ var javaScriptBase_default2 = createCombinedJavaScriptBaseConfig;
3878
+
3856
3879
  // src/configs/general/reactBase.ts
3857
3880
  var import_globals2 = __toESM(require_globals2(), 1);
3858
3881
  import reactPlugin from "eslint-plugin-react";
3859
3882
  import reactHooks from "eslint-plugin-react-hooks";
3860
3883
  import reactRefresh from "eslint-plugin-react-refresh";
3861
3884
  var reactBase = [
3885
+ reactPlugin.configs.flat.recommended,
3886
+ reactPlugin.configs.flat["jsx-runtime"],
3862
3887
  {
3863
3888
  languageOptions: {
3864
3889
  ecmaVersion: 2020,
3865
- globals: import_globals2.default.browser
3890
+ globals: import_globals2.default.browser,
3891
+ parserOptions: {
3892
+ ecmaFeatures: {
3893
+ jsx: true
3894
+ }
3895
+ }
3866
3896
  },
3867
3897
  name: "@alextheman/eslint-config-react-base",
3868
3898
  plugins: {
@@ -3870,7 +3900,7 @@ var reactBase = [
3870
3900
  "react-hooks": reactHooks,
3871
3901
  "react-refresh": reactRefresh
3872
3902
  },
3873
- rules: __spreadProps(__spreadValues(__spreadValues({}, reactHooks.configs.recommended.rules), reactPlugin.configs.recommended.rules), {
3903
+ rules: __spreadProps(__spreadValues({}, reactHooks.configs.recommended.rules), {
3874
3904
  "no-restricted-imports": [
3875
3905
  "error",
3876
3906
  {
@@ -3884,11 +3914,46 @@ var reactBase = [
3884
3914
  ],
3885
3915
  "react-hooks/exhaustive-deps": "off",
3886
3916
  "react-refresh/only-export-components": "off"
3887
- })
3917
+ }),
3918
+ settings: {
3919
+ react: {
3920
+ version: "detect"
3921
+ }
3922
+ }
3888
3923
  }
3889
3924
  ];
3890
3925
  var reactBase_default = reactBase;
3891
3926
 
3927
+ // src/configs/combined/reactBase.ts
3928
+ function createCombinedReactBaseConfig(plugin) {
3929
+ return [...pluginBase_default(plugin), ...reactBase_default];
3930
+ }
3931
+ var reactBase_default2 = createCombinedReactBaseConfig;
3932
+
3933
+ // src/configs/plugin/testsBase.ts
3934
+ function createPluginTestsBaseConfig(plugin) {
3935
+ return [
3936
+ {
3937
+ files: ["**/*.test.ts"],
3938
+ plugins: {
3939
+ "@alextheman": plugin
3940
+ },
3941
+ rules: {
3942
+ "@alextheman/consistent-test-function": ["error", { preference: "test" }],
3943
+ "@alextheman/no-isolated-tests": "error",
3944
+ "@alextheman/no-skipped-tests": "warn"
3945
+ }
3946
+ }
3947
+ ];
3948
+ }
3949
+ var testsBase_default2 = createPluginTestsBaseConfig;
3950
+
3951
+ // src/configs/combined/testsBase.ts
3952
+ function createCombinedTestsBaseConfig(plugin) {
3953
+ return [...pluginBase_default(plugin), ...testsBase_default];
3954
+ }
3955
+ var testsBase_default3 = createCombinedTestsBaseConfig;
3956
+
3892
3957
  // src/configs/general/typeScriptBase.ts
3893
3958
  import tsparser from "@typescript-eslint/parser";
3894
3959
  import tseslint from "typescript-eslint";
@@ -3945,65 +4010,24 @@ var typeScriptBase = [
3945
4010
  ];
3946
4011
  var typeScriptBase_default = typeScriptBase;
3947
4012
 
3948
- // src/configs/plugin/pluginBase.ts
3949
- function createPluginBaseConfig(plugin) {
3950
- return [
3951
- {
3952
- plugins: {
3953
- "@alextheman": plugin
3954
- },
3955
- rules: {
3956
- "@alextheman/no-namespace-imports": "error",
3957
- "@alextheman/no-relative-imports": "error",
3958
- "@alextheman/use-object-shorthand": "error"
3959
- }
3960
- }
3961
- ];
3962
- }
3963
- var pluginBase_default = createPluginBaseConfig;
3964
-
3965
- // src/configs/plugin/testsBase.ts
3966
- function createPluginTestsBaseConfig(plugin) {
3967
- return [
3968
- {
3969
- files: ["**/*.test.ts"],
3970
- plugins: {
3971
- "@alextheman": plugin
3972
- },
3973
- rules: {
3974
- "@alextheman/consistent-test-function": ["error", { preference: "test" }],
3975
- "@alextheman/no-isolated-tests": "error",
3976
- "@alextheman/no-skipped-tests": "warn"
3977
- }
3978
- }
3979
- ];
3980
- }
3981
- var testsBase_default2 = createPluginTestsBaseConfig;
3982
-
3983
- // src/configs/combined/javaScriptBase.ts
3984
- function createCombinedJavaScriptBaseConfig(plugin) {
3985
- return [...pluginBase_default(plugin), ...javaScriptBase_default];
3986
- }
3987
- var javaScriptBase_default2 = createCombinedJavaScriptBaseConfig;
3988
-
3989
- // src/configs/combined/reactBase.ts
3990
- function createCombinedReactBaseConfig(plugin) {
3991
- return [...pluginBase_default(plugin), ...reactBase_default];
3992
- }
3993
- var reactBase_default2 = createCombinedReactBaseConfig;
3994
-
3995
- // src/configs/combined/testsBase.ts
3996
- function createCombinedTestsBaseConfig(plugin) {
3997
- return [...pluginBase_default(plugin), ...testsBase_default];
3998
- }
3999
- var testsBase_default3 = createCombinedTestsBaseConfig;
4000
-
4001
4013
  // src/configs/combined/typeScriptBase.ts
4002
4014
  function createCombinedTypeScriptBaseConfig(plugin) {
4003
4015
  return [...pluginBase_default(plugin), ...typeScriptBase_default];
4004
4016
  }
4005
4017
  var typeScriptBase_default2 = createCombinedTypeScriptBaseConfig;
4006
4018
 
4019
+ // src/configs/combined/typeScriptReactBase.ts
4020
+ function createCombinedTypeScriptReactBaseConfig(plugin) {
4021
+ return [...pluginBase_default(plugin), ...typeScriptBase_default, ...reactBase_default];
4022
+ }
4023
+ var typeScriptReactBase_default = createCombinedTypeScriptReactBaseConfig;
4024
+
4025
+ // src/configs/combined/javaScriptReactBase.ts
4026
+ function createCombinedJavaScriptReactBaseConfig(plugin) {
4027
+ return [...pluginBase_default(plugin), ...javaScriptBase_default, ...reactBase_default];
4028
+ }
4029
+ var javaScriptReactBase_default = createCombinedJavaScriptReactBaseConfig;
4030
+
4007
4031
  // src/rules/consistent-test-function.ts
4008
4032
  import { AST_NODE_TYPES } from "@typescript-eslint/utils";
4009
4033
  import z from "zod";
@@ -4527,7 +4551,9 @@ alexPlugin.configs = createPluginConfigs_default({
4527
4551
  javaScript: javaScriptBase_default2(alexPlugin),
4528
4552
  typeScript: typeScriptBase_default2(alexPlugin),
4529
4553
  react: reactBase_default2(alexPlugin),
4530
- tests: testsBase_default3(alexPlugin)
4554
+ tests: testsBase_default3(alexPlugin),
4555
+ typeScriptReact: typeScriptReactBase_default(alexPlugin),
4556
+ javaScriptReact: javaScriptReactBase_default(alexPlugin)
4531
4557
  }
4532
4558
  });
4533
4559
  var alexPlugin_default = alexPlugin;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/eslint-plugin",
3
- "version": "2.0.0",
3
+ "version": "2.1.0",
4
4
  "description": "A package to provide custom ESLint rules and configs",
5
5
  "license": "ISC",
6
6
  "author": "alextheman",