@ngrx/eslint-plugin 20.0.1 → 21.0.0-beta.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 (168) hide show
  1. package/package.json +1 -2
  2. package/schematics/ng-add/schema.json +15 -0
  3. package/scripts/generate-config.js +61 -72
  4. package/scripts/generate-config.js.map +1 -1
  5. package/scripts/generate-docs.js +21 -22
  6. package/scripts/generate-docs.js.map +1 -1
  7. package/scripts/generate-overview.js +63 -56
  8. package/scripts/generate-overview.js.map +1 -1
  9. package/spec/utils/from-fixture.js.map +1 -1
  10. package/spec/utils/rule-tester.d.ts +1 -4
  11. package/spec/utils/rule-tester.js +7 -9
  12. package/spec/utils/rule-tester.js.map +1 -1
  13. package/src/configs/all.js +0 -9
  14. package/src/configs/all.js.map +1 -1
  15. package/src/configs/all.json +0 -8
  16. package/src/configs/allTypeChecked.d.ts +7 -0
  17. package/src/configs/allTypeChecked.js +61 -0
  18. package/src/configs/allTypeChecked.js.map +1 -0
  19. package/src/configs/allTypeChecked.json +41 -0
  20. package/src/configs/component-store.js +0 -1
  21. package/src/configs/component-store.js.map +1 -1
  22. package/src/configs/effects.js +0 -8
  23. package/src/configs/effects.js.map +1 -1
  24. package/src/configs/effects.json +0 -7
  25. package/src/configs/effectsTypeChecked.d.ts +7 -0
  26. package/src/configs/effectsTypeChecked.js +33 -0
  27. package/src/configs/effectsTypeChecked.js.map +1 -0
  28. package/src/configs/effectsTypeChecked.json +13 -0
  29. package/src/configs/operators.js +0 -1
  30. package/src/configs/operators.js.map +1 -1
  31. package/src/configs/signals.js +0 -7
  32. package/src/configs/signals.js.map +1 -1
  33. package/src/configs/signals.json +1 -7
  34. package/src/configs/signalsTypeChecked.d.ts +7 -0
  35. package/src/configs/signalsTypeChecked.js +31 -0
  36. package/src/configs/signalsTypeChecked.js.map +1 -0
  37. package/src/configs/signalsTypeChecked.json +11 -0
  38. package/src/configs/store.js +0 -1
  39. package/src/configs/store.js.map +1 -1
  40. package/src/index.d.ts +35 -56
  41. package/src/rule-creator.d.ts +7 -23
  42. package/src/rule-creator.js +22 -18
  43. package/src/rule-creator.js.map +1 -1
  44. package/src/rules/component-store/avoid-combining-component-store-selectors.d.ts +1 -1
  45. package/src/rules/component-store/avoid-combining-component-store-selectors.js +1 -1
  46. package/src/rules/component-store/avoid-combining-component-store-selectors.js.map +1 -1
  47. package/src/rules/component-store/avoid-mapping-component-store-selectors.d.ts +1 -1
  48. package/src/rules/component-store/avoid-mapping-component-store-selectors.js +1 -1
  49. package/src/rules/component-store/avoid-mapping-component-store-selectors.js.map +1 -1
  50. package/src/rules/component-store/require-super-ondestroy.d.ts +1 -1
  51. package/src/rules/component-store/require-super-ondestroy.js +1 -1
  52. package/src/rules/component-store/require-super-ondestroy.js.map +1 -1
  53. package/src/rules/component-store/updater-explicit-return-type.d.ts +1 -1
  54. package/src/rules/component-store/updater-explicit-return-type.js +1 -1
  55. package/src/rules/component-store/updater-explicit-return-type.js.map +1 -1
  56. package/src/rules/effects/avoid-cyclic-effects.d.ts +1 -1
  57. package/src/rules/effects/avoid-cyclic-effects.js +1 -1
  58. package/src/rules/effects/avoid-cyclic-effects.js.map +1 -1
  59. package/src/rules/effects/no-dispatch-in-effects.d.ts +1 -1
  60. package/src/rules/effects/no-dispatch-in-effects.js +1 -1
  61. package/src/rules/effects/no-dispatch-in-effects.js.map +1 -1
  62. package/src/rules/effects/no-effects-in-providers.d.ts +1 -1
  63. package/src/rules/effects/no-effects-in-providers.js +1 -1
  64. package/src/rules/effects/no-effects-in-providers.js.map +1 -1
  65. package/src/rules/effects/no-multiple-actions-in-effects.d.ts +1 -1
  66. package/src/rules/effects/no-multiple-actions-in-effects.js +1 -1
  67. package/src/rules/effects/no-multiple-actions-in-effects.js.map +1 -1
  68. package/src/rules/effects/prefer-action-creator-in-of-type.d.ts +1 -1
  69. package/src/rules/effects/prefer-action-creator-in-of-type.js +1 -1
  70. package/src/rules/effects/prefer-action-creator-in-of-type.js.map +1 -1
  71. package/src/rules/effects/prefer-effect-callback-in-block-statement.d.ts +1 -1
  72. package/src/rules/effects/prefer-effect-callback-in-block-statement.js +1 -1
  73. package/src/rules/effects/prefer-effect-callback-in-block-statement.js.map +1 -1
  74. package/src/rules/effects/use-effects-lifecycle-interface.d.ts +1 -1
  75. package/src/rules/effects/use-effects-lifecycle-interface.js +1 -1
  76. package/src/rules/effects/use-effects-lifecycle-interface.js.map +1 -1
  77. package/src/rules/index.d.ts +35 -35
  78. package/src/rules/operators/prefer-concat-latest-from.d.ts +1 -1
  79. package/src/rules/operators/prefer-concat-latest-from.js +1 -1
  80. package/src/rules/operators/prefer-concat-latest-from.js.map +1 -1
  81. package/src/rules/signals/enforce-type-call.d.ts +1 -1
  82. package/src/rules/signals/enforce-type-call.js +1 -1
  83. package/src/rules/signals/enforce-type-call.js.map +1 -1
  84. package/src/rules/signals/prefer-protected-state.d.ts +1 -1
  85. package/src/rules/signals/prefer-protected-state.js +1 -1
  86. package/src/rules/signals/prefer-protected-state.js.map +1 -1
  87. package/src/rules/signals/signal-state-no-arrays-at-root-level.d.ts +1 -1
  88. package/src/rules/signals/signal-state-no-arrays-at-root-level.js +1 -1
  89. package/src/rules/signals/signal-state-no-arrays-at-root-level.js.map +1 -1
  90. package/src/rules/signals/signal-store-feature-should-use-generic-type.d.ts +1 -1
  91. package/src/rules/signals/signal-store-feature-should-use-generic-type.js +1 -1
  92. package/src/rules/signals/signal-store-feature-should-use-generic-type.js.map +1 -1
  93. package/src/rules/signals/with-state-no-arrays-at-root-level.d.ts +1 -1
  94. package/src/rules/signals/with-state-no-arrays-at-root-level.js +1 -1
  95. package/src/rules/signals/with-state-no-arrays-at-root-level.js.map +1 -1
  96. package/src/rules/store/avoid-combining-selectors.d.ts +1 -1
  97. package/src/rules/store/avoid-combining-selectors.js +1 -1
  98. package/src/rules/store/avoid-combining-selectors.js.map +1 -1
  99. package/src/rules/store/avoid-dispatching-multiple-actions-sequentially.d.ts +1 -1
  100. package/src/rules/store/avoid-dispatching-multiple-actions-sequentially.js +1 -1
  101. package/src/rules/store/avoid-dispatching-multiple-actions-sequentially.js.map +1 -1
  102. package/src/rules/store/avoid-duplicate-actions-in-reducer.d.ts +1 -1
  103. package/src/rules/store/avoid-duplicate-actions-in-reducer.js +1 -1
  104. package/src/rules/store/avoid-duplicate-actions-in-reducer.js.map +1 -1
  105. package/src/rules/store/avoid-mapping-selectors.d.ts +1 -1
  106. package/src/rules/store/avoid-mapping-selectors.js +1 -1
  107. package/src/rules/store/avoid-mapping-selectors.js.map +1 -1
  108. package/src/rules/store/good-action-hygiene.d.ts +1 -1
  109. package/src/rules/store/good-action-hygiene.js +1 -1
  110. package/src/rules/store/good-action-hygiene.js.map +1 -1
  111. package/src/rules/store/no-multiple-global-stores.d.ts +1 -1
  112. package/src/rules/store/no-multiple-global-stores.js +1 -1
  113. package/src/rules/store/no-multiple-global-stores.js.map +1 -1
  114. package/src/rules/store/no-reducer-in-key-names.d.ts +1 -1
  115. package/src/rules/store/no-reducer-in-key-names.js +1 -1
  116. package/src/rules/store/no-reducer-in-key-names.js.map +1 -1
  117. package/src/rules/store/no-store-subscription.d.ts +1 -1
  118. package/src/rules/store/no-store-subscription.js +1 -1
  119. package/src/rules/store/no-store-subscription.js.map +1 -1
  120. package/src/rules/store/no-typed-global-store.d.ts +1 -1
  121. package/src/rules/store/no-typed-global-store.js +1 -1
  122. package/src/rules/store/no-typed-global-store.js.map +1 -1
  123. package/src/rules/store/on-function-explicit-return-type.d.ts +1 -1
  124. package/src/rules/store/on-function-explicit-return-type.js +1 -1
  125. package/src/rules/store/on-function-explicit-return-type.js.map +1 -1
  126. package/src/rules/store/prefer-action-creator-in-dispatch.d.ts +1 -1
  127. package/src/rules/store/prefer-action-creator-in-dispatch.js +1 -1
  128. package/src/rules/store/prefer-action-creator-in-dispatch.js.map +1 -1
  129. package/src/rules/store/prefer-action-creator.d.ts +1 -1
  130. package/src/rules/store/prefer-action-creator.js +1 -1
  131. package/src/rules/store/prefer-action-creator.js.map +1 -1
  132. package/src/rules/store/prefer-inline-action-props.d.ts +1 -1
  133. package/src/rules/store/prefer-inline-action-props.js +1 -1
  134. package/src/rules/store/prefer-inline-action-props.js.map +1 -1
  135. package/src/rules/store/prefer-one-generic-in-create-for-feature-selector.d.ts +1 -1
  136. package/src/rules/store/prefer-one-generic-in-create-for-feature-selector.js +1 -1
  137. package/src/rules/store/prefer-one-generic-in-create-for-feature-selector.js.map +1 -1
  138. package/src/rules/store/prefer-selector-in-select.d.ts +1 -1
  139. package/src/rules/store/prefer-selector-in-select.js +1 -1
  140. package/src/rules/store/prefer-selector-in-select.js.map +1 -1
  141. package/src/rules/store/prefix-selectors-with-select.d.ts +1 -1
  142. package/src/rules/store/prefix-selectors-with-select.js +121 -25
  143. package/src/rules/store/prefix-selectors-with-select.js.map +1 -1
  144. package/src/rules/store/select-style.d.ts +1 -1
  145. package/src/rules/store/select-style.js +1 -1
  146. package/src/rules/store/select-style.js.map +1 -1
  147. package/src/rules/store/use-consistent-global-store-name.d.ts +1 -1
  148. package/src/rules/store/use-consistent-global-store-name.js +1 -1
  149. package/src/rules/store/use-consistent-global-store-name.js.map +1 -1
  150. package/src/utils/helper-functions/index.d.ts +0 -2
  151. package/src/utils/helper-functions/index.js +0 -2
  152. package/src/utils/helper-functions/index.js.map +1 -1
  153. package/src/utils/helper-functions/rules.d.ts +1 -2
  154. package/src/utils/helper-functions/rules.js +5 -4
  155. package/src/utils/helper-functions/rules.js.map +1 -1
  156. package/src/utils/helper-functions/utils.js.map +1 -1
  157. package/v9/index.d.ts +6 -0
  158. package/v9/index.js +6 -0
  159. package/v9/index.js.map +1 -1
  160. package/jest.config.d.ts +0 -15
  161. package/jest.config.js +0 -25
  162. package/jest.config.js.map +0 -1
  163. package/src/utils/helper-functions/docs.d.ts +0 -1
  164. package/src/utils/helper-functions/docs.js +0 -6
  165. package/src/utils/helper-functions/docs.js.map +0 -1
  166. package/src/utils/helper-functions/versions.d.ts +0 -1
  167. package/src/utils/helper-functions/versions.js +0 -78
  168. package/src/utils/helper-functions/versions.js.map +0 -1
