@alextheman/eslint-plugin 1.3.2 → 1.5.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
@@ -3792,6 +3792,7 @@ var esLintConfigTypeScriptBase = [
3792
3792
  "no-unused-vars": "off",
3793
3793
  "func-style": [warnOnFixButErrorOnLint, "declaration", { allowArrowFunctions: false }],
3794
3794
  "prefer-arrow-callback": [warnOnFixButErrorOnLint, { allowNamedFunctions: false }],
3795
+ "arrow-body-style": [warnOnFixButErrorOnLint, "always"],
3795
3796
  "no-param-reassign": warnOnFixButErrorOnLint,
3796
3797
  "no-useless-rename": warnOnFixButErrorOnLint,
3797
3798
  "sort-vars": warnOnFixButErrorOnLint,
@@ -3925,6 +3926,42 @@ var noNamespaceImports = create_rule_default({
3925
3926
  });
3926
3927
  var no_namespace_imports_default = noNamespaceImports;
3927
3928
 
3929
+ // src/rules/no-plugin-configs-access-from-src-configs.ts
3930
+ var noPluginConfigAccessFromSrcConfigs = create_rule_default({
3931
+ name: "no-plugin-configs-access-from-src-configs",
3932
+ meta: {
3933
+ docs: {
3934
+ description: "Forbid access of plugin.configs in src/configs"
3935
+ },
3936
+ messages: {
3937
+ 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."
3938
+ },
3939
+ type: "suggestion",
3940
+ schema: []
3941
+ },
3942
+ defaultOptions: [],
3943
+ create(context) {
3944
+ return {
3945
+ MemberExpression(node) {
3946
+ var _a, _b, _c;
3947
+ if (context.filename.includes("src/configs")) {
3948
+ 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")) {
3949
+ context.report({
3950
+ node,
3951
+ messageId: "message",
3952
+ data: {
3953
+ source: node.object
3954
+ }
3955
+ });
3956
+ return;
3957
+ }
3958
+ }
3959
+ }
3960
+ };
3961
+ }
3962
+ });
3963
+ var no_plugin_configs_access_from_src_configs_default = noPluginConfigAccessFromSrcConfigs;
3964
+
3928
3965
  // src/rules/no-relative-imports.ts
3929
3966
  var import_path = __toESM(require("path"), 1);
3930
3967
  var noRelativeImports = create_rule_default({
@@ -3991,12 +4028,13 @@ var no_relative_imports_default = noRelativeImports;
3991
4028
  // src/rules/index.ts
3992
4029
  var rules_default = {
3993
4030
  "no-namespace-imports": no_namespace_imports_default,
3994
- "no-relative-imports": no_relative_imports_default
4031
+ "no-relative-imports": no_relative_imports_default,
4032
+ "no-plugin-configs-access-from-src-configs": no_plugin_configs_access_from_src_configs_default
3995
4033
  };
3996
4034
 
3997
4035
  // package.json
3998
4036
  var name = "@alextheman/eslint-plugin";
3999
- var version = "1.3.2";
4037
+ var version = "1.5.0";
4000
4038
 
4001
4039
  // src/index.ts
4002
4040
  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.2";
8
+ var version = "1.5.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.2";
8
+ var version = "1.5.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
@@ -3778,6 +3778,7 @@ var esLintConfigTypeScriptBase = [
3778
3778
  "no-unused-vars": "off",
3779
3779
  "func-style": [warnOnFixButErrorOnLint, "declaration", { allowArrowFunctions: false }],
3780
3780
  "prefer-arrow-callback": [warnOnFixButErrorOnLint, { allowNamedFunctions: false }],
3781
+ "arrow-body-style": [warnOnFixButErrorOnLint, "always"],
3781
3782
  "no-param-reassign": warnOnFixButErrorOnLint,
3782
3783
  "no-useless-rename": warnOnFixButErrorOnLint,
3783
3784
  "sort-vars": warnOnFixButErrorOnLint,
@@ -3911,6 +3912,42 @@ var noNamespaceImports = create_rule_default({
3911
3912
  });
3912
3913
  var no_namespace_imports_default = noNamespaceImports;
3913
3914
 
3915
+ // src/rules/no-plugin-configs-access-from-src-configs.ts
3916
+ var noPluginConfigAccessFromSrcConfigs = create_rule_default({
3917
+ name: "no-plugin-configs-access-from-src-configs",
3918
+ meta: {
3919
+ docs: {
3920
+ description: "Forbid access of plugin.configs in src/configs"
3921
+ },
3922
+ messages: {
3923
+ 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."
3924
+ },
3925
+ type: "suggestion",
3926
+ schema: []
3927
+ },
3928
+ defaultOptions: [],
3929
+ create(context) {
3930
+ return {
3931
+ MemberExpression(node) {
3932
+ var _a, _b, _c;
3933
+ if (context.filename.includes("src/configs")) {
3934
+ 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")) {
3935
+ context.report({
3936
+ node,
3937
+ messageId: "message",
3938
+ data: {
3939
+ source: node.object
3940
+ }
3941
+ });
3942
+ return;
3943
+ }
3944
+ }
3945
+ }
3946
+ };
3947
+ }
3948
+ });
3949
+ var no_plugin_configs_access_from_src_configs_default = noPluginConfigAccessFromSrcConfigs;
3950
+
3914
3951
  // src/rules/no-relative-imports.ts
3915
3952
  import path from "path";
3916
3953
  var noRelativeImports = create_rule_default({
@@ -3977,12 +4014,13 @@ var no_relative_imports_default = noRelativeImports;
3977
4014
  // src/rules/index.ts
3978
4015
  var rules_default = {
3979
4016
  "no-namespace-imports": no_namespace_imports_default,
3980
- "no-relative-imports": no_relative_imports_default
4017
+ "no-relative-imports": no_relative_imports_default,
4018
+ "no-plugin-configs-access-from-src-configs": no_plugin_configs_access_from_src_configs_default
3981
4019
  };
3982
4020
 
3983
4021
  // package.json
3984
4022
  var name = "@alextheman/eslint-plugin";
3985
- var version = "1.3.2";
4023
+ var version = "1.5.0";
3986
4024
 
3987
4025
  // src/index.ts
3988
4026
  var plugin = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alextheman/eslint-plugin",
3
- "version": "1.3.2",
3
+ "version": "1.5.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
  }