@alextheman/eslint-plugin 1.3.1 → 1.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 CHANGED
@@ -3828,7 +3828,7 @@ var import_eslint_plugin_react_refresh = __toESM(require("eslint-plugin-react-re
3828
3828
  var import_globals2 = __toESM(require_globals2(), 1);
3829
3829
  function createAlexTypeScriptReactBaseConfig(plugin2) {
3830
3830
  return [
3831
- ...plugin2.configs.alexTypeScriptBase,
3831
+ ...alex_typescript_base_default(plugin2),
3832
3832
  {
3833
3833
  name: "@alextheman/eslint-config-typescript-react-base",
3834
3834
  languageOptions: {
@@ -3925,6 +3925,42 @@ var noNamespaceImports = create_rule_default({
3925
3925
  });
3926
3926
  var no_namespace_imports_default = noNamespaceImports;
3927
3927
 
3928
+ // src/rules/no-plugin-configs-access-from-src-configs.ts
3929
+ var noPluginConfigAccessFromSrcConfigs = create_rule_default({
3930
+ name: "no-plugin-configs-access-from-src-configs",
3931
+ meta: {
3932
+ docs: {
3933
+ description: "Forbid access of plugin.configs in src/configs"
3934
+ },
3935
+ messages: {
3936
+ message: "Do not access `plugin.configs` from a file in `src/configs`. Please import the corresponding config creator from `src/configs` instead and pass the plugin to that instead."
3937
+ },
3938
+ type: "suggestion",
3939
+ schema: []
3940
+ },
3941
+ defaultOptions: [],
3942
+ create(context) {
3943
+ return {
3944
+ MemberExpression(node) {
3945
+ var _a, _b, _c;
3946
+ if (context.filename.includes("src/configs")) {
3947
+ if (node.object.type === "Identifier" && ((_a = node.object) == null ? void 0 : _a.name) === "plugin" && (node.property.type === "Identifier" && ((_b = node.property) == null ? void 0 : _b.name) === "configs" || node.property.type === "Literal" && ((_c = node.property) == null ? void 0 : _c.value) === "configs")) {
3948
+ context.report({
3949
+ node,
3950
+ messageId: "message",
3951
+ data: {
3952
+ source: node.object
3953
+ }
3954
+ });
3955
+ return;
3956
+ }
3957
+ }
3958
+ }
3959
+ };
3960
+ }
3961
+ });
3962
+ var no_plugin_configs_access_from_src_configs_default = noPluginConfigAccessFromSrcConfigs;
3963
+
3928
3964
  // src/rules/no-relative-imports.ts
3929
3965
  var import_path = __toESM(require("path"), 1);
3930
3966
  var noRelativeImports = create_rule_default({
@@ -3991,12 +4027,13 @@ var no_relative_imports_default = noRelativeImports;
3991
4027
  // src/rules/index.ts
3992
4028
  var rules_default = {
3993
4029
  "no-namespace-imports": no_namespace_imports_default,
3994
- "no-relative-imports": no_relative_imports_default
4030
+ "no-relative-imports": no_relative_imports_default,
4031
+ "no-plugin-configs-access-from-src-configs": no_plugin_configs_access_from_src_configs_default
3995
4032
  };
3996
4033
 
3997
4034
  // package.json
3998
4035
  var name = "@alextheman/eslint-plugin";
3999
- var version = "1.3.1";
4036
+ var version = "1.4.0";
4000
4037
 
4001
4038
  // src/index.ts
4002
4039
  var plugin = {
package/dist/index.d.cts CHANGED
@@ -5,7 +5,7 @@ import { Config } from 'prettier';
5
5
  declare const prettierRules: Config;
6
6
 
7
7
  var name = "@alextheman/eslint-plugin";
8
- var version = "1.3.1";
8
+ var version = "1.4.0";
9
9
 
10
10
  interface AlexPlugin {
11
11
  meta: {
@@ -35,6 +35,7 @@ declare const plugin: {
35
35
  allow: string[];
36
36
  }], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
37
37
  "no-relative-imports": _typescript_eslint_utils_ts_eslint.RuleModule<"message" | "stupidPath", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
38
+ "no-plugin-configs-access-from-src-configs": _typescript_eslint_utils_ts_eslint.RuleModule<"message", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
38
39
  };
39
40
  };
40
41
 
package/dist/index.d.ts CHANGED
@@ -5,7 +5,7 @@ import { Config } from 'prettier';
5
5
  declare const prettierRules: Config;
6
6
 
7
7
  var name = "@alextheman/eslint-plugin";
8
- var version = "1.3.1";
8
+ var version = "1.4.0";
9
9
 
10
10
  interface AlexPlugin {
11
11
  meta: {
@@ -35,6 +35,7 @@ declare const plugin: {
35
35
  allow: string[];
36
36
  }], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
37
37
  "no-relative-imports": _typescript_eslint_utils_ts_eslint.RuleModule<"message" | "stupidPath", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
38
+ "no-plugin-configs-access-from-src-configs": _typescript_eslint_utils_ts_eslint.RuleModule<"message", [], unknown, _typescript_eslint_utils_ts_eslint.RuleListener>;
38
39
  };
39
40
  };
40
41
 
package/dist/index.js CHANGED
@@ -3814,7 +3814,7 @@ import reactHooks from "eslint-plugin-react-hooks";
3814
3814
  import reactRefresh from "eslint-plugin-react-refresh";
3815
3815
  function createAlexTypeScriptReactBaseConfig(plugin2) {
3816
3816
  return [
3817
- ...plugin2.configs.alexTypeScriptBase,
3817
+ ...alex_typescript_base_default(plugin2),
3818
3818
  {
3819
3819
  name: "@alextheman/eslint-config-typescript-react-base",
3820
3820
  languageOptions: {
@@ -3911,6 +3911,42 @@ var noNamespaceImports = create_rule_default({
3911
3911
  });
3912
3912
  var no_namespace_imports_default = noNamespaceImports;
3913
3913
 
3914
+ // src/rules/no-plugin-configs-access-from-src-configs.ts
3915
+ var noPluginConfigAccessFromSrcConfigs = create_rule_default({
3916
+ name: "no-plugin-configs-access-from-src-configs",
3917
+ meta: {
3918
+ docs: {
3919
+ description: "Forbid access of plugin.configs in src/configs"
3920
+ },
3921
+ messages: {
3922
+ message: "Do not access `plugin.configs` from a file in `src/configs`. Please import the corresponding config creator from `src/configs` instead and pass the plugin to that instead."
3923
+ },
3924
+ type: "suggestion",
3925
+ schema: []
3926
+ },
3927
+ defaultOptions: [],
3928
+ create(context) {
3929
+ return {
3930
+ MemberExpression(node) {
3931
+ var _a, _b, _c;
3932
+ if (context.filename.includes("src/configs")) {
3933
+ if (node.object.type === "Identifier" && ((_a = node.object) == null ? void 0 : _a.name) === "plugin" && (node.property.type === "Identifier" && ((_b = node.property) == null ? void 0 : _b.name) === "configs" || node.property.type === "Literal" && ((_c = node.property) == null ? void 0 : _c.value) === "configs")) {
3934
+ context.report({
3935
+ node,
3936
+ messageId: "message",
3937
+ data: {
3938
+ source: node.object
3939
+ }
3940
+ });
3941
+ return;
3942
+ }
3943
+ }
3944
+ }
3945
+ };
3946
+ }
3947
+ });
3948
+ var no_plugin_configs_access_from_src_configs_default = noPluginConfigAccessFromSrcConfigs;
3949
+
3914
3950
  // src/rules/no-relative-imports.ts
3915
3951
  import path from "path";
3916
3952
  var noRelativeImports = create_rule_default({
@@ -3977,12 +4013,13 @@ var no_relative_imports_default = noRelativeImports;
3977
4013
  // src/rules/index.ts
3978
4014
  var rules_default = {
3979
4015
  "no-namespace-imports": no_namespace_imports_default,
3980
- "no-relative-imports": no_relative_imports_default
4016
+ "no-relative-imports": no_relative_imports_default,
4017
+ "no-plugin-configs-access-from-src-configs": no_plugin_configs_access_from_src_configs_default
3981
4018
  };
3982
4019
 
3983
4020
  // package.json
3984
4021
  var name = "@alextheman/eslint-plugin";
3985
- var version = "1.3.1";
4022
+ var version = "1.4.0";
3986
4023
 
3987
4024
  // src/index.ts
3988
4025
  var plugin = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/eslint-plugin",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -33,8 +33,8 @@
33
33
  "eslint-plugin-prettier": ">=5.5.3",
34
34
  "eslint-plugin-react": ">=7.37.5",
35
35
  "eslint-plugin-react-hooks": ">=5.2.0",
36
- "eslint-plugin-simple-import-sort": "^12.1.1",
37
- "eslint-plugin-react-refresh": ">=0.4.20"
36
+ "eslint-plugin-react-refresh": ">=0.4.20",
37
+ "eslint-plugin-simple-import-sort": "^12.1.1"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/eslint": "^9.6.1",
@@ -52,6 +52,8 @@
52
52
  "vitest": "^3.2.4"
53
53
  },
54
54
  "dependencies": {
55
- "@alextheman/utility": "^1.11.2"
55
+ "@alextheman/utility": "^1.11.2",
56
+ "@types/common-tags": "^1.8.4",
57
+ "common-tags": "^1.8.2"
56
58
  }
57
59
  }