package/src/index.d.ts CHANGED
@@ -8,10 +8,8 @@ declare const _default: {
8
8
  "@ngrx/avoid-mapping-component-store-selectors": string;
9
9
  "@ngrx/require-super-ondestroy": string;
10
10
  "@ngrx/updater-explicit-return-type": string;
11
- "@ngrx/avoid-cyclic-effects": string;
12
11
  "@ngrx/no-dispatch-in-effects": string;
13
12
  "@ngrx/no-effects-in-providers": string;
14
- "@ngrx/no-multiple-actions-in-effects": string;
15
13
  "@ngrx/prefer-action-creator-in-of-type": string;
16
14
  "@ngrx/prefer-effect-callback-in-block-statement": string;
17
15
  "@ngrx/use-effects-lifecycle-interface": string;
@@ -20,7 +18,6 @@ declare const _default: {
20
18
  "@ngrx/prefer-protected-state": string;
21
19
  "@ngrx/signal-state-no-arrays-at-root-level": string;
22
20
  "@ngrx/signal-store-feature-should-use-generic-type": string;
23
- "@ngrx/with-state-no-arrays-at-root-level": string;
24
21
  "@ngrx/avoid-combining-selectors": string;
25
22
  "@ngrx/avoid-dispatching-multiple-actions-sequentially": string;
26
23
  "@ngrx/avoid-duplicate-actions-in-reducer": string;
@@ -40,11 +37,6 @@ declare const _default: {
40
37
  "@ngrx/select-style": string;
41
38
  "@ngrx/use-consistent-global-store-name": string;
42
39
  };
43
- parserOptions: {
44
- ecmaVersion: number;
45
- sourceType: string;
46
- project: string;
47
- };
48
40
  };
49
41
  'component-store': {
50
42
  parser: string;
@@ -60,19 +52,12 @@ declare const _default: {
60
52
  parser: string;
61
53
  plugins: string[];
62
54
  rules: {
63
- "@ngrx/avoid-cyclic-effects": string;
64
55
  "@ngrx/no-dispatch-in-effects": string;
65
56
  "@ngrx/no-effects-in-providers": string;
66
- "@ngrx/no-multiple-actions-in-effects": string;
67
57
  "@ngrx/prefer-action-creator-in-of-type": string;
68
58
  "@ngrx/prefer-effect-callback-in-block-statement": string;
69
59
  "@ngrx/use-effects-lifecycle-interface": string;
70
60
  };
71
- parserOptions: {
72
- ecmaVersion: number;
73
- sourceType: string;
74
- project: string;
75
- };
76
61
  };
77
62
  store: {
78
63
  parser: string;
@@ -113,53 +98,47 @@ declare const _default: {
113
98
  "@ngrx/prefer-protected-state": string;
114
99
  "@ngrx/signal-state-no-arrays-at-root-level": string;
115
100
  "@ngrx/signal-store-feature-should-use-generic-type": string;
116
- "@ngrx/with-state-no-arrays-at-root-level": string;
117
- };
118
- parserOptions: {
119
- ecmaVersion: number;
120
- sourceType: string;
121
- project: string;
122
101
  };
123
102
  };
124
103
  };
125
104
  rules: {
126
- 'avoid-combining-component-store-selectors': import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidCombiningComponentStoreSelectors", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
127
- 'avoid-mapping-component-store-selectors': import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidMappingComponentStoreSelectors", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
128
- 'updater-explicit-return-type': import("@typescript-eslint/utils/ts-eslint").RuleModule<"updaterExplicitReturnType", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
129
- 'require-super-ondestroy': import("@typescript-eslint/utils/ts-eslint").RuleModule<"requireSuperOnDestroy", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
130
- 'avoid-cyclic-effects': import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidCyclicEffects", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
131
- 'no-dispatch-in-effects': import("@typescript-eslint/utils/ts-eslint").RuleModule<"noDispatchInEffects" | "noDispatchInEffectsSuggest", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
132
- 'no-effects-in-providers': import("@typescript-eslint/utils/ts-eslint").RuleModule<"noEffectsInProviders", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
133
- 'no-multiple-actions-in-effects': import("@typescript-eslint/utils/ts-eslint").RuleModule<"noMultipleActionsInEffects", readonly unknown[], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
134
- 'prefer-action-creator-in-of-type': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferActionCreatorInOfType", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
135
- 'prefer-effect-callback-in-block-statement': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferEffectCallbackInBlockStatement", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
136
- 'use-effects-lifecycle-interface': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useEffectsLifecycleInterface", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
137
- 'avoid-combining-selectors': import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidCombiningSelectors", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
138
- 'avoid-dispatching-multiple-actions-sequentially': import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidDispatchingMultipleActionsSequentially", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
139
- 'avoid-duplicate-actions-in-reducer': import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidDuplicateActionsInReducer" | "avoidDuplicateActionsInReducerSuggest", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
140
- 'avoid-mapping-selectors': import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidMapppingSelectors", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
141
- 'good-action-hygiene': import("@typescript-eslint/utils/ts-eslint").RuleModule<"goodActionHygiene", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
142
- 'no-multiple-global-stores': import("@typescript-eslint/utils/ts-eslint").RuleModule<"noMultipleGlobalStores" | "noMultipleGlobalStoresSuggest", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
143
- 'no-reducer-in-key-names': import("@typescript-eslint/utils/ts-eslint").RuleModule<"noReducerInKeyNames" | "noReducerInKeyNamesSuggest", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
144
- 'no-store-subscription': import("@typescript-eslint/utils/ts-eslint").RuleModule<"noStoreSubscription", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
145
- 'no-typed-global-store': import("@typescript-eslint/utils/ts-eslint").RuleModule<"noTypedStore" | "noTypedStoreSuggest", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
146
- 'on-function-explicit-return-type': import("@typescript-eslint/utils/ts-eslint").RuleModule<"onFunctionExplicitReturnType" | "onFunctionExplicitReturnTypeSuggest", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
147
- 'prefer-action-creator': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferActionCreator", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
148
- 'prefer-action-creator-in-dispatch': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferActionCreatorInDispatch", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
149
- 'prefer-inline-action-props': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferInlineActionProps" | "preferInlineActionPropsSuggest", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
150
- 'prefer-one-generic-in-create-for-feature-selector': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferOneGenericInCreateForFeatureSelector" | "preferOneGenericInCreateForFeatureSelectorSuggest", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
151
- 'prefer-selector-in-select': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferSelectorInSelect", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
152
- 'prefix-selectors-with-select': import("@typescript-eslint/utils/ts-eslint").RuleModule<"prefixSelectorsWithSelect" | "prefixSelectorsWithSelectSuggest", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
153
- 'select-style': import("@typescript-eslint/utils/ts-eslint").RuleModule<"operator" | "method", readonly ["operator" | "method"], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
154
- 'use-consistent-global-store-name': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useConsistentGlobalStoreName" | "useConsistentGlobalStoreNameSuggest", readonly [string], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
105
+ 'avoid-combining-component-store-selectors': import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidCombiningComponentStoreSelectors", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
106
+ 'avoid-mapping-component-store-selectors': import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidMappingComponentStoreSelectors", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
107
+ 'updater-explicit-return-type': import("@typescript-eslint/utils/ts-eslint").RuleModule<"updaterExplicitReturnType", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
108
+ 'require-super-ondestroy': import("@typescript-eslint/utils/ts-eslint").RuleModule<"requireSuperOnDestroy", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
109
+ 'avoid-cyclic-effects': import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidCyclicEffects", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
110
+ 'no-dispatch-in-effects': import("@typescript-eslint/utils/ts-eslint").RuleModule<"noDispatchInEffects" | "noDispatchInEffectsSuggest", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
111
+ 'no-effects-in-providers': import("@typescript-eslint/utils/ts-eslint").RuleModule<"noEffectsInProviders", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
112
+ 'no-multiple-actions-in-effects': import("@typescript-eslint/utils/ts-eslint").RuleModule<"noMultipleActionsInEffects", readonly unknown[], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
113
+ 'prefer-action-creator-in-of-type': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferActionCreatorInOfType", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
114
+ 'prefer-effect-callback-in-block-statement': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferEffectCallbackInBlockStatement", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
115
+ 'use-effects-lifecycle-interface': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useEffectsLifecycleInterface", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
116
+ 'avoid-combining-selectors': import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidCombiningSelectors", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
117
+ 'avoid-dispatching-multiple-actions-sequentially': import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidDispatchingMultipleActionsSequentially", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
118
+ 'avoid-duplicate-actions-in-reducer': import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidDuplicateActionsInReducer" | "avoidDuplicateActionsInReducerSuggest", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
119
+ 'avoid-mapping-selectors': import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidMapppingSelectors", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
120
+ 'good-action-hygiene': import("@typescript-eslint/utils/ts-eslint").RuleModule<"goodActionHygiene", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
121
+ 'no-multiple-global-stores': import("@typescript-eslint/utils/ts-eslint").RuleModule<"noMultipleGlobalStores" | "noMultipleGlobalStoresSuggest", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
122
+ 'no-reducer-in-key-names': import("@typescript-eslint/utils/ts-eslint").RuleModule<"noReducerInKeyNames" | "noReducerInKeyNamesSuggest", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
123
+ 'no-store-subscription': import("@typescript-eslint/utils/ts-eslint").RuleModule<"noStoreSubscription", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
124
+ 'no-typed-global-store': import("@typescript-eslint/utils/ts-eslint").RuleModule<"noTypedStore" | "noTypedStoreSuggest", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
125
+ 'on-function-explicit-return-type': import("@typescript-eslint/utils/ts-eslint").RuleModule<"onFunctionExplicitReturnType" | "onFunctionExplicitReturnTypeSuggest", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
126
+ 'prefer-action-creator': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferActionCreator", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
127
+ 'prefer-action-creator-in-dispatch': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferActionCreatorInDispatch", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
128
+ 'prefer-inline-action-props': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferInlineActionProps" | "preferInlineActionPropsSuggest", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
129
+ 'prefer-one-generic-in-create-for-feature-selector': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferOneGenericInCreateForFeatureSelector" | "preferOneGenericInCreateForFeatureSelectorSuggest", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
130
+ 'prefer-selector-in-select': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferSelectorInSelect", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
131
+ 'prefix-selectors-with-select': import("@typescript-eslint/utils/ts-eslint").RuleModule<"prefixSelectorsWithSelect" | "prefixSelectorsWithSelectSuggest", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
132
+ 'select-style': import("@typescript-eslint/utils/ts-eslint").RuleModule<"operator" | "method", readonly ["operator" | "method"], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
133
+ 'use-consistent-global-store-name': import("@typescript-eslint/utils/ts-eslint").RuleModule<"useConsistentGlobalStoreName" | "useConsistentGlobalStoreNameSuggest", readonly [string], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
155
134
  'prefer-concat-latest-from': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferConcatLatestFrom", readonly [{
156
135
  readonly strict: boolean;
157
- }], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
158
- 'signal-state-no-arrays-at-root-level': import("@typescript-eslint/utils/ts-eslint").RuleModule<"signalStateNoArraysAtRootLevel", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
159
- 'signal-store-feature-should-use-generic-type': import("@typescript-eslint/utils/ts-eslint").RuleModule<"signalStoreFeatureShouldUseGenericType", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
160
- 'prefer-protected-state': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferProtectedState" | "preferProtectedStateSuggest", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
161
- 'with-state-no-arrays-at-root-level': import("@typescript-eslint/utils/ts-eslint").RuleModule<"withStateNoArraysAtRootLevel", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
162
- 'enforce-type-call': import("@typescript-eslint/utils/ts-eslint").RuleModule<"enforceTypeCall", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
136
+ }], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
137
+ 'signal-state-no-arrays-at-root-level': import("@typescript-eslint/utils/ts-eslint").RuleModule<"signalStateNoArraysAtRootLevel", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
138
+ 'signal-store-feature-should-use-generic-type': import("@typescript-eslint/utils/ts-eslint").RuleModule<"signalStoreFeatureShouldUseGenericType", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
139
+ 'prefer-protected-state': import("@typescript-eslint/utils/ts-eslint").RuleModule<"preferProtectedState" | "preferProtectedStateSuggest", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
140
+ 'with-state-no-arrays-at-root-level': import("@typescript-eslint/utils/ts-eslint").RuleModule<"withStateNoArraysAtRootLevel", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
141
+ 'enforce-type-call': import("@typescript-eslint/utils/ts-eslint").RuleModule<"enforceTypeCall", readonly [], import("./rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
163
142
  };
