eslint-plugin-effector 0.16.0 → 0.18.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.
Files changed (53) hide show
  1. package/README.md +24 -37
  2. package/dist/index.cjs +1488 -0
  3. package/dist/index.d.cts +164 -0
  4. package/dist/index.d.mts +165 -0
  5. package/dist/index.mjs +1465 -0
  6. package/package.json +73 -17
  7. package/.nvmrc +0 -1
  8. package/config/future.js +0 -7
  9. package/config/patronum.js +0 -5
  10. package/config/react.js +0 -7
  11. package/config/recommended.js +0 -15
  12. package/config/scope.js +0 -6
  13. package/index.js +0 -31
  14. package/rules/enforce-effect-naming-convention/enforce-effect-naming-convention.js +0 -143
  15. package/rules/enforce-gate-naming-convention/enforce-gate-naming-convention.js +0 -122
  16. package/rules/enforce-store-naming-convention/enforce-store-naming-convention.js +0 -205
  17. package/rules/keep-options-order/config.js +0 -3
  18. package/rules/keep-options-order/keep-options-order.js +0 -107
  19. package/rules/mandatory-scope-binding/mandatory-scope-binding.js +0 -81
  20. package/rules/no-ambiguity-target/no-ambiguity-target.js +0 -74
  21. package/rules/no-duplicate-clock-or-source-array-values/no-duplicate-clock-or-source-array-values.js +0 -124
  22. package/rules/no-duplicate-on/no-duplicate-on.js +0 -137
  23. package/rules/no-forward/no-forward.js +0 -73
  24. package/rules/no-getState/no-getState.js +0 -50
  25. package/rules/no-guard/no-guard.js +0 -78
  26. package/rules/no-patronum-debug/no-patronum-debug.js +0 -133
  27. package/rules/no-unnecessary-combination/no-unnecessary-combination.js +0 -88
  28. package/rules/no-unnecessary-duplication/no-unnecessary-duplication.js +0 -115
  29. package/rules/no-useless-methods/no-useless-methods.js +0 -93
  30. package/rules/no-watch/no-watch.js +0 -61
  31. package/rules/prefer-sample-over-forward-with-mapping/prefer-sample-over-forward-with-mapping.js +0 -111
  32. package/rules/prefer-useUnit/prefer-useUnit.js +0 -56
  33. package/rules/require-pickup-in-persist/require-pickup-in-persist.js +0 -47
  34. package/rules/strict-effect-handlers/strict-effect-handlers.js +0 -76
  35. package/utils/are-nodes-same-in-text.js +0 -22
  36. package/utils/builders.js +0 -19
  37. package/utils/create-link-to-rule.js +0 -5
  38. package/utils/extract-config.js +0 -26
  39. package/utils/extract-imported-from.js +0 -18
  40. package/utils/get-corrected-store-name.js +0 -45
  41. package/utils/get-nested-object-name.js +0 -18
  42. package/utils/get-store-name-convention.js +0 -6
  43. package/utils/is.js +0 -39
  44. package/utils/method.js +0 -23
  45. package/utils/naming.js +0 -47
  46. package/utils/node-is-type.js +0 -5
  47. package/utils/node-type-is.js +0 -106
  48. package/utils/react.js +0 -214
  49. package/utils/read-example.js +0 -63
  50. package/utils/replace-by-sample.js +0 -98
  51. package/utils/traverse-nested-object-node.js +0 -9
  52. package/utils/traverse-parent-by-type.js +0 -15
  53. package/utils/validate-store-name-convention.js +0 -13