164
143
  };
165
144
  export = _default;
@@ -1,24 +1,8 @@
1
- import type { TSESLint } from '@typescript-eslint/utils';
2
- import type { NGRX_MODULE } from './utils';
3
- type Meta<TMessageIds extends string, TOptions extends readonly unknown[]> = TSESLint.RuleMetaData<TMessageIds, TOptions> & {
1
+ import { ESLintUtils } from '@typescript-eslint/utils';
2
+ import { NGRX_MODULE } from './utils';
3
+ export interface NgRxRuleDocs {
4
4
  ngrxModule: NGRX_MODULE;
5
- version?: string;
6
- docs: {
7
- requiresTypeChecking?: boolean;
8
- };
9
- };
10
- type CreateRuleMeta<TMessageIds extends string, TOptions extends readonly unknown[]> = {
11
- docs: Omit<TSESLint.RuleMetaDataDocs, 'url'> & {
12
- requiresTypeChecking?: boolean;
13
- };
14
- } & Omit<Meta<TMessageIds, TOptions>, 'docs'>;
15
- export type NgRxRuleModule<TOptions extends readonly unknown[], TMessageIds extends string> = Omit<TSESLint.RuleModule<TMessageIds, TOptions>, 'meta'> & {
16
- meta: Meta<TMessageIds, TOptions>;
17
- };
18
- export declare function createRule<TOptions extends readonly unknown[], TMessageIds extends string>(config: Readonly<{
19
- name: string;
20
- meta: CreateRuleMeta<TMessageIds, TOptions>;
21
- defaultOptions: Readonly<TOptions>;
22
- create: (context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>, optionsWithDefault: Readonly<TOptions>) => TSESLint.RuleListener;
23
- }>): TSESLint.RuleModule<TMessageIds, TOptions>;
24
- export {};
5
+ requiresTypeChecking?: boolean;
6
+ }
7
+ export type NgRxRule = ReturnType<ReturnType<typeof ESLintUtils.RuleCreator<NgRxRuleDocs>>>;
8
+ export declare const createRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, NgRxRuleDocs>>) => ESLintUtils.RuleModule<MessageIds, Options, NgRxRuleDocs, ESLintUtils.RuleListener>;
@@ -1,23 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createRule = createRule;
3
+ exports.createRule = void 0;
4
4
  const utils_1 = require("@typescript-eslint/utils");
5
- const utils_2 = require("./utils");
6
- function createRule(config) {
7
- const configOverwrite = {
8
- ...config,
9
- create: (context, optionsWithDefault) => {
10
- const { meta: { ngrxModule, version }, } = config;
11
- if (version !== undefined &&
12
- !(0, utils_2.ngrxVersionSatisfies)(utils_2.NGRX_MODULE_PATHS[ngrxModule], version)) {
13
- return {};
14
- }
15
- return config.create(context, optionsWithDefault);
16
- },
5
+ /**
6
+ * We need to patch the RuleCreator in order to preserve the defaultOptions
7
+ * to use as part of documentation generation.
8
+ */
9
+ const patchedRuleCreator = (urlCreator) => {
10
+ return function createRule({ name, meta, defaultOptions, create }) {
11
+ return {
12
+ meta: Object.assign(Object.assign({}, meta), {
13
+ docs: Object.assign(Object.assign({}, meta.docs), {
14
+ url: urlCreator(name),
15
+ }),
16
+ }),
17
+ defaultOptions,
18
+ create(context) {
19
+ const optionsWithDefault = utils_1.ESLintUtils.applyDefault(defaultOptions, context.options);
20
+ return create(context, optionsWithDefault);
21
+ },
22
+ };
17
23
  };
18
- for (const [key, message] of Object.entries(configOverwrite.meta.messages)) {
19
- configOverwrite.meta.messages[key] = `${message} (${(0, utils_2.docsUrl)(config.name)})`;
20
- }
21
- return utils_1.ESLintUtils.RuleCreator(utils_2.docsUrl)(configOverwrite);
22
- }
24
+ };
25
+ patchedRuleCreator.withoutDocs = utils_1.ESLintUtils.RuleCreator.withoutDocs;
26
+ exports.createRule = patchedRuleCreator((ruleName) => `https://ngrx.io/guide/eslint-plugin/rules/${ruleName}`);
23
27
  //# sourceMappingURL=rule-creator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rule-creator.js","sourceRoot":"","sources":["../../../../modules/eslint-plugin/src/rule-creator.ts"],"names":[],"mappings":";;AA2BA,gCAyCC;AAnED,oDAAuD;AAEvD,mCAA2E;AAwB3E,SAAgB,UAAU,CAIxB,MAQE;IAEF,MAAM,eAAe,GAAG;QACtB,GAAG,MAAM;QACT,MAAM,EAAE,CACN,OAA8D,EAC9D,kBAAsC,EACtC,EAAE;YACF,MAAM,EACJ,IAAI,EAAE,EAAE,UAAU,EAAE,OAAO,EAAE,GAC9B,GAAG,MAAM,CAAC;YACX,IACE,OAAO,KAAK,SAAS;gBACrB,CAAC,IAAA,4BAAoB,EAAC,yBAAiB,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC,EAC7D,CAAC;gBACD,OAAO,EAAE,CAAC;YACZ,CAAC;YAED,OAAO,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;QACpD,CAAC;KACF,CAAC;IAEF,KAAK,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC;QAC1E,eAAe,CAAC,IAAI,CAAC,QAAgB,CAAC,GAAG,CAAC,GAAG,GAAG,OAAO,KAAK,IAAA,eAAO,EAClE,MAAM,CAAC,IAAI,CACZ,GAAG,CAAC;IACP,CAAC;IAED,OAAO,mBAAW,CAAC,WAAW,CAAC,eAAO,CAAC,CAAC,eAAe,CAAC,CAAC;AAC3D,CAAC","sourcesContent":["import type { TSESLint } from '@typescript-eslint/utils';\nimport { ESLintUtils } from '@typescript-eslint/utils';\nimport type { NGRX_MODULE } from './utils';\nimport { docsUrl, ngrxVersionSatisfies, NGRX_MODULE_PATHS } from './utils';\n\ntype Meta<TMessageIds extends string, TOptions extends readonly unknown[]> =\n | TSESLint.RuleMetaData<TMessageIds, TOptions> & {\n ngrxModule: NGRX_MODULE;\n version?: string;\n docs: { requiresTypeChecking?: boolean };\n };\n\ntype CreateRuleMeta<\n TMessageIds extends string,\n TOptions extends readonly unknown[]\n> = {\n docs: Omit<TSESLint.RuleMetaDataDocs, 'url'> & {\n requiresTypeChecking?: boolean;\n };\n} & Omit<Meta<TMessageIds, TOptions>, 'docs'>;\nexport type NgRxRuleModule<\n TOptions extends readonly unknown[],\n TMessageIds extends string\n> = Omit<TSESLint.RuleModule<TMessageIds, TOptions>, 'meta'> & {\n meta: Meta<TMessageIds, TOptions>;\n};\n\nexport function createRule<\n TOptions extends readonly unknown[],\n TMessageIds extends string\n>(\n config: Readonly<{\n name: string;\n meta: CreateRuleMeta<TMessageIds, TOptions>;\n defaultOptions: Readonly<TOptions>;\n create: (\n context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>,\n optionsWithDefault: Readonly<TOptions>\n ) => TSESLint.RuleListener;\n }>\n): TSESLint.RuleModule<TMessageIds, TOptions> {\n const configOverwrite = {\n ...config,\n create: (\n context: Readonly<TSESLint.RuleContext<TMessageIds, TOptions>>,\n optionsWithDefault: Readonly<TOptions>\n ) => {\n const {\n meta: { ngrxModule, version },\n } = config;\n if (\n version !== undefined &&\n !ngrxVersionSatisfies(NGRX_MODULE_PATHS[ngrxModule], version)\n ) {\n return {};\n }\n\n return config.create(context, optionsWithDefault);\n },\n };\n\n for (const [key, message] of Object.entries(configOverwrite.meta.messages)) {\n (configOverwrite.meta.messages as any)[key] = `${message} (${docsUrl(\n config.name\n )})`;\n }\n\n return ESLintUtils.RuleCreator(docsUrl)(configOverwrite);\n}\n"]}
1
+ {"version":3,"file":"rule-creator.js","sourceRoot":"","sources":["../../../../modules/eslint-plugin/src/rule-creator.ts"],"names":[],"mappings":";;;AAAA,oDAAuD;AAYvD;;;GAGG;AACH,MAAM,kBAAkB,GAAmC,CAAC,UAAU,EAAE,EAAE;IACxE,OAAO,SAAS,UAAU,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE;QAC/D,OAAO;YACL,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,EAAE;gBAC3C,IAAI,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,IAAI,CAAC,IAAI,CAAC,EAAE;oBAChD,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC;iBACtB,CAAC;aACH,CAAC;YACF,cAAc;YACd,MAAM,CAAC,OAAO;gBACZ,MAAM,kBAAkB,GAAG,mBAAW,CAAC,YAAY,CACjD,cAAc,EACd,OAAO,CAAC,OAAO,CAChB,CAAC;gBACF,OAAO,MAAM,CAAC,OAAO,EAAE,kBAAkB,CAAC,CAAC;YAC7C,CAAC;SACF,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC,CAAC;AACF,kBAAkB,CAAC,WAAW,GAAG,mBAAW,CAAC,WAAW,CAAC,WAAW,CAAC;AAExD,QAAA,UAAU,GAAG,kBAAkB,CAC1C,CAAC,QAAQ,EAAE,EAAE,CAAC,6CAA6C,QAAQ,EAAE,CACtE,CAAC","sourcesContent":["import { ESLintUtils } from '@typescript-eslint/utils';\nimport { NGRX_MODULE } from './utils';\n\nexport interface NgRxRuleDocs {\n ngrxModule: NGRX_MODULE;\n requiresTypeChecking?: boolean;\n}\n\nexport type NgRxRule = ReturnType<\n ReturnType<typeof ESLintUtils.RuleCreator<NgRxRuleDocs>>\n>;\n\n/**\n * We need to patch the RuleCreator in order to preserve the defaultOptions\n * to use as part of documentation generation.\n */\nconst patchedRuleCreator: typeof ESLintUtils.RuleCreator = (urlCreator) => {\n return function createRule({ name, meta, defaultOptions, create }) {\n return {\n meta: Object.assign(Object.assign({}, meta), {\n docs: Object.assign(Object.assign({}, meta.docs), {\n url: urlCreator(name),\n }),\n }),\n defaultOptions,\n create(context) {\n const optionsWithDefault = ESLintUtils.applyDefault(\n defaultOptions,\n context.options\n );\n return create(context, optionsWithDefault);\n },\n };\n };\n};\npatchedRuleCreator.withoutDocs = ESLintUtils.RuleCreator.withoutDocs;\n\nexport const createRule = patchedRuleCreator<NgRxRuleDocs>(\n (ruleName) => `https://ngrx.io/guide/eslint-plugin/rules/${ruleName}`\n);\n"]}
@@ -1,3 +1,3 @@
1
1
  export declare const messageId = "avoidCombiningComponentStoreSelectors";
2
- declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidCombiningComponentStoreSelectors", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
2
+ declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidCombiningComponentStoreSelectors", readonly [], import("../../rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
3
3
  export default _default;
@@ -42,9 +42,9 @@ exports.default = (0, rule_creator_1.createRule)({
42
42
  name: path.parse(__filename).name,
43
43
  meta: {
44
44
  type: 'suggestion',
45
- ngrxModule: 'component-store',
46
45
  docs: {
47
46
  description: 'Prefer combining selectors at the selector level.',
47
+ ngrxModule: 'component-store',
48
48
  },
49
49
  schema: [],
50
50
  messages: {
@@ -1 +1 @@
1
- {"version":3,"file":"avoid-combining-component-store-selectors.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/component-store/avoid-combining-component-store-selectors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAA6B;AAC7B,qDAAgD;AAChD,uCAA0E;AAC7D,QAAA,SAAS,GAAG,uCAAuC,CAAC;AAIjE,kBAAe,IAAA,yBAAU,EAAsB;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE,iBAAiB;QAC7B,IAAI,EAAE;YACJ,WAAW,EAAE,mDAAmD;SACjE;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,CAAC,iBAAS,CAAC,EAAE,0CAA0C;SACxD;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;QAClB,MAAM,UAAU,GAAG,IAAA,kCAA0B,EAAC,OAAO,CAAC,CAAC;QAEvD,MAAM,WAAW,GAAG,oFAAoF,CAAC;QACzG,MAAM,YAAY,GAAG,UAAU,CAAC,CAAC,CAAC,IAAA,uBAAe,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAErE,MAAM,cAAc,GAA8B,EAAE,CAAC;QACrD,OAAO;YACL,CAAC,yFAAyF,WAAW,MAAM,WAAW,EAAE,CAAC,CACvH,IAA6B;gBAE7B,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC5B,CAAC;YACD,CAAC,+CAA+C,YAAY,MAAM,YAAY,EAAE,CAAC,CAC/E,IAA6B;gBAE7B,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC5B,CAAC;YACD,CAAC,kDAAkD,CAAC;gBAClD,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;oBAClC,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI;wBACJ,SAAS,EAAT,iBAAS;qBACV,CAAC,CAAC;gBACL,CAAC;gBACD,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;YAC5B,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import type { TSESTree } from '@typescript-eslint/utils';\nimport * as path from 'path';\nimport { createRule } from '../../rule-creator';\nimport { getNgrxComponentStoreNames, namedExpression } from '../../utils';\nexport const messageId = 'avoidCombiningComponentStoreSelectors';\ntype MessageIds = typeof messageId;\ntype Options = readonly [];\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'suggestion',\n ngrxModule: 'component-store',\n docs: {\n description: 'Prefer combining selectors at the selector level.',\n },\n schema: [],\n messages: {\n [messageId]: 'Combine selectors at the selector level.',\n },\n },\n defaultOptions: [],\n create: (context) => {\n const storeNames = getNgrxComponentStoreNames(context);\n\n const thisSelects = `CallExpression[callee.object.type='ThisExpression'][callee.property.name='select']`;\n const storeSelects = storeNames ? namedExpression(storeNames) : null;\n\n const selectsInArray: TSESTree.CallExpression[] = [];\n return {\n [`ClassDeclaration[superClass.name=/Store/] CallExpression[callee.name='combineLatest'] ${thisSelects} ~ ${thisSelects}`](\n node: TSESTree.CallExpression\n ) {\n selectsInArray.push(node);\n },\n [`CallExpression[callee.name='combineLatest'] ${storeSelects} ~ ${storeSelects}`](\n node: TSESTree.CallExpression\n ) {\n selectsInArray.push(node);\n },\n [`CallExpression[callee.name='combineLatest']:exit`]() {\n for (const node of selectsInArray) {\n context.report({\n node,\n messageId,\n });\n }\n selectsInArray.length = 0;\n },\n };\n },\n});\n"]}
1
+ {"version":3,"file":"avoid-combining-component-store-selectors.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/component-store/avoid-combining-component-store-selectors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAA6B;AAC7B,qDAAgD;AAChD,uCAA0E;AAC7D,QAAA,SAAS,GAAG,uCAAuC,CAAC;AAIjE,kBAAe,IAAA,yBAAU,EAAsB;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE;YACJ,WAAW,EAAE,mDAAmD;YAChE,UAAU,EAAE,iBAAiB;SAC9B;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,CAAC,iBAAS,CAAC,EAAE,0CAA0C;SACxD;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;QAClB,MAAM,UAAU,GAAG,IAAA,kCAA0B,EAAC,OAAO,CAAC,CAAC;QAEvD,MAAM,WAAW,GAAG,oFAAoF,CAAC;QACzG,MAAM,YAAY,GAAG,UAAU,CAAC,CAAC,CAAC,IAAA,uBAAe,EAAC,UAAU,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;QAErE,MAAM,cAAc,GAA8B,EAAE,CAAC;QACrD,OAAO;YACL,CAAC,yFAAyF,WAAW,MAAM,WAAW,EAAE,CAAC,CACvH,IAA6B;gBAE7B,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC5B,CAAC;YACD,CAAC,+CAA+C,YAAY,MAAM,YAAY,EAAE,CAAC,CAC/E,IAA6B;gBAE7B,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAC5B,CAAC;YACD,CAAC,kDAAkD,CAAC;gBAClD,KAAK,MAAM,IAAI,IAAI,cAAc,EAAE,CAAC;oBAClC,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI;wBACJ,SAAS,EAAT,iBAAS;qBACV,CAAC,CAAC;gBACL,CAAC;gBACD,cAAc,CAAC,MAAM,GAAG,CAAC,CAAC;YAC5B,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import type { TSESTree } from '@typescript-eslint/utils';\nimport * as path from 'path';\nimport { createRule } from '../../rule-creator';\nimport { getNgrxComponentStoreNames, namedExpression } from '../../utils';\nexport const messageId = 'avoidCombiningComponentStoreSelectors';\ntype MessageIds = typeof messageId;\ntype Options = readonly [];\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'suggestion',\n docs: {\n description: 'Prefer combining selectors at the selector level.',\n ngrxModule: 'component-store',\n },\n schema: [],\n messages: {\n [messageId]: 'Combine selectors at the selector level.',\n },\n },\n defaultOptions: [],\n create: (context) => {\n const storeNames = getNgrxComponentStoreNames(context);\n\n const thisSelects = `CallExpression[callee.object.type='ThisExpression'][callee.property.name='select']`;\n const storeSelects = storeNames ? namedExpression(storeNames) : null;\n\n const selectsInArray: TSESTree.CallExpression[] = [];\n return {\n [`ClassDeclaration[superClass.name=/Store/] CallExpression[callee.name='combineLatest'] ${thisSelects} ~ ${thisSelects}`](\n node: TSESTree.CallExpression\n ) {\n selectsInArray.push(node);\n },\n [`CallExpression[callee.name='combineLatest'] ${storeSelects} ~ ${storeSelects}`](\n node: TSESTree.CallExpression\n ) {\n selectsInArray.push(node);\n },\n [`CallExpression[callee.name='combineLatest']:exit`]() {\n for (const node of selectsInArray) {\n context.report({\n node,\n messageId,\n });\n }\n selectsInArray.length = 0;\n },\n };\n },\n});\n"]}
@@ -1,3 +1,3 @@
1
1
  export declare const messageId = "avoidMappingComponentStoreSelectors";
2
- declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidMappingComponentStoreSelectors", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
2
+ declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"avoidMappingComponentStoreSelectors", readonly [], import("../../rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
3
3
  export default _default;
@@ -42,9 +42,9 @@ exports.default = (0, rule_creator_1.createRule)({
42
42
  name: path.parse(__filename).name,
43
43
  meta: {
44
44
  type: 'problem',
45
- ngrxModule: 'component-store',
46
45
  docs: {
47
46
  description: 'Avoid mapping logic outside the selector level.',
47
+ ngrxModule: 'component-store',
48
48
  },
49
49
  schema: [],
50
50
  messages: {
@@ -1 +1 @@
1
- {"version":3,"file":"avoid-mapping-component-store-selectors.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/component-store/avoid-mapping-component-store-selectors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAA6B;AAC7B,qDAAgD;AAChD,uCAGqB;AAER,QAAA,SAAS,GAAG,qCAAqC,CAAC;AAK/D,kBAAe,IAAA,yBAAU,EAAsB;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,UAAU,EAAE,iBAAiB;QAC7B,IAAI,EAAE;YACJ,WAAW,EAAE,iDAAiD;SAC/D;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,CAAC,iBAAS,CAAC,EAAE,0CAA0C;SACxD;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;QAClB,MAAM,UAAU,GAAG,IAAA,kCAA0B,EAAC,OAAO,CAAC,CAAC;QAEvD,MAAM,mBAAmB,GAAG,+DAA+D,CAAC;QAC5F,MAAM,SAAS,GAAG;YAChB,mJAAmJ,mBAAmB,EAAE;YACxK,UAAU;gBACR,GAAG,IAAA,+BAAuB,EAAC,UAAU,CAAC,GAAG,mBAAmB,EAAE;SACjE;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,CAAC;QAEb,OAAO;YACL,CAAC,SAAS,CAAC,CAAC,IAAsC;gBAChD,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,SAAS,EAAT,iBAAS;iBACV,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import type { TSESTree } from '@typescript-eslint/utils';\nimport * as path from 'path';\nimport { createRule } from '../../rule-creator';\nimport {\n getNgrxComponentStoreNames,\n namedCallableExpression,\n} from '../../utils';\n\nexport const messageId = 'avoidMappingComponentStoreSelectors';\n\ntype MessageIds = typeof messageId;\ntype Options = readonly [];\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'problem',\n ngrxModule: 'component-store',\n docs: {\n description: 'Avoid mapping logic outside the selector level.',\n },\n schema: [],\n messages: {\n [messageId]: 'Map logic at the selector level instead.',\n },\n },\n defaultOptions: [],\n create: (context) => {\n const storeNames = getNgrxComponentStoreNames(context);\n\n const mapOperatorSelector = `[callee.property.name=pipe] > CallExpression[callee.name=map]`;\n const selectors = [\n `ClassDeclaration[superClass.name=/Store/] CallExpression:has(CallExpression[callee.object.type='ThisExpression'][callee.property.name='select'])${mapOperatorSelector}`,\n storeNames &&\n `${namedCallableExpression(storeNames)}${mapOperatorSelector}`,\n ]\n .filter(Boolean)\n .join(',');\n\n return {\n [selectors](node: TSESTree.ArrowFunctionExpression) {\n context.report({\n node,\n messageId,\n });\n },\n };\n },\n});\n"]}
1
+ {"version":3,"file":"avoid-mapping-component-store-selectors.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/component-store/avoid-mapping-component-store-selectors.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAA6B;AAC7B,qDAAgD;AAChD,uCAGqB;AAER,QAAA,SAAS,GAAG,qCAAqC,CAAC;AAK/D,kBAAe,IAAA,yBAAU,EAAsB;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,iDAAiD;YAC9D,UAAU,EAAE,iBAAiB;SAC9B;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,CAAC,iBAAS,CAAC,EAAE,0CAA0C;SACxD;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;QAClB,MAAM,UAAU,GAAG,IAAA,kCAA0B,EAAC,OAAO,CAAC,CAAC;QAEvD,MAAM,mBAAmB,GAAG,+DAA+D,CAAC;QAC5F,MAAM,SAAS,GAAG;YAChB,mJAAmJ,mBAAmB,EAAE;YACxK,UAAU;gBACR,GAAG,IAAA,+BAAuB,EAAC,UAAU,CAAC,GAAG,mBAAmB,EAAE;SACjE;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,CAAC;QAEb,OAAO;YACL,CAAC,SAAS,CAAC,CAAC,IAAsC;gBAChD,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,SAAS,EAAT,iBAAS;iBACV,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import type { TSESTree } from '@typescript-eslint/utils';\nimport * as path from 'path';\nimport { createRule } from '../../rule-creator';\nimport {\n getNgrxComponentStoreNames,\n namedCallableExpression,\n} from '../../utils';\n\nexport const messageId = 'avoidMappingComponentStoreSelectors';\n\ntype MessageIds = typeof messageId;\ntype Options = readonly [];\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'problem',\n docs: {\n description: 'Avoid mapping logic outside the selector level.',\n ngrxModule: 'component-store',\n },\n schema: [],\n messages: {\n [messageId]: 'Map logic at the selector level instead.',\n },\n },\n defaultOptions: [],\n create: (context) => {\n const storeNames = getNgrxComponentStoreNames(context);\n\n const mapOperatorSelector = `[callee.property.name=pipe] > CallExpression[callee.name=map]`;\n const selectors = [\n `ClassDeclaration[superClass.name=/Store/] CallExpression:has(CallExpression[callee.object.type='ThisExpression'][callee.property.name='select'])${mapOperatorSelector}`,\n storeNames &&\n `${namedCallableExpression(storeNames)}${mapOperatorSelector}`,\n ]\n .filter(Boolean)\n .join(',');\n\n return {\n [selectors](node: TSESTree.ArrowFunctionExpression) {\n context.report({\n node,\n messageId,\n });\n },\n };\n },\n});\n"]}
@@ -1,3 +1,3 @@
1
1
  export declare const messageId = "requireSuperOnDestroy";
2
- declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"requireSuperOnDestroy", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
2
+ declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"requireSuperOnDestroy", readonly [], import("../../rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
3
3
  export default _default;
@@ -41,9 +41,9 @@ exports.default = (0, rule_creator_1.createRule)({
41
41
  name: path.parse(__filename).name,
42
42
  meta: {
43
43
  type: 'problem',
44
- ngrxModule: 'component-store',
45
44
  docs: {
46
45
  description: 'Overriden ngOnDestroy method in component stores require a call to super.ngOnDestroy().',
46
+ ngrxModule: 'component-store',
47
47
  },
48
48
  schema: [],
49
49
  messages: {
@@ -1 +1 @@
1
- {"version":3,"file":"require-super-ondestroy.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/component-store/require-super-ondestroy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAC7B,qDAAgD;AAGnC,QAAA,SAAS,GAAG,uBAAuB,CAAC;AAIjD,kBAAe,IAAA,yBAAU,EAAsB;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,UAAU,EAAE,iBAAiB;QAC7B,IAAI,EAAE;YACJ,WAAW,EACT,yFAAyF;SAC5F;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,CAAC,iBAAS,CAAC,EACT,yEAAyE;SAC5E;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;QAClB,MAAM,yBAAyB,GAAG,0CAA0C,CAAC;QAC7E,MAAM,uBAAuB,GAAG,gBAAgB,CAAC;QAEjD,IAAI,2BAA2B,GAAG,KAAK,CAAC;QAExC,OAAO;YACL,CAAC,0FAA0F,uBAAuB,IAAI,CAAC,CACrH,CAA2B;gBAE3B,2BAA2B,GAAG,IAAI,CAAC;YACrC,CAAC;YACD,CAAC,oCAAoC,uBAAuB,KAAK,yBAAyB,mGAAmG,CAAC,CAC5L,IAAyB;gBAEzB,IAAI,CAAC,2BAA2B,EAAE,CAAC;oBACjC,OAAO;gBACT,CAAC;gBAED,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,SAAS,EAAT,iBAAS;iBACV,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import * as path from 'path';\nimport { createRule } from '../../rule-creator';\nimport { TSESTree } from '@typescript-eslint/types';\n\nexport const messageId = 'requireSuperOnDestroy';\ntype MessageIds = typeof messageId;\ntype Options = readonly [];\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'problem',\n ngrxModule: 'component-store',\n docs: {\n description:\n 'Overriden ngOnDestroy method in component stores require a call to super.ngOnDestroy().',\n },\n schema: [],\n messages: {\n [messageId]:\n \"Call super.ngOnDestroy() inside a component store's ngOnDestroy method.\",\n },\n },\n defaultOptions: [],\n create: (context) => {\n const ngOnDestroyMethodSelector = `MethodDefinition[key.name='ngOnDestroy']`;\n const componentStoreClassName = 'ComponentStore';\n\n let hasNgrxComponentStoreImport = false;\n\n return {\n [`ImportDeclaration[source.value='@ngrx/component-store'] ImportSpecifier[imported.name='${componentStoreClassName}']`](\n _: TSESTree.ImportSpecifier\n ) {\n hasNgrxComponentStoreImport = true;\n },\n [`ClassDeclaration[superClass.name=${componentStoreClassName}] ${ngOnDestroyMethodSelector}:not(:has(CallExpression[callee.object.type='Super'][callee.property.name='ngOnDestroy'])) > .key`](\n node: TSESTree.Identifier\n ) {\n if (!hasNgrxComponentStoreImport) {\n return;\n }\n\n context.report({\n node,\n messageId,\n });\n },\n };\n },\n});\n"]}
1
+ {"version":3,"file":"require-super-ondestroy.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/component-store/require-super-ondestroy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAC7B,qDAAgD;AAGnC,QAAA,SAAS,GAAG,uBAAuB,CAAC;AAIjD,kBAAe,IAAA,yBAAU,EAAsB;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,yFAAyF;YAC3F,UAAU,EAAE,iBAAiB;SAC9B;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,CAAC,iBAAS,CAAC,EACT,yEAAyE;SAC5E;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;QAClB,MAAM,yBAAyB,GAAG,0CAA0C,CAAC;QAC7E,MAAM,uBAAuB,GAAG,gBAAgB,CAAC;QAEjD,IAAI,2BAA2B,GAAG,KAAK,CAAC;QAExC,OAAO;YACL,CAAC,0FAA0F,uBAAuB,IAAI,CAAC,CACrH,CAA2B;gBAE3B,2BAA2B,GAAG,IAAI,CAAC;YACrC,CAAC;YACD,CAAC,oCAAoC,uBAAuB,KAAK,yBAAyB,mGAAmG,CAAC,CAC5L,IAAyB;gBAEzB,IAAI,CAAC,2BAA2B,EAAE,CAAC;oBACjC,OAAO;gBACT,CAAC;gBAED,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,SAAS,EAAT,iBAAS;iBACV,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import * as path from 'path';\nimport { createRule } from '../../rule-creator';\nimport { TSESTree } from '@typescript-eslint/types';\n\nexport const messageId = 'requireSuperOnDestroy';\ntype MessageIds = typeof messageId;\ntype Options = readonly [];\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'problem',\n docs: {\n description:\n 'Overriden ngOnDestroy method in component stores require a call to super.ngOnDestroy().',\n ngrxModule: 'component-store',\n },\n schema: [],\n messages: {\n [messageId]:\n \"Call super.ngOnDestroy() inside a component store's ngOnDestroy method.\",\n },\n },\n defaultOptions: [],\n create: (context) => {\n const ngOnDestroyMethodSelector = `MethodDefinition[key.name='ngOnDestroy']`;\n const componentStoreClassName = 'ComponentStore';\n\n let hasNgrxComponentStoreImport = false;\n\n return {\n [`ImportDeclaration[source.value='@ngrx/component-store'] ImportSpecifier[imported.name='${componentStoreClassName}']`](\n _: TSESTree.ImportSpecifier\n ) {\n hasNgrxComponentStoreImport = true;\n },\n [`ClassDeclaration[superClass.name=${componentStoreClassName}] ${ngOnDestroyMethodSelector}:not(:has(CallExpression[callee.object.type='Super'][callee.property.name='ngOnDestroy'])) > .key`](\n node: TSESTree.Identifier\n ) {\n if (!hasNgrxComponentStoreImport) {\n return;\n }\n\n context.report({\n node,\n messageId,\n });\n },\n };\n },\n});\n"]}
@@ -1,3 +1,3 @@
1
1
  export declare const messageId = "updaterExplicitReturnType";
2
- declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"updaterExplicitReturnType", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
2
+ declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"updaterExplicitReturnType", readonly [], import("../../rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
3
3
  export default _default;
@@ -42,9 +42,9 @@ exports.default = (0, rule_creator_1.createRule)({
42
42
  name: path.parse(__filename).name,
43
43
  meta: {
44
44
  type: 'problem',
45
- ngrxModule: 'component-store',
46
45
  docs: {
47
46
  description: '`Updater` should have an explicit return type.',
47
+ ngrxModule: 'component-store',
48
48
  },
49
49
  schema: [],
50
50
  messages: {
@@ -1 +1 @@
1
- {"version":3,"file":"updater-explicit-return-type.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/component-store/updater-explicit-return-type.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAA6B;AAC7B,qDAAgD;AAChD,uCAA0E;AAE7D,QAAA,SAAS,GAAG,2BAA2B,CAAC;AAKrD,kBAAe,IAAA,yBAAU,EAAsB;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,UAAU,EAAE,iBAAiB;QAC7B,IAAI,EAAE;YACJ,WAAW,EAAE,gDAAgD;SAC9D;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,CAAC,iBAAS,CAAC,EACT,6HAA6H;SAChI;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;QAClB,MAAM,UAAU,GAAG,IAAA,kCAA0B,EAAC,OAAO,CAAC,CAAC;QACvD,MAAM,qBAAqB,GAAG,0DAA0D,CAAC;QACzF,MAAM,SAAS,GAAG;YAChB,mIAAmI,qBAAqB,EAAE;YAC1J,UAAU;gBACR,GAAG,IAAA,uBAAe,EAChB,UAAU,CACX,sCAAsC,qBAAqB,EAAE;SACjE;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,CAAC;QAEb,OAAO;YACL,CAAC,SAAS,CAAC,CAAC,IAAsC;gBAChD,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,SAAS,EAAT,iBAAS;iBACV,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import type { TSESTree } from '@typescript-eslint/utils';\nimport * as path from 'path';\nimport { createRule } from '../../rule-creator';\nimport { getNgrxComponentStoreNames, namedExpression } from '../../utils';\n\nexport const messageId = 'updaterExplicitReturnType';\n\ntype MessageIds = typeof messageId;\ntype Options = readonly [];\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'problem',\n ngrxModule: 'component-store',\n docs: {\n description: '`Updater` should have an explicit return type.',\n },\n schema: [],\n messages: {\n [messageId]:\n '`Updater` should have an explicit return type when using arrow functions: `this.store.updater((state, value): State => {}`.',\n },\n },\n defaultOptions: [],\n create: (context) => {\n const storeNames = getNgrxComponentStoreNames(context);\n const withoutTypeAnnotation = `ArrowFunctionExpression:not([returnType.typeAnnotation])`;\n const selectors = [\n `ClassDeclaration[superClass.name=/Store/] CallExpression[callee.object.type='ThisExpression'][callee.property.name='updater'] > ${withoutTypeAnnotation}`,\n storeNames &&\n `${namedExpression(\n storeNames\n )}[callee.property.name='updater'] > ${withoutTypeAnnotation}`,\n ]\n .filter(Boolean)\n .join(',');\n\n return {\n [selectors](node: TSESTree.ArrowFunctionExpression) {\n context.report({\n node,\n messageId,\n });\n },\n };\n },\n});\n"]}
1
+ {"version":3,"file":"updater-explicit-return-type.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/component-store/updater-explicit-return-type.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAA6B;AAC7B,qDAAgD;AAChD,uCAA0E;AAE7D,QAAA,SAAS,GAAG,2BAA2B,CAAC;AAKrD,kBAAe,IAAA,yBAAU,EAAsB;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,gDAAgD;YAC7D,UAAU,EAAE,iBAAiB;SAC9B;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,CAAC,iBAAS,CAAC,EACT,6HAA6H;SAChI;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;QAClB,MAAM,UAAU,GAAG,IAAA,kCAA0B,EAAC,OAAO,CAAC,CAAC;QACvD,MAAM,qBAAqB,GAAG,0DAA0D,CAAC;QACzF,MAAM,SAAS,GAAG;YAChB,mIAAmI,qBAAqB,EAAE;YAC1J,UAAU;gBACR,GAAG,IAAA,uBAAe,EAChB,UAAU,CACX,sCAAsC,qBAAqB,EAAE;SACjE;aACE,MAAM,CAAC,OAAO,CAAC;aACf,IAAI,CAAC,GAAG,CAAC,CAAC;QAEb,OAAO;YACL,CAAC,SAAS,CAAC,CAAC,IAAsC;gBAChD,OAAO,CAAC,MAAM,CAAC;oBACb,IAAI;oBACJ,SAAS,EAAT,iBAAS;iBACV,CAAC,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import type { TSESTree } from '@typescript-eslint/utils';\nimport * as path from 'path';\nimport { createRule } from '../../rule-creator';\nimport { getNgrxComponentStoreNames, namedExpression } from '../../utils';\n\nexport const messageId = 'updaterExplicitReturnType';\n\ntype MessageIds = typeof messageId;\ntype Options = readonly [];\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'problem',\n docs: {\n description: '`Updater` should have an explicit return type.',\n ngrxModule: 'component-store',\n },\n schema: [],\n messages: {\n [messageId]:\n '`Updater` should have an explicit return type when using arrow functions: `this.store.updater((state, value): State => {}`.',\n },\n },\n defaultOptions: [],\n create: (context) => {\n const storeNames = getNgrxComponentStoreNames(context);\n const withoutTypeAnnotation = `ArrowFunctionExpression:not([returnType.typeAnnotation])`;\n const selectors = [\n `ClassDeclaration[superClass.name=/Store/] CallExpression[callee.object.type='ThisExpression'][callee.property.name='updater'] > ${withoutTypeAnnotation}`,\n storeNames &&\n `${namedExpression(\n storeNames\n )}[callee.property.name='updater'] > ${withoutTypeAnnotation}`,\n ]\n .filter(Boolean)\n .join(',');\n\n return {\n [selectors](node: TSESTree.ArrowFunctionExpression) {\n context.report({\n node,\n messageId,\n });\n },\n };\n },\n});\n"]}
@@ -1,4 +1,4 @@
1
1
  import { ESLintUtils } from '@typescript-eslint/utils';
2
2
  export declare const messageId = "avoidCyclicEffects";
3
- declare const _default: ESLintUtils.RuleModule<"avoidCyclicEffects", readonly [], unknown, ESLintUtils.RuleListener>;
3
+ declare const _default: ESLintUtils.RuleModule<"avoidCyclicEffects", readonly [], import("../../rule-creator").NgRxRuleDocs, ESLintUtils.RuleListener>;
4
4
  export default _default;
@@ -47,9 +47,9 @@ exports.default = (0, rule_creator_1.createRule)({
47
47
  name: path.parse(__filename).name,
48
48
  meta: {
49
49
  type: 'problem',
50
- ngrxModule: 'effects',
51
50
  docs: {
52
51
  description: 'Avoid `Effect` that re-emit filtered actions.',
52
+ ngrxModule: 'effects',
53
53
  requiresTypeChecking: true,
54
54
  },
55
55
  schema: [],
@@ -1 +1 @@
1
- {"version":3,"file":"avoid-cyclic-effects.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/effects/avoid-cyclic-effects.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsE;AACtE,2CAA6B;AAC7B,+CAAiC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AY,CAAC,UAAU,CAAC,KAAK,QAAQ,EAAE,CAAC;gBACtD,OAAO,EAAE,CAAC;YACZ,CAAC;YACD,OAAO,CAAC,WAAW,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC;QAChD,CAAC;QAED,IAAI,SAAS,GAAG,IAAI,CAAC;QACrB,OAAO;YACL,CAAC,GAAG,8BAAsB,qJAAqJ,YAAY,GAAG,CAAC,CAC7L,IAAI;gBAEJ,IAAI,SAAS,EAAE,CAAC;oBACd,SAAS,CAAC,IAAI,CAAC,CAAC;oBAChB,SAAS,GAAG,KAAK,CAAC;oBAClB,OAAO;gBACT,CAAC;YACH,CAAC;YAED,CAAC,GAAG,8BAAsB,4HAA4H,CAAC;gBACrJ,SAAS,GAAG,IAAI,CAAC;YACnB,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { ESLintUtils, type TSESTree } from '@typescript-eslint/utils';\nimport * as path from 'path';\nimport * as ts from 'typescript';\nimport { createRule } from '../../rule-creator';\nimport {\n asPattern,\n createEffectExpression,\n getNgRxEffectActions,\n isCallExpression,\n isIdentifier,\n isTypeReference,\n} from '../../utils';\n\nexport const messageId = 'avoidCyclicEffects';\n\ntype MessageIds = typeof messageId;\ntype Options = readonly [];\n\n// This rule is a modified version (to support dispatch: false) from the eslint-plugin-rxjs plugin.\n// The original implementation can be found at https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-cyclic-action.ts\n// Thank you Nicholas Jamieson (@cartant).\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'problem',\n ngrxModule: 'effects',\n docs: {\n description: 'Avoid `Effect` that re-emit filtered actions.',\n requiresTypeChecking: true,\n },\n schema: [],\n messages: {\n [messageId]: '`Effect` that re-emit filtered actions are forbidden.',\n },\n },\n defaultOptions: [],\n create: (context) => {\n const { identifiers = [] } = getNgRxEffectActions(context);\n const actionsNames = identifiers.length > 0 ? asPattern(identifiers) : null;\n\n if (!actionsNames) {\n return {};\n }\n\n const services = ESLintUtils.getParserServices(context);\n const typeChecker = services.program.getTypeChecker();\n\n function checkNode(pipeCallExpression: TSESTree.CallExpression) {\n const operatorCallExpression = pipeCallExpression.arguments.find(\n (arg) =>\n isCallExpression(arg) &&\n isIdentifier(arg.callee) &&\n arg.callee.name === 'ofType'\n );\n if (!operatorCallExpression) {\n return;\n }\n const operatorType = services.getTypeAtLocation(operatorCallExpression);\n const [signature] = typeChecker.getSignaturesOfType(\n operatorType,\n ts.SignatureKind.Call\n );\n\n if (!signature) {\n return;\n }\n const operatorReturnType =\n typeChecker.getReturnTypeOfSignature(signature);\n if (!isTypeReference(operatorReturnType)) {\n return;\n }\n const [operatorElementType] =\n typeChecker.getTypeArguments(operatorReturnType);\n if (!operatorElementType) {\n return;\n }\n\n const pipeType = services.getTypeAtLocation(pipeCallExpression);\n if (!isTypeReference(pipeType)) {\n return;\n }\n const [pipeElementType] = typeChecker.getTypeArguments(pipeType);\n if (!pipeElementType) {\n return;\n }\n\n const operatorActionTypes = getActionTypes(operatorElementType);\n const pipeActionTypes = getActionTypes(pipeElementType);\n\n for (const actionType of operatorActionTypes) {\n if (pipeActionTypes.includes(actionType)) {\n context.report({\n node: pipeCallExpression.callee,\n messageId,\n });\n return;\n }\n }\n }\n\n function getActionType(symbol: ts.Symbol): ts.Type | null {\n const { valueDeclaration } = symbol;\n\n if (!valueDeclaration) {\n return null;\n }\n\n if (valueDeclaration.kind === ts.SyntaxKind.PropertyDeclaration) {\n const { parent } = symbol as typeof symbol & { parent: ts.Symbol };\n return parent.valueDeclaration\n ? typeChecker.getTypeOfSymbolAtLocation(\n parent,\n parent.valueDeclaration\n )\n : null;\n }\n\n return typeChecker.getTypeOfSymbolAtLocation(symbol, valueDeclaration);\n }\n\n function getActionTypes(type: ts.Type): string[] {\n if (type.isUnion()) {\n const memberActionTypes: string[] = [];\n for (const memberType of type.types) {\n memberActionTypes.push(...getActionTypes(memberType));\n }\n return memberActionTypes;\n }\n\n const symbol = typeChecker.getPropertyOfType(type, 'type');\n\n if (!symbol) {\n return [];\n }\n\n const actionType = getActionType(symbol);\n\n if (!actionType) {\n return [];\n }\n\n // TODO: support \"dynamic\" types\n // e.g. const genericFoo = createAction(`${subject} FOO`); (resolves to 'string')\n if (typeChecker.typeToString(actionType) === 'string') {\n return [];\n }\n return [typeChecker.typeToString(actionType)];\n }\n\n let firstPipe = true;\n return {\n [`${createEffectExpression}:not([arguments.1]:has(Property[key.name='dispatch'][value.value=false])) CallExpression[callee.property.name='pipe'][callee.object.property.name=${actionsNames}]`](\n node\n ) {\n if (firstPipe) {\n checkNode(node);\n firstPipe = false;\n return;\n }\n },\n\n [`${createEffectExpression}:not([arguments.1]:has(Property[key.name='dispatch'][value.value=false])) CallExpression[callee.property.name='pipe']:exit`]() {\n firstPipe = true;\n },\n };\n },\n});\n"]}
1
+ {"version":3,"file":"avoid-cyclic-effects.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/effects/avoid-cyclic-effects.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsE;AACtE,2CAA6B;AAC7B,+CAAiC;AACjC,qDAAgD;AAChD,uCAOqB;AAER,QAAA,SAAS,GAAG,oBAAoB,CAAC;AAK9C,mGAAmG;AACnG,uIAAuI;AACvI,0CAA0C;AAE1C,kBAAe,IAAA,yBAAU,EAAsB;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EAAE,+CAA+C;YAC5D,UAAU,EAAE,SAAS;YACrB,oBAAoB,EAAE,IAAI;SAC3B;QACD,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,CAAC,iBAAS,CAAC,EAAE,uDAAuD;SACrE;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,CAAC,O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F,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import { ESLintUtils, type TSESTree } from '@typescript-eslint/utils';\nimport * as path from 'path';\nimport * as ts from 'typescript';\nimport { createRule } from '../../rule-creator';\nimport {\n asPattern,\n createEffectExpression,\n getNgRxEffectActions,\n isCallExpression,\n isIdentifier,\n isTypeReference,\n} from '../../utils';\n\nexport const messageId = 'avoidCyclicEffects';\n\ntype MessageIds = typeof messageId;\ntype Options = readonly [];\n\n// This rule is a modified version (to support dispatch: false) from the eslint-plugin-rxjs plugin.\n// The original implementation can be found at https://github.com/cartant/eslint-plugin-rxjs/blob/main/source/rules/no-cyclic-action.ts\n// Thank you Nicholas Jamieson (@cartant).\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'problem',\n docs: {\n description: 'Avoid `Effect` that re-emit filtered actions.',\n ngrxModule: 'effects',\n requiresTypeChecking: true,\n },\n schema: [],\n messages: {\n [messageId]: '`Effect` that re-emit filtered actions are forbidden.',\n },\n },\n defaultOptions: [],\n create: (context) => {\n const { identifiers = [] } = getNgRxEffectActions(context);\n const actionsNames = identifiers.length > 0 ? asPattern(identifiers) : null;\n\n if (!actionsNames) {\n return {};\n }\n\n const services = ESLintUtils.getParserServices(context);\n const typeChecker = services.program.getTypeChecker();\n\n function checkNode(pipeCallExpression: TSESTree.CallExpression) {\n const operatorCallExpression = pipeCallExpression.arguments.find(\n (arg) =>\n isCallExpression(arg) &&\n isIdentifier(arg.callee) &&\n arg.callee.name === 'ofType'\n );\n if (!operatorCallExpression) {\n return;\n }\n const operatorType = services.getTypeAtLocation(operatorCallExpression);\n const [signature] = typeChecker.getSignaturesOfType(\n operatorType,\n ts.SignatureKind.Call\n );\n\n if (!signature) {\n return;\n }\n const operatorReturnType =\n typeChecker.getReturnTypeOfSignature(signature);\n if (!isTypeReference(operatorReturnType)) {\n return;\n }\n const [operatorElementType] =\n typeChecker.getTypeArguments(operatorReturnType);\n if (!operatorElementType) {\n return;\n }\n\n const pipeType = services.getTypeAtLocation(pipeCallExpression);\n if (!isTypeReference(pipeType)) {\n return;\n }\n const [pipeElementType] = typeChecker.getTypeArguments(pipeType);\n if (!pipeElementType) {\n return;\n }\n\n const operatorActionTypes = getActionTypes(operatorElementType);\n const pipeActionTypes = getActionTypes(pipeElementType);\n\n for (const actionType of operatorActionTypes) {\n if (pipeActionTypes.includes(actionType)) {\n context.report({\n node: pipeCallExpression.callee,\n messageId,\n });\n return;\n }\n }\n }\n\n function getActionType(symbol: ts.Symbol): ts.Type | null {\n const { valueDeclaration } = symbol;\n\n if (!valueDeclaration) {\n return null;\n }\n\n if (valueDeclaration.kind === ts.SyntaxKind.PropertyDeclaration) {\n const { parent } = symbol as typeof symbol & { parent: ts.Symbol };\n return parent.valueDeclaration\n ? typeChecker.getTypeOfSymbolAtLocation(\n parent,\n parent.valueDeclaration\n )\n : null;\n }\n\n return typeChecker.getTypeOfSymbolAtLocation(symbol, valueDeclaration);\n }\n\n function getActionTypes(type: ts.Type): string[] {\n if (type.isUnion()) {\n const memberActionTypes: string[] = [];\n for (const memberType of type.types) {\n memberActionTypes.push(...getActionTypes(memberType));\n }\n return memberActionTypes;\n }\n\n const symbol = typeChecker.getPropertyOfType(type, 'type');\n\n if (!symbol) {\n return [];\n }\n\n const actionType = getActionType(symbol);\n\n if (!actionType) {\n return [];\n }\n\n // TODO: support \"dynamic\" types\n // e.g. const genericFoo = createAction(`${subject} FOO`); (resolves to 'string')\n if (typeChecker.typeToString(actionType) === 'string') {\n return [];\n }\n return [typeChecker.typeToString(actionType)];\n }\n\n let firstPipe = true;\n return {\n [`${createEffectExpression}:not([arguments.1]:has(Property[key.name='dispatch'][value.value=false])) CallExpression[callee.property.name='pipe'][callee.object.property.name=${actionsNames}]`](\n node\n ) {\n if (firstPipe) {\n checkNode(node);\n firstPipe = false;\n return;\n }\n },\n\n [`${createEffectExpression}:not([arguments.1]:has(Property[key.name='dispatch'][value.value=false])) CallExpression[callee.property.name='pipe']:exit`]() {\n firstPipe = true;\n },\n };\n },\n});\n"]}
@@ -1,5 +1,5 @@
1
1
  export declare const noDispatchInEffects = "noDispatchInEffects";
2
2
  export declare const noDispatchInEffectsSuggest = "noDispatchInEffectsSuggest";
3
3
  type MessageIds = typeof noDispatchInEffects | typeof noDispatchInEffectsSuggest;
4
- declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
4
+ declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<MessageIds, readonly [], import("../../rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
5
5
  export default _default;
@@ -43,10 +43,10 @@ exports.default = (0, rule_creator_1.createRule)({
43
43
  name: path.parse(__filename).name,
44
44
  meta: {
45
45
  type: 'suggestion',
46
- ngrxModule: 'effects',
47
46
  hasSuggestions: true,
48
47
  docs: {
49
48
  description: '`Effect` should not call `store.dispatch`.',
49
+ ngrxModule: 'effects',
50
50
  },
51
51
  schema: [],
52
52
  messages: {
@@ -1 +1 @@
1
- {"version":3,"file":"no-dispatch-in-effects.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/effects/no-dispatch-in-effects.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAA6B;AAC7B,qDAAgD;AAChD,uCAMqB;AAER,QAAA,mBAAmB,GAAG,qBAAqB,CAAC;AAC5C,QAAA,0BAA0B,GAAG,4BAA4B,CAAC;AAUvE,kBAAe,IAAA,yBAAU,EAAsB;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,YAAY;QAClB,UAAU,EAAE,SAAS;QACrB,cAAc,EAAE,IAAI;QACpB,IAAI,EAAE;YACJ,WAAW,EAAE,4CAA4C;SAC1D;QACD,MAAM,EAAE,EAAE;QACV,QAAQ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ript-eslint/utils';\nimport * as path from 'path';\nimport { createRule } from '../../rule-creator';\nimport {\n asPattern,\n dispatchInEffects,\n getNgRxStores,\n isArrowFunctionExpression,\n isReturnStatement,\n} from '../../utils';\n\nexport const noDispatchInEffects = 'noDispatchInEffects';\nexport const noDispatchInEffectsSuggest = 'noDispatchInEffectsSuggest';\n\ntype MessageIds =\n | typeof noDispatchInEffects\n | typeof noDispatchInEffectsSuggest;\ntype Options = readonly [];\ntype MemberExpressionWithinCallExpression = TSESTree.MemberExpression & {\n parent: TSESTree.CallExpression;\n};\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'suggestion',\n ngrxModule: 'effects',\n hasSuggestions: true,\n docs: {\n description: '`Effect` should not call `store.dispatch`.',\n },\n schema: [],\n messages: {\n [noDispatchInEffects]:\n 'Calling `store.dispatch` in `Effect` is forbidden.',\n [noDispatchInEffectsSuggest]: 'Remove `store.dispatch`.',\n },\n },\n defaultOptions: [],\n create: (context) => {\n const { identifiers = [] } = getNgRxStores(context);\n const storeNames = identifiers.length > 0 ? asPattern(identifiers) : null;\n\n if (!storeNames) {\n return {};\n }\n\n return {\n [dispatchInEffects(storeNames)](\n node: MemberExpressionWithinCallExpression\n ) {\n const nodeToReport = getNodeToReport(node);\n context.report({\n node: nodeToReport,\n messageId: noDispatchInEffects,\n suggest: [\n {\n messageId: noDispatchInEffectsSuggest,\n fix: (fixer) => fixer.remove(nodeToReport),\n },\n ],\n });\n },\n };\n },\n});\n\nfunction getNodeToReport(node: MemberExpressionWithinCallExpression) {\n const { parent } = node;\n const { parent: grandParent } = parent;\n return grandParent &&\n (isArrowFunctionExpression(grandParent) || isReturnStatement(grandParent))\n ? node\n : parent;\n}\n"]}
1
+ {"version":3,"file":"no-dispatch-in-effects.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/effects/no-dispatch-in-effects.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,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,CAAC;YACL,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC;AAEH,SAAS,eAAe,CAAC,IAA0C;IACjE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACxB,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,CAAC;IACvC,OAAO,WAAW;QAChB,CAAC,IAAA,iCAAyB,EAAC,WAAW,CAAC,IAAI,IAAA,yBAAiB,EAAC,WAAW,CAAC,CAAC;QAC1E,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,MAAM,CAAC;AACb,CAAC","sourcesContent":["import type { TSESTree } from '@typescript-eslint/utils';\nimport * as path from 'path';\nimport { createRule } from '../../rule-creator';\nimport {\n asPattern,\n dispatchInEffects,\n getNgRxStores,\n isArrowFunctionExpression,\n isReturnStatement,\n} from '../../utils';\n\nexport const noDispatchInEffects = 'noDispatchInEffects';\nexport const noDispatchInEffectsSuggest = 'noDispatchInEffectsSuggest';\n\ntype MessageIds =\n | typeof noDispatchInEffects\n | typeof noDispatchInEffectsSuggest;\ntype Options = readonly [];\ntype MemberExpressionWithinCallExpression = TSESTree.MemberExpression & {\n parent: TSESTree.CallExpression;\n};\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'suggestion',\n hasSuggestions: true,\n docs: {\n description: '`Effect` should not call `store.dispatch`.',\n ngrxModule: 'effects',\n },\n schema: [],\n messages: {\n [noDispatchInEffects]:\n 'Calling `store.dispatch` in `Effect` is forbidden.',\n [noDispatchInEffectsSuggest]: 'Remove `store.dispatch`.',\n },\n },\n defaultOptions: [],\n create: (context) => {\n const { identifiers = [] } = getNgRxStores(context);\n const storeNames = identifiers.length > 0 ? asPattern(identifiers) : null;\n\n if (!storeNames) {\n return {};\n }\n\n return {\n [dispatchInEffects(storeNames)](\n node: MemberExpressionWithinCallExpression\n ) {\n const nodeToReport = getNodeToReport(node);\n context.report({\n node: nodeToReport,\n messageId: noDispatchInEffects,\n suggest: [\n {\n messageId: noDispatchInEffectsSuggest,\n fix: (fixer) => fixer.remove(nodeToReport),\n },\n ],\n });\n },\n };\n },\n});\n\nfunction getNodeToReport(node: MemberExpressionWithinCallExpression) {\n const { parent } = node;\n const { parent: grandParent } = parent;\n return grandParent &&\n (isArrowFunctionExpression(grandParent) || isReturnStatement(grandParent))\n ? node\n : parent;\n}\n"]}
@@ -1,3 +1,3 @@
1
1
  export declare const messageId = "noEffectsInProviders";
2
- declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noEffectsInProviders", readonly [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
2
+ declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noEffectsInProviders", readonly [], import("../../rule-creator").NgRxRuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
3
3
  export default _default;
@@ -42,9 +42,9 @@ exports.default = (0, rule_creator_1.createRule)({
42
42
  name: path.parse(__filename).name,
43
43
  meta: {
44
44
  type: 'problem',
45
- ngrxModule: 'effects',
46
45
  docs: {
47
46
  description: '`Effect` should not be listed as a provider if it is added to the `EffectsModule`.',
47
+ ngrxModule: 'effects',
48
48
  },
49
49
  fixable: 'code',
50
50
  schema: [],
@@ -1 +1 @@
1
- {"version":3,"file":"no-effects-in-providers.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/effects/no-effects-in-providers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAA6B;AAC7B,qDAAgD;AAChD,uCAKqB;AAER,QAAA,SAAS,GAAG,sBAAsB,CAAC;AAKhD,kBAAe,IAAA,yBAAU,EAAsB;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,UAAU,EAAE,SAAS;QACrB,IAAI,EAAE;YACJ,WAAW,EACT,oFAAoF;SACvF;QACD,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,CAAC,iBAAS,CAAC,EACT,oFAAoF;SACvF;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;QAClB,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAuB,CAAC;QAC1D,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAU,CAAC;QAE3C,OAAO;YACL,CAAC,kCAA0B,CAAC,CAAC,IAAyB;gBACpD,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC/B,CAAC;YACD,CAAC,gCAAwB,CAAC,CAAC,EAAE,IAAI,EAAuB;gBACtD,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC7B,CAAC;YACD,CAAC,GAAG,yBAAiB,OAAO,CAAC;gBAC3B,KAAK,MAAM,gBAAgB,IAAI,kBAAkB,EAAE,CAAC;oBAClD,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;wBACjD,SAAS;oBACX,CAAC;oBAED,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI,EAAE,gBAAgB;wBACtB,SAAS,EAAT,iBAAS;wBACT,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CACb,IAAA,+BAAuB,EACrB,OAAO,CAAC,UAAU,EAClB,KAAK,EACL,gBAAgB,CACjB;qBACJ,CAAC,CAAC;gBACL,CAAC;gBAED,gBAAgB,CAAC,KAAK,EAAE,CAAC;gBACzB,kBAAkB,CAAC,KAAK,EAAE,CAAC;YAC7B,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import type { TSESTree } from '@typescript-eslint/utils';\nimport * as path from 'path';\nimport { createRule } from '../../rule-creator';\nimport {\n effectsInNgModuleImports,\n effectsInNgModuleProviders,\n getNodeToCommaRemoveFix,\n ngModuleDecorator,\n} from '../../utils';\n\nexport const messageId = 'noEffectsInProviders';\n\ntype MessageIds = typeof messageId;\ntype Options = readonly [];\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'problem',\n ngrxModule: 'effects',\n docs: {\n description:\n '`Effect` should not be listed as a provider if it is added to the `EffectsModule`.',\n },\n fixable: 'code',\n schema: [],\n messages: {\n [messageId]:\n '`Effect` should not be listed as a provider if it is added to the `EffectsModule`.',\n },\n },\n defaultOptions: [],\n create: (context) => {\n const effectsInProviders = new Set<TSESTree.Identifier>();\n const effectsInImports = new Set<string>();\n\n return {\n [effectsInNgModuleProviders](node: TSESTree.Identifier) {\n effectsInProviders.add(node);\n },\n [effectsInNgModuleImports]({ name }: TSESTree.Identifier) {\n effectsInImports.add(name);\n },\n [`${ngModuleDecorator}:exit`]() {\n for (const effectInProvider of effectsInProviders) {\n if (!effectsInImports.has(effectInProvider.name)) {\n continue;\n }\n\n context.report({\n node: effectInProvider,\n messageId,\n fix: (fixer) =>\n getNodeToCommaRemoveFix(\n context.sourceCode,\n fixer,\n effectInProvider\n ),\n });\n }\n\n effectsInImports.clear();\n effectsInProviders.clear();\n },\n };\n },\n});\n"]}
1
+ {"version":3,"file":"no-effects-in-providers.js","sourceRoot":"","sources":["../../../../../../modules/eslint-plugin/src/rules/effects/no-effects-in-providers.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,2CAA6B;AAC7B,qDAAgD;AAChD,uCAKqB;AAER,QAAA,SAAS,GAAG,sBAAsB,CAAC;AAKhD,kBAAe,IAAA,yBAAU,EAAsB;IAC7C,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,IAAI;IACjC,IAAI,EAAE;QACJ,IAAI,EAAE,SAAS;QACf,IAAI,EAAE;YACJ,WAAW,EACT,oFAAoF;YACtF,UAAU,EAAE,SAAS;SACtB;QACD,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,EAAE;QACV,QAAQ,EAAE;YACR,CAAC,iBAAS,CAAC,EACT,oFAAoF;SACvF;KACF;IACD,cAAc,EAAE,EAAE;IAClB,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE;QAClB,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAuB,CAAC;QAC1D,MAAM,gBAAgB,GAAG,IAAI,GAAG,EAAU,CAAC;QAE3C,OAAO;YACL,CAAC,kCAA0B,CAAC,CAAC,IAAyB;gBACpD,kBAAkB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC/B,CAAC;YACD,CAAC,gCAAwB,CAAC,CAAC,EAAE,IAAI,EAAuB;gBACtD,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YAC7B,CAAC;YACD,CAAC,GAAG,yBAAiB,OAAO,CAAC;gBAC3B,KAAK,MAAM,gBAAgB,IAAI,kBAAkB,EAAE,CAAC;oBAClD,IAAI,CAAC,gBAAgB,CAAC,GAAG,CAAC,gBAAgB,CAAC,IAAI,CAAC,EAAE,CAAC;wBACjD,SAAS;oBACX,CAAC;oBAED,OAAO,CAAC,MAAM,CAAC;wBACb,IAAI,EAAE,gBAAgB;wBACtB,SAAS,EAAT,iBAAS;wBACT,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,CACb,IAAA,+BAAuB,EACrB,OAAO,CAAC,UAAU,EAClB,KAAK,EACL,gBAAgB,CACjB;qBACJ,CAAC,CAAC;gBACL,CAAC;gBAED,gBAAgB,CAAC,KAAK,EAAE,CAAC;gBACzB,kBAAkB,CAAC,KAAK,EAAE,CAAC;YAC7B,CAAC;SACF,CAAC;IACJ,CAAC;CACF,CAAC,CAAC","sourcesContent":["import type { TSESTree } from '@typescript-eslint/utils';\nimport * as path from 'path';\nimport { createRule } from '../../rule-creator';\nimport {\n effectsInNgModuleImports,\n effectsInNgModuleProviders,\n getNodeToCommaRemoveFix,\n ngModuleDecorator,\n} from '../../utils';\n\nexport const messageId = 'noEffectsInProviders';\n\ntype MessageIds = typeof messageId;\ntype Options = readonly [];\n\nexport default createRule<Options, MessageIds>({\n name: path.parse(__filename).name,\n meta: {\n type: 'problem',\n docs: {\n description:\n '`Effect` should not be listed as a provider if it is added to the `EffectsModule`.',\n ngrxModule: 'effects',\n },\n fixable: 'code',\n schema: [],\n messages: {\n [messageId]:\n '`Effect` should not be listed as a provider if it is added to the `EffectsModule`.',\n },\n },\n defaultOptions: [],\n create: (context) => {\n const effectsInProviders = new Set<TSESTree.Identifier>();\n const effectsInImports = new Set<string>();\n\n return {\n [effectsInNgModuleProviders](node: TSESTree.Identifier) {\n effectsInProviders.add(node);\n },\n [effectsInNgModuleImports]({ name }: TSESTree.Identifier) {\n effectsInImports.add(name);\n },\n [`${ngModuleDecorator}:exit`]() {\n for (const effectInProvider of effectsInProviders) {\n if (!effectsInImports.has(effectInProvider.name)) {\n continue;\n }\n\n context.report({\n node: effectInProvider,\n messageId,\n fix: (fixer) =>\n getNodeToCommaRemoveFix(\n context.sourceCode,\n fixer,\n effectInProvider\n ),\n });\n }\n\n effectsInImports.clear();\n effectsInProviders.clear();\n },\n };\n },\n});\n"]}
@@ -1,5 +1,5 @@
1
1
  import { ESLintUtils } from '@typescript-eslint/utils';
2
2
  export declare const messageId = "noMultipleActionsInEffects";
3
3
  type Options = readonly unknown[];
4
- declare const _default: ESLintUtils.RuleModule<"noMultipleActionsInEffects", Options, unknown, ESLintUtils.RuleListener>;
4
+ declare const _default: ESLintUtils.RuleModule<"noMultipleActionsInEffects", Options, import("../../rule-creator").NgRxRuleDocs, ESLintUtils.RuleListener>;
5
5
  export default _default;
@@ -43,9 +43,9 @@ exports.default = (0, rule_creator_1.createRule)({
43
43
  name: path.parse(__filename).name,
44
44
  meta: {
45
45
  type: 'problem',
46
- ngrxModule: 'effects',
47
46
  docs: {
48
47
  description: '`Effect` should not return multiple actions.',
48
+ ngrxModule: 'effects',
49
49
  requiresTypeChecking: true,
50
50
  },
51
51
  schema: [],