@@ -0,0 +1,164 @@
1
+ import * as _$_typescript_eslint_utils_ts_eslint0 from "@typescript-eslint/utils/ts-eslint";
2
+ import { Linter } from "eslint";
3
+
4
+ //#region src/ruleset.d.ts
5
+ declare const ruleset: {
6
+ recommended: {
7
+ "effector/enforce-effect-naming-convention": "error";
8
+ "effector/enforce-store-naming-convention": "error";
9
+ "effector/keep-options-order": "warn";
10
+ "effector/no-ambiguity-target": "warn";
11
+ "effector/no-duplicate-on": "error";
12
+ "effector/no-forward": "error";
13
+ "effector/no-getState": "error";
14
+ "effector/no-guard": "error";
15
+ "effector/no-unnecessary-combination": "warn";
16
+ "effector/no-unnecessary-duplication": "warn";
17
+ "effector/no-useless-methods": "error";
18
+ "effector/no-watch": "warn";
19
+ };
20
+ patronum: {
21
+ "effector/no-patronum-debug": "warn";
22
+ };
23
+ scope: {
24
+ "effector/require-pickup-in-persist": "error";
25
+ "effector/strict-effect-handlers": "error";
26
+ };
27
+ react: {
28
+ "effector/enforce-gate-naming-convention": "error";
29
+ "effector/mandatory-scope-binding": "error";
30
+ "effector/no-units-spawn-in-render": "error";
31
+ "effector/prefer-useUnit": "error";
32
+ };
33
+ future: {
34
+ "effector/no-domain-unit-creators": "warn";
35
+ };
36
+ };
37
+ //#endregion
38
+ //#region src/index.d.ts
39
+ declare const base: {
40
+ meta: {
41
+ name: string;
42
+ version: string;
43
+ namespace: string;
44
+ };
45
+ rules: {
46
+ "enforce-effect-naming-convention": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"invalid" | "rename", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
47
+ name: string;
48
+ };
49
+ "enforce-gate-naming-convention": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"invalid" | "rename", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
50
+ name: string;
51
+ };
52
+ "enforce-store-naming-convention": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"invalid" | "rename", [{
53
+ mode: "prefix" | "postfix";
54
+ }], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
55
+ name: string;
56
+ };
57
+ "keep-options-order": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"invalidOrder" | "changeOrder", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
58
+ name: string;
59
+ };
60
+ "mandatory-scope-binding": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"useUnitNeeded", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
61
+ name: string;
62
+ };
63
+ "no-ambiguity-target": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"ambiguous", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
64
+ name: string;
65
+ };
66
+ "no-domain-unit-creators": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"avoid", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
67
+ name: string;
68
+ };
69
+ "no-duplicate-clock-or-source-array-values": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"duplicate" | "remove", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
70
+ name: string;
71
+ };
72
+ "no-duplicate-on": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"duplicate", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
73
+ name: string;
74
+ };
75
+ "no-forward": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"noForward" | "replaceWithSample", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
76
+ name: string;
77
+ };
78
+ "no-getState": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"named" | "anonymous", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
79
+ name: string;
80
+ };
81
+ "no-guard": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"replaceWithSample" | "noGuard", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
82
+ name: string;
83
+ };
84
+ "no-patronum-debug": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"remove" | "unexpected", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
85
+ name: string;
86
+ };
87
+ "no-units-spawn-in-render": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"noFactoryInRender" | "noOperatorInRender" | "noCustomFactoryInRender", [{
88
+ detectCustomFactories: true | false | {
89
+ allowlist: string[];
90
+ };
91
+ }], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
92
+ name: string;
93
+ };
94
+ "no-unnecessary-combination": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"unnecessary", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
95
+ name: string;
96
+ };
97
+ "no-unnecessary-duplication": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"duplicate" | "removeClock" | "removeSource", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
98
+ name: string;
99
+ };
100
+ "no-useless-methods": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"uselessMethod", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
101
+ name: string;
102
+ };
103
+ "no-watch": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"restricted", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
104
+ name: string;
105
+ };
106
+ "prefer-useUnit": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"useUseUnit", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
107
+ name: string;
108
+ };
109
+ "require-pickup-in-persist": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"missing", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
110
+ name: string;
111
+ };
112
+ "strict-effect-handlers": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"mixed", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
113
+ name: string;
114
+ };
115
+ };
116
+ };
117
+ declare const legacyConfigs: {
118
+ recommended: {
119
+ rules: {
120
+ "effector/enforce-effect-naming-convention": "error";
121
+ "effector/enforce-store-naming-convention": "error";
122
+ "effector/keep-options-order": "warn";
123
+ "effector/no-ambiguity-target": "warn";
124
+ "effector/no-duplicate-on": "error";
125
+ "effector/no-forward": "error";
126
+ "effector/no-getState": "error";
127
+ "effector/no-guard": "error";
128
+ "effector/no-unnecessary-combination": "warn";
129
+ "effector/no-unnecessary-duplication": "warn";
130
+ "effector/no-useless-methods": "error";
131
+ "effector/no-watch": "warn";
132
+ };
133
+ };
134
+ scope: {
135
+ rules: {
136
+ "effector/require-pickup-in-persist": "error";
137
+ "effector/strict-effect-handlers": "error";
138
+ };
139
+ };
140
+ react: {
141
+ rules: {
142
+ "effector/enforce-gate-naming-convention": "error";
143
+ "effector/mandatory-scope-binding": "error";
144
+ "effector/no-units-spawn-in-render": "error";
145
+ "effector/prefer-useUnit": "error";
146
+ };
147
+ };
148
+ future: {
149
+ rules: {
150
+ "effector/no-domain-unit-creators": "warn";
151
+ };
152
+ };
153
+ patronum: {
154
+ rules: {
155
+ "effector/no-patronum-debug": "warn";
156
+ };
157
+ };
158
+ };
159
+ declare const flatConfigs: Record<keyof typeof ruleset, Linter.Config>;
160
+ declare const plugin: {
161
+ flatConfigs: typeof flatConfigs; /** @deprecated Migrate to modern ESLint v9+ Flat Config format */
162
+ configs: typeof legacyConfigs;
163
+ } & typeof base;
164
+ export = plugin;
@@ -0,0 +1,165 @@
1
+ import * as _$_typescript_eslint_utils_ts_eslint0 from "@typescript-eslint/utils/ts-eslint";
2
+ import { Linter } from "eslint";
3
+
4
+ //#region src/ruleset.d.ts
5
+ declare const ruleset: {
6
+ recommended: {
7
+ "effector/enforce-effect-naming-convention": "error";
8
+ "effector/enforce-store-naming-convention": "error";
9
+ "effector/keep-options-order": "warn";
10
+ "effector/no-ambiguity-target": "warn";
11
+ "effector/no-duplicate-on": "error";
12
+ "effector/no-forward": "error";
13
+ "effector/no-getState": "error";
14
+ "effector/no-guard": "error";
15
+ "effector/no-unnecessary-combination": "warn";
16
+ "effector/no-unnecessary-duplication": "warn";
17
+ "effector/no-useless-methods": "error";
18
+ "effector/no-watch": "warn";
19
+ };
20
+ patronum: {
21
+ "effector/no-patronum-debug": "warn";
22
+ };
23
+ scope: {
24
+ "effector/require-pickup-in-persist": "error";
25
+ "effector/strict-effect-handlers": "error";
26
+ };
27
+ react: {
28
+ "effector/enforce-gate-naming-convention": "error";
29
+ "effector/mandatory-scope-binding": "error";
30
+ "effector/no-units-spawn-in-render": "error";
31
+ "effector/prefer-useUnit": "error";
32
+ };
33
+ future: {
34
+ "effector/no-domain-unit-creators": "warn";
35
+ };
36
+ };
37
+ //#endregion
38
+ //#region src/index.d.ts
39
+ declare const base: {
40
+ meta: {
41
+ name: string;
42
+ version: string;
43
+ namespace: string;
44
+ };
45
+ rules: {
46
+ "enforce-effect-naming-convention": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"invalid" | "rename", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
47
+ name: string;
48
+ };
49
+ "enforce-gate-naming-convention": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"invalid" | "rename", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
50
+ name: string;
51
+ };
52
+ "enforce-store-naming-convention": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"invalid" | "rename", [{
53
+ mode: "prefix" | "postfix";
54
+ }], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
55
+ name: string;
56
+ };
57
+ "keep-options-order": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"invalidOrder" | "changeOrder", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
58
+ name: string;
59
+ };
60
+ "mandatory-scope-binding": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"useUnitNeeded", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
61
+ name: string;
62
+ };
63
+ "no-ambiguity-target": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"ambiguous", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
64
+ name: string;
65
+ };
66
+ "no-domain-unit-creators": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"avoid", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
67
+ name: string;
68
+ };
69
+ "no-duplicate-clock-or-source-array-values": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"duplicate" | "remove", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
70
+ name: string;
71
+ };
72
+ "no-duplicate-on": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"duplicate", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
73
+ name: string;
74
+ };
75
+ "no-forward": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"noForward" | "replaceWithSample", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
76
+ name: string;
77
+ };
78
+ "no-getState": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"named" | "anonymous", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
79
+ name: string;
80
+ };
81
+ "no-guard": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"replaceWithSample" | "noGuard", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
82
+ name: string;
83
+ };
84
+ "no-patronum-debug": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"remove" | "unexpected", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
85
+ name: string;
86
+ };
87
+ "no-units-spawn-in-render": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"noFactoryInRender" | "noOperatorInRender" | "noCustomFactoryInRender", [{
88
+ detectCustomFactories: true | false | {
89
+ allowlist: string[];
90
+ };
91
+ }], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
92
+ name: string;
93
+ };
94
+ "no-unnecessary-combination": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"unnecessary", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
95
+ name: string;
96
+ };
97
+ "no-unnecessary-duplication": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"duplicate" | "removeClock" | "removeSource", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
98
+ name: string;
99
+ };
100
+ "no-useless-methods": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"uselessMethod", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
101
+ name: string;
102
+ };
103
+ "no-watch": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"restricted", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
104
+ name: string;
105
+ };
106
+ "prefer-useUnit": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"useUseUnit", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
107
+ name: string;
108
+ };
109
+ "require-pickup-in-persist": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"missing", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
110
+ name: string;
111
+ };
112
+ "strict-effect-handlers": _$_typescript_eslint_utils_ts_eslint0.RuleModule<"mixed", [], unknown, _$_typescript_eslint_utils_ts_eslint0.RuleListener> & {
113
+ name: string;
114
+ };
115
+ };
116
+ };
117
+ declare const legacyConfigs: {
118
+ recommended: {
119
+ rules: {
120
+ "effector/enforce-effect-naming-convention": "error";
121
+ "effector/enforce-store-naming-convention": "error";
122
+ "effector/keep-options-order": "warn";
123
+ "effector/no-ambiguity-target": "warn";
124
+ "effector/no-duplicate-on": "error";
125
+ "effector/no-forward": "error";
126
+ "effector/no-getState": "error";
127
+ "effector/no-guard": "error";
128
+ "effector/no-unnecessary-combination": "warn";
129
+ "effector/no-unnecessary-duplication": "warn";
130
+ "effector/no-useless-methods": "error";
131
+ "effector/no-watch": "warn";
132
+ };
133
+ };
134
+ scope: {
135
+ rules: {
136
+ "effector/require-pickup-in-persist": "error";
137
+ "effector/strict-effect-handlers": "error";
138
+ };
139
+ };
140
+ react: {
141
+ rules: {
142
+ "effector/enforce-gate-naming-convention": "error";
143
+ "effector/mandatory-scope-binding": "error";
144
+ "effector/no-units-spawn-in-render": "error";
145
+ "effector/prefer-useUnit": "error";
146
+ };
147
+ };
148
+ future: {
149
+ rules: {
150
+ "effector/no-domain-unit-creators": "warn";
151
+ };
152
+ };
153
+ patronum: {
154
+ rules: {
155
+ "effector/no-patronum-debug": "warn";
156
+ };
157
+ };
158
+ };
159
+ declare const flatConfigs: Record<keyof typeof ruleset, Linter.Config>;
160
+ declare const plugin: {
161
+ flatConfigs: typeof flatConfigs; /** @deprecated Migrate to modern ESLint v9+ Flat Config format */
162
+ configs: typeof legacyConfigs;
163
+ } & typeof base;
164
+ //#endregion
165
+ export { plugin as default };