eslint-plugin-use-agnostic 0.10.3 → 0.10.4

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.
@@ -78,7 +78,7 @@ export const AGNOSTIC_STRATEGIES_MODULE = "Agnostic Strategies Module";
78
78
 
79
79
  // all mappings of "resolved" directives with "resolved" modules
80
80
  // agnostic20
81
- export const effectiveDirectives_effectiveModules = Object.freeze({
81
+ const effectiveDirectives_effectiveModules = Object.freeze({
82
82
  [USE_SERVER_LOGICS]: SERVER_LOGICS_MODULE,
83
83
  [USE_SERVER_COMPONENTS]: SERVER_COMPONENTS_MODULE,
84
84
  [USE_SERVER_FUNCTIONS]: SERVER_FUNCTIONS_MODULE,
@@ -88,12 +88,15 @@ export const effectiveDirectives_effectiveModules = Object.freeze({
88
88
  [USE_AGNOSTIC_COMPONENTS]: AGNOSTIC_COMPONENTS_MODULE,
89
89
  });
90
90
  // and directive21
91
- export const commentedDirectives_commentedModules = Object.freeze({
91
+ const commentedDirectives_commentedModules = Object.freeze({
92
92
  [USE_CLIENT_CONTEXTS]: CLIENT_CONTEXTS_MODULE,
93
93
  [USE_AGNOSTIC_CONDITIONS]: AGNOSTIC_CONDITIONS_MODULE,
94
94
  [USE_AGNOSTIC_STRATEGIES]: AGNOSTIC_STRATEGIES_MODULE,
95
95
  ...effectiveDirectives_effectiveModules,
96
96
  });
97
+ // for commons uses
98
+ export const resolvedDirectives_resolvedModules =
99
+ commentedDirectives_commentedModules;
97
100
 
98
101
  // JavaScript/TypeScript extensions
99
102
  export const TSX = ".tsx";
@@ -105,7 +108,7 @@ export const CJS = ".cjs";
105
108
 
106
109
  // JavaScript/TypeScript extensions array
107
110
  /** @type {Extensions} */
108
- export const EXTENSIONS = [TSX, TS, JSX, JS, MJS, CJS]; // In priority order
111
+ export const EXTENSIONS = Object.freeze([TSX, TS, JSX, JS, MJS, CJS]); // In priority order
109
112
 
110
113
  // message strings
111
114
  export const ARE_NOT_ALLOWED_TO_IMPORT = "are not allowed to import";
@@ -3,20 +3,26 @@ import path from "path";
3
3
 
4
4
  import { loadConfig, createMatchPath } from "tsconfig-paths";
5
5
 
6
- import { EXTENSIONS, ARE_NOT_ALLOWED_TO_IMPORT } from "../constants/bases.js";
6
+ import {
7
+ EXTENSIONS,
8
+ ARE_NOT_ALLOWED_TO_IMPORT,
9
+ resolvedDirectives_resolvedModules,
10
+ } from "../constants/bases.js";
11
+
12
+ import jscommentsConfig from "../../../comments.config.js";
7
13
 
8
14
  /**
9
- * @typedef {import('../../../types/_commons/typedefs').ResolvedDirectives_ResolvedModules} ResolvedDirectives_ResolvedModules
10
- * @typedef {import('../../../types/_commons/typedefs').CurrentFileResolvedDirective} CurrentFileResolvedDirective
15
+ * @typedef {import('../../../types/_commons/typedefs').EffectiveDirective} EffectiveDirective
16
+ * @typedef {import('../../../types/_commons/typedefs').CommentedDirective} CommentedDirective
17
+ * @typedef {import('../../../types/_commons/typedefs').ResolvedDirectiveWithoutUseAgnosticStrategies} ResolvedDirectiveWithoutUseAgnosticStrategies
18
+ * @typedef {import('../../../types/_commons/typedefs').Agnostic20ConfigName} Agnostic20ConfigName
19
+ * @typedef {import('../../../types/_commons/typedefs').Directive21ConfigName} Directive21ConfigName
20
+ * @typedef {import('../../../types/_commons/typedefs').UseAgnosticConfigName} UseAgnosticConfigName
11
21
  * @typedef {import('../../../types/_commons/typedefs').Context<string, readonly unknown[]>} Context
12
22
  */
13
23
 
14
24
  /**
15
- * @template {CurrentFileResolvedDirective} T
16
- * @typedef {import('../../../types/_commons/typedefs').ImportedFileResolvedDirective<T>} ImportedFileResolvedDirective
17
- */
18
- /**
19
- * @template {CurrentFileResolvedDirective} T
25
+ * @template {ResolvedDirectiveWithoutUseAgnosticStrategies} T
20
26
  * @typedef {import('../../../types/_commons/typedefs').ResolvedDirectives_BlockedImports<T>} ResolvedDirectives_BlockedImports
21
27
  */
22
28
 
@@ -114,10 +120,10 @@ export const highlightFirstLineOfCode = (context) => ({
114
120
 
115
121
  /**
116
122
  * Returns a boolean deciding if an imported file's "resolved" directive is incompatible with the current file's "resolved" directive.
117
- * @template {CurrentFileResolvedDirective} T
123
+ * @template {ResolvedDirectiveWithoutUseAgnosticStrategies} T
118
124
  * @param {ResolvedDirectives_BlockedImports<T>} resolvedDirectives_blockedImports The blocked imports object, either for agnostic20 or for directive21.
119
125
  * @param {T} currentFileResolvedDirective The current file's "resolved" directive.
120
- * @param {ImportedFileResolvedDirective<T>} importedFileResolvedDirective The imported file's "resolved" directive.
126
+ * @param {T} importedFileResolvedDirective The imported file's "resolved" directive.
121
127
  * @returns `true` if the import is blocked, as established in respective `resolvedDirectives_blockedImports`.
122
128
  */
123
129
  export const isImportBlocked = (
@@ -134,31 +140,32 @@ export const isImportBlocked = (
134
140
 
135
141
  /**
136
142
  * Makes the intro for each specific import rule violation messages.
137
- * @template {CurrentFileResolvedDirective} T
138
- * @param {ResolvedDirectives_ResolvedModules} resolvedDirectives_resolvedModules The resolved modules object, either for agnostic20 or for directive21.
139
- * @param {CurrentFileResolvedDirective} currentFileResolvedDirective The current file's "resolved" directive.
140
- * @param {ImportedFileResolvedDirective<T>} importedFileResolvedDirective The imported file's "resolved" directive.
143
+ * @template {ResolvedDirectiveWithoutUseAgnosticStrategies} T
144
+ * @template {ResolvedDirectiveWithoutUseAgnosticStrategies} U
145
+ * @param {T} currentFileResolvedDirective The current file's "resolved" directive, excluding `"use agnostic strategies"`.
146
+ * @param {U} importedFileResolvedDirective The imported file's "resolved" directive, excluding `"use agnostic strategies"`.
141
147
  * @returns "[Current file 'resolved' modules] are not allowed to import [imported file 'resolved' modules]."
142
148
  */
143
149
  export const makeIntroForSpecificViolationMessage = (
144
- resolvedDirectives_resolvedModules,
145
150
  currentFileResolvedDirective,
146
151
  importedFileResolvedDirective
147
- ) =>
148
- `${resolvedDirectives_resolvedModules[currentFileResolvedDirective]}s ${ARE_NOT_ALLOWED_TO_IMPORT} ${resolvedDirectives_resolvedModules[importedFileResolvedDirective]}s.`;
152
+ ) => {
153
+ /** @type {`${typeof resolvedDirectives_resolvedModules[T]}s ${typeof ARE_NOT_ALLOWED_TO_IMPORT} ${typeof resolvedDirectives_resolvedModules[U]}s.`} */
154
+ const introForSpecificViolationMessage = `${resolvedDirectives_resolvedModules[currentFileResolvedDirective]}s ${ARE_NOT_ALLOWED_TO_IMPORT} ${resolvedDirectives_resolvedModules[importedFileResolvedDirective]}s.`;
155
+
156
+ return introForSpecificViolationMessage;
157
+ };
149
158
 
150
159
  /* makeMessageFromCurrentFileResolvedDirective */
151
160
 
152
161
  /**
153
162
  * Lists in an message the "resolved" modules incompatible with a "resolved" module based on its "resolved" directive.
154
- * @template {CurrentFileResolvedDirective} T
155
- * @param {ResolvedDirectives_ResolvedModules} resolvedDirectives_resolvedModules The resolved modules object, either for agnostic20 or for directive21.
163
+ * @template {ResolvedDirectiveWithoutUseAgnosticStrategies} T
156
164
  * @param {ResolvedDirectives_BlockedImports<T>} resolvedDirectives_blockedImports The blocked imports object, either for agnostic20 or for directive21.
157
165
  * @param {T} currentFileResolvedDirective The "resolved" directive of the "resolved" module.
158
166
  * @returns The message listing the incompatible "resolved" modules.
159
167
  */
160
168
  export const makeMessageFromCurrentFileResolvedDirective = (
161
- resolvedDirectives_resolvedModules,
162
169
  resolvedDirectives_blockedImports,
163
170
  currentFileResolvedDirective
164
171
  ) => {
@@ -193,10 +200,10 @@ export const makeMessageFromCurrentFileResolvedDirective = (
193
200
 
194
201
  /**
195
202
  * Finds the `message` for the specific violation of "resolved" directives import rules based on `resolvedDirectives_blockedImports`.
196
- * @template {CurrentFileResolvedDirective} T
203
+ * @template {ResolvedDirectiveWithoutUseAgnosticStrategies} T
197
204
  * @param {ResolvedDirectives_BlockedImports<T>} resolvedDirectives_blockedImports The blocked imports object, either for agnostic20 or for directive21.
198
- * @param {T} currentFileResolvedDirective The current file's "resolved" directive.
199
- * @param {ImportedFileResolvedDirective<T>} importedFileResolvedDirective The imported file's "resolved" directive.
205
+ * @param {T} currentFileResolvedDirective The current file's "resolved" directive, excluding `"use agnostic strategies"`.
206
+ * @param {T} importedFileResolvedDirective The imported file's "resolved" directive.
200
207
  * @returns The corresponding `message`.
201
208
  */
202
209
  export const findSpecificViolationMessage = (
@@ -7,10 +7,9 @@ import {
7
7
  USE_CLIENT_COMPONENTS as COMMONS_USE_CLIENT_COMPONENTS,
8
8
  USE_AGNOSTIC_LOGICS as COMMONS_USE_AGNOSTIC_LOGICS,
9
9
  USE_AGNOSTIC_COMPONENTS as COMMONS_USE_AGNOSTIC_COMPONENTS,
10
- effectiveDirectives_effectiveModules,
11
10
  } from "../../../_commons/constants/bases.js";
12
11
 
13
- import { makeIntroForSpecificViolationMessage as commonsMakeIntroForSpecificViolationMessage } from "../../../_commons/utilities/helpers.js";
12
+ import { makeIntroForSpecificViolationMessage } from "../../../_commons/utilities/helpers.js";
14
13
 
15
14
  import jscommentsConfig from "../../../../comments.config.js";
16
15
 
@@ -29,7 +28,11 @@ export const USE_AGNOSTIC = "use agnostic";
29
28
 
30
29
  // directives array
31
30
  /** @type {Directives} */
32
- export const directivesArray = [USE_SERVER, USE_CLIENT, USE_AGNOSTIC];
31
+ export const directivesArray = Object.freeze([
32
+ USE_SERVER,
33
+ USE_CLIENT,
34
+ USE_AGNOSTIC,
35
+ ]);
33
36
 
34
37
  // directives set
35
38
  /** @type {ReadonlySet<Directive>} */
@@ -51,7 +54,7 @@ export const FUNCTIONS = "functions";
51
54
 
52
55
  // mapping directives with effective directives
53
56
  /** @type {Directives_EffectiveDirectives} */
54
- export const directives_effectiveDirectives = Object.freeze({
57
+ export const directives_effectiveDirectives = {
55
58
  [NO_DIRECTIVE]: {
56
59
  [LOGICS]: USE_SERVER_LOGICS,
57
60
  [COMPONENTS]: USE_SERVER_COMPONENTS,
@@ -72,7 +75,7 @@ export const directives_effectiveDirectives = Object.freeze({
72
75
  [COMPONENTS]: USE_AGNOSTIC_COMPONENTS,
73
76
  [FUNCTIONS]: null,
74
77
  },
75
- });
78
+ };
76
79
 
77
80
  // message placeholders
78
81
  export const currentFileEffectiveDirective = "currentFileEffectiveDirective";
@@ -82,52 +85,72 @@ export const specificViolationMessage = "specificViolationMessage";
82
85
 
83
86
  /* effectiveDirectives_BlockedImports */
84
87
 
88
+ const SUGGEST_USE_AGNOSTIC =
89
+ "If the module you're trying to import does not possess any server-side code however, please mark it with this plugin's own and eponymous 'use agnostic' directive to signal its compatibility across all environments.";
90
+
85
91
  /**
86
- * Makes the intro for each specific import rule violation messages.
87
- * @param {EffectiveDirective} currentFileEffectiveDirective The current file's effective directive.
88
- * @param {EffectiveDirective} importedFileEffectiveDirective The imported file's effective directive.
89
- * @returns "[Current file effective modules] are not allowed to import [imported file effective modules]."
92
+ * Makes a blockedImport object for the identified blocked import at hand.
93
+ * @template {EffectiveDirective} T
94
+ * @template {EffectiveDirective} U
95
+ * @param {T} currentFileEffectiveDirective The current file's effective directive.
96
+ * @param {U} importedFileEffectiveDirective The imported file's effective directive.
97
+ * @returns The blockedImport object for the identified blocked import at hand.
90
98
  */
91
- const makeIntroForSpecificViolationMessage = (
99
+ export const makeBlockedImport = (
92
100
  currentFileEffectiveDirective,
93
101
  importedFileEffectiveDirective
94
- ) =>
95
- commonsMakeIntroForSpecificViolationMessage(
96
- effectiveDirectives_effectiveModules,
102
+ ) => {
103
+ return Object.freeze({
104
+ blockedImport: importedFileEffectiveDirective,
105
+ message: `${makeIntroForSpecificViolationMessage(
106
+ currentFileEffectiveDirective,
107
+ importedFileEffectiveDirective
108
+ )} ${
109
+ jscommentsConfig[agnostic20ConfigName][currentFileEffectiveDirective][
110
+ importedFileEffectiveDirective
111
+ ]
112
+ }`,
113
+ });
114
+ };
115
+
116
+ /**
117
+ * Makes a blockedImport object for the identified blocked import at hand enhanced with the suggestion to use the `'use agnostic'` directive.
118
+ * @template {EffectiveDirective} T
119
+ * @template {EffectiveDirective} U
120
+ * @param {T} currentFileEffectiveDirective The current file's effective directive.
121
+ * @param {U} importedFileEffectiveDirective The imported file's effective directive.
122
+ * @returns The enhanced blockedImport object with the suggestion to use the `'use agnostic'` directive.
123
+ */
124
+ const makeBlockedImportSuggestingUseAgnostic = (
125
+ currentFileEffectiveDirective,
126
+ importedFileEffectiveDirective
127
+ ) => {
128
+ const blockedImport = makeBlockedImport(
97
129
  currentFileEffectiveDirective,
98
130
  importedFileEffectiveDirective
99
131
  );
132
+ /** @type {`${typeof blockedImport.message} \n${SUGGEST_USE_AGNOSTIC}`} */
133
+ const blockedImportMessageSuggestingUseAgnostic = `${blockedImport.message} \n${SUGGEST_USE_AGNOSTIC}`;
100
134
 
101
- const SUGGEST_USE_AGNOSTIC =
102
- "If the module you're trying to import does not possess any server-side code however, please mark it with this plugin's own and eponymous 'use agnostic' directive to signal its compatibility across all environments.";
135
+ return Object.freeze({
136
+ ...blockedImport,
137
+ message: blockedImportMessageSuggestingUseAgnostic,
138
+ });
139
+ };
103
140
 
104
141
  export const effectiveDirectives_blockedImports = Object.freeze({
105
142
  [USE_SERVER_LOGICS]: [
106
143
  // USE_SERVER_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_LOGICS#USE_SERVER_LOGICS
107
144
  // USE_SERVER_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_LOGICS#USE_SERVER_COMPONENTS
108
145
  // USE_SERVER_FUNCTIONS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_LOGICS#USE_SERVER_FUNCTIONS
109
- {
110
- blockedImport: USE_CLIENT_LOGICS,
111
- message: `${makeIntroForSpecificViolationMessage(
112
- USE_SERVER_LOGICS,
113
- USE_CLIENT_LOGICS
114
- )} ${
115
- jscommentsConfig[agnostic20ConfigName][USE_SERVER_LOGICS][
116
- USE_CLIENT_LOGICS
117
- ] // $COMMENT#AGNOSTIC20#USE_SERVER_LOGICS#USE_CLIENT_LOGICS
118
- }`,
119
- },
120
- {
121
- blockedImport: USE_CLIENT_COMPONENTS,
122
- message: `${makeIntroForSpecificViolationMessage(
123
- USE_SERVER_LOGICS,
124
- USE_CLIENT_COMPONENTS
125
- )} ${
126
- jscommentsConfig[agnostic20ConfigName][USE_SERVER_LOGICS][
127
- USE_CLIENT_COMPONENTS
128
- ] // $COMMENT#AGNOSTIC20#USE_SERVER_LOGICS#USE_CLIENT_COMPONENTS
129
- }`,
130
- },
146
+ makeBlockedImport(
147
+ USE_SERVER_LOGICS,
148
+ USE_CLIENT_LOGICS
149
+ ) /* $COMMENT#AGNOSTIC20#USE_SERVER_LOGICS#USE_CLIENT_LOGICS */,
150
+ makeBlockedImport(
151
+ USE_SERVER_LOGICS,
152
+ USE_CLIENT_COMPONENTS
153
+ ) /* $COMMENT#AGNOSTIC20#USE_SERVER_LOGICS#USE_CLIENT_COMPONENTS */,
131
154
  // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_LOGICS#USE_AGNOSTIC_LOGICS
132
155
  // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_LOGICS#USE_AGNOSTIC_COMPONENTS
133
156
  ],
@@ -135,95 +158,44 @@ export const effectiveDirectives_blockedImports = Object.freeze({
135
158
  // USE_SERVER_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_COMPONENTS#USE_SERVER_LOGICS
136
159
  // USE_SERVER_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_COMPONENTS#USE_SERVER_COMPONENTS
137
160
  // USE_SERVER_FUNCTIONS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_COMPONENTS#USE_SERVER_FUNCTIONS
138
- {
139
- blockedImport: USE_CLIENT_LOGICS,
140
- message: `${makeIntroForSpecificViolationMessage(
141
- USE_SERVER_COMPONENTS,
142
- USE_CLIENT_LOGICS
143
- )} ${
144
- jscommentsConfig[agnostic20ConfigName][USE_SERVER_COMPONENTS][
145
- USE_CLIENT_LOGICS
146
- ] // $COMMENT#AGNOSTIC20#USE_SERVER_COMPONENTS#USE_CLIENT_LOGICS
147
- }`,
148
- },
161
+ makeBlockedImport(
162
+ USE_SERVER_COMPONENTS,
163
+ USE_CLIENT_LOGICS
164
+ ) /* $COMMENT#AGNOSTIC20#USE_SERVER_COMPONENTS#USE_CLIENT_LOGICS */,
149
165
  // USE_CLIENT_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_COMPONENTS#USE_CLIENT_COMPONENTS
150
166
  // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_COMPONENTS#USE_AGNOSTIC_LOGICS
151
167
  // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_COMPONENTS#USE_AGNOSTIC_COMPONENTS
152
168
  ],
153
169
  [USE_SERVER_FUNCTIONS]: [
154
170
  // USE_SERVER_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_FUNCTIONS#USE_SERVER_LOGICS
155
- {
156
- blockedImport: USE_SERVER_COMPONENTS,
157
- message: `${makeIntroForSpecificViolationMessage(
158
- USE_SERVER_FUNCTIONS,
159
- USE_SERVER_COMPONENTS
160
- )} ${
161
- jscommentsConfig[agnostic20ConfigName][USE_SERVER_FUNCTIONS][
162
- USE_SERVER_COMPONENTS
163
- ] // $COMMENT#AGNOSTIC20#USE_SERVER_FUNCTIONS#USE_SERVER_COMPONENTS
164
- }`,
165
- },
171
+ makeBlockedImport(
172
+ USE_SERVER_FUNCTIONS,
173
+ USE_SERVER_COMPONENTS
174
+ ) /* $COMMENT#AGNOSTIC20#USE_SERVER_FUNCTIONS#USE_SERVER_COMPONENTS */,
166
175
  // USE_SERVER_FUNCTIONS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_FUNCTIONS#USE_SERVER_FUNCTIONS
167
- {
168
- blockedImport: USE_CLIENT_LOGICS,
169
- message: `${makeIntroForSpecificViolationMessage(
170
- USE_SERVER_FUNCTIONS,
171
- USE_CLIENT_LOGICS
172
- )} ${
173
- jscommentsConfig[agnostic20ConfigName][USE_SERVER_FUNCTIONS][
174
- USE_CLIENT_LOGICS
175
- ] // $COMMENT#AGNOSTIC20#USE_SERVER_FUNCTIONS#USE_CLIENT_LOGICS
176
- }`,
177
- },
178
- {
179
- blockedImport: USE_CLIENT_COMPONENTS,
180
- message: `${makeIntroForSpecificViolationMessage(
181
- USE_SERVER_FUNCTIONS,
182
- USE_CLIENT_COMPONENTS
183
- )} ${
184
- jscommentsConfig[agnostic20ConfigName][USE_SERVER_FUNCTIONS][
185
- USE_CLIENT_COMPONENTS
186
- ] // $COMMENT#AGNOSTIC20#USE_SERVER_FUNCTIONS#USE_CLIENT_COMPONENTS
187
- }`,
188
- },
176
+ makeBlockedImport(
177
+ USE_SERVER_FUNCTIONS,
178
+ USE_CLIENT_LOGICS
179
+ ) /* $COMMENT#AGNOSTIC20#USE_SERVER_FUNCTIONS#USE_CLIENT_LOGICS */,
180
+ makeBlockedImport(
181
+ USE_SERVER_FUNCTIONS,
182
+ USE_CLIENT_COMPONENTS
183
+ ) /* $COMMENT#AGNOSTIC20#USE_SERVER_FUNCTIONS#USE_CLIENT_COMPONENTS */,
189
184
  // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_SERVER_FUNCTIONS#USE_AGNOSTIC_LOGICS
190
- {
191
- blockedImport: USE_AGNOSTIC_COMPONENTS,
192
- message: `${makeIntroForSpecificViolationMessage(
193
- USE_SERVER_FUNCTIONS,
194
- USE_AGNOSTIC_COMPONENTS
195
- )} ${
196
- jscommentsConfig[agnostic20ConfigName][USE_SERVER_FUNCTIONS][
197
- USE_AGNOSTIC_COMPONENTS
198
- ] // $COMMENT#AGNOSTIC20#USE_SERVER_FUNCTIONS#USE_AGNOSTIC_COMPONENTS
199
- }`,
200
- },
185
+ makeBlockedImport(
186
+ USE_SERVER_FUNCTIONS,
187
+ USE_AGNOSTIC_COMPONENTS
188
+ ) /* $COMMENT#AGNOSTIC20#USE_SERVER_FUNCTIONS#USE_AGNOSTIC_COMPONENTS */,
201
189
  ],
202
190
  [USE_CLIENT_LOGICS]: [
203
- {
204
- blockedImport: USE_SERVER_LOGICS,
205
- message: `${makeIntroForSpecificViolationMessage(
206
- USE_CLIENT_LOGICS,
207
- USE_SERVER_LOGICS
208
- )} ${
209
- jscommentsConfig[agnostic20ConfigName][USE_CLIENT_LOGICS][
210
- USE_SERVER_LOGICS
211
- ] // $COMMENT#AGNOSTIC20#USE_CLIENT_LOGICS#USE_SERVER_LOGICS
212
- }
213
- ${SUGGEST_USE_AGNOSTIC}`,
214
- },
215
- {
216
- blockedImport: USE_SERVER_COMPONENTS,
217
- message: `${makeIntroForSpecificViolationMessage(
218
- USE_CLIENT_LOGICS,
219
- USE_SERVER_COMPONENTS
220
- )} ${
221
- jscommentsConfig[agnostic20ConfigName][USE_CLIENT_LOGICS][
222
- USE_SERVER_COMPONENTS
223
- ] // $COMMENT#AGNOSTIC20#USE_CLIENT_LOGICS#USE_SERVER_COMPONENTS
224
- }
225
- ${SUGGEST_USE_AGNOSTIC}`,
226
- },
191
+ makeBlockedImportSuggestingUseAgnostic(
192
+ USE_CLIENT_LOGICS,
193
+ USE_SERVER_LOGICS
194
+ ) /* $COMMENT#AGNOSTIC20#USE_CLIENT_LOGICS#USE_SERVER_LOGICS */,
195
+ makeBlockedImportSuggestingUseAgnostic(
196
+ USE_CLIENT_LOGICS,
197
+ USE_SERVER_COMPONENTS
198
+ ) /* $COMMENT#AGNOSTIC20#USE_CLIENT_LOGICS#USE_SERVER_COMPONENTS */,
227
199
  // USE_SERVER_FUNCTIONS allowed, because $COMMENT#AGNOSTIC20#USE_CLIENT_LOGICS#USE_SERVER_FUNCTIONS
228
200
  // USE_CLIENT_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_CLIENT_LOGICS#USE_CLIENT_LOGICS
229
201
  // USE_CLIENT_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_CLIENT_LOGICS#USE_CLIENT_COMPONENTS
@@ -231,30 +203,14 @@ ${SUGGEST_USE_AGNOSTIC}`,
231
203
  // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_CLIENT_LOGICS#USE_AGNOSTIC_COMPONENTS
232
204
  ],
233
205
  [USE_CLIENT_COMPONENTS]: [
234
- {
235
- blockedImport: USE_SERVER_LOGICS,
236
- message: `${makeIntroForSpecificViolationMessage(
237
- USE_CLIENT_COMPONENTS,
238
- USE_SERVER_LOGICS
239
- )} ${
240
- jscommentsConfig[agnostic20ConfigName][USE_CLIENT_COMPONENTS][
241
- USE_SERVER_LOGICS
242
- ] // $COMMENT#AGNOSTIC20#USE_CLIENT_COMPONENTS#USE_SERVER_LOGICS
243
- }
244
- ${SUGGEST_USE_AGNOSTIC}`,
245
- },
246
- {
247
- blockedImport: USE_SERVER_COMPONENTS,
248
- message: `${makeIntroForSpecificViolationMessage(
249
- USE_CLIENT_COMPONENTS,
250
- USE_SERVER_COMPONENTS
251
- )} ${
252
- jscommentsConfig[agnostic20ConfigName][USE_CLIENT_COMPONENTS][
253
- USE_SERVER_COMPONENTS
254
- ] // $COMMENT#AGNOSTIC20#USE_CLIENT_COMPONENTS#USE_SERVER_COMPONENTS
255
- }
256
- ${SUGGEST_USE_AGNOSTIC}`,
257
- },
206
+ makeBlockedImportSuggestingUseAgnostic(
207
+ USE_CLIENT_LOGICS,
208
+ USE_SERVER_LOGICS
209
+ ) /* $COMMENT#AGNOSTIC20#USE_CLIENT_LOGICS#USE_SERVER_LOGICS */,
210
+ makeBlockedImportSuggestingUseAgnostic(
211
+ USE_CLIENT_LOGICS,
212
+ USE_SERVER_COMPONENTS
213
+ ) /* $COMMENT#AGNOSTIC20#USE_CLIENT_LOGICS#USE_SERVER_COMPONENTS */,
258
214
  // USE_SERVER_FUNCTIONS allowed, because $COMMENT#AGNOSTIC20#USE_CLIENT_COMPONENTS#USE_SERVER_FUNCTIONS
259
215
  // USE_CLIENT_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_CLIENT_COMPONENTS#USE_CLIENT_LOGICS
260
216
  // USE_CLIENT_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_CLIENT_COMPONENTS#USE_CLIENT_COMPONENTS
@@ -262,103 +218,43 @@ ${SUGGEST_USE_AGNOSTIC}`,
262
218
  // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_CLIENT_COMPONENTS#USE_AGNOSTIC_COMPONENTS
263
219
  ],
264
220
  [USE_AGNOSTIC_LOGICS]: [
265
- {
266
- blockedImport: USE_SERVER_LOGICS,
267
- message: `${makeIntroForSpecificViolationMessage(
268
- USE_AGNOSTIC_LOGICS,
269
- USE_SERVER_LOGICS
270
- )} ${
271
- jscommentsConfig[agnostic20ConfigName][USE_AGNOSTIC_LOGICS][
272
- USE_SERVER_LOGICS
273
- ] // $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_SERVER_LOGICS
274
- }
275
- ${SUGGEST_USE_AGNOSTIC}`,
276
- },
277
- {
278
- blockedImport: USE_SERVER_COMPONENTS,
279
- message: `${makeIntroForSpecificViolationMessage(
280
- USE_AGNOSTIC_LOGICS,
281
- USE_SERVER_COMPONENTS
282
- )} ${
283
- jscommentsConfig[agnostic20ConfigName][USE_AGNOSTIC_LOGICS][
284
- USE_SERVER_COMPONENTS
285
- ] // $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_SERVER_COMPONENTS
286
- }
287
- ${SUGGEST_USE_AGNOSTIC}`,
288
- },
289
- {
290
- blockedImport: USE_SERVER_FUNCTIONS,
291
- message: `${makeIntroForSpecificViolationMessage(
292
- USE_AGNOSTIC_LOGICS,
293
- USE_SERVER_FUNCTIONS
294
- )} ${
295
- jscommentsConfig[agnostic20ConfigName][USE_AGNOSTIC_LOGICS][
296
- USE_SERVER_FUNCTIONS
297
- ] // $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_SERVER_FUNCTIONS
298
- }`,
299
- },
300
- {
301
- blockedImport: USE_CLIENT_LOGICS,
302
- message: `${makeIntroForSpecificViolationMessage(
303
- USE_AGNOSTIC_LOGICS,
304
- USE_CLIENT_LOGICS
305
- )} ${
306
- jscommentsConfig[agnostic20ConfigName][USE_AGNOSTIC_LOGICS][
307
- USE_CLIENT_LOGICS
308
- ] // $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_CLIENT_LOGICS
309
- }`,
310
- },
311
- {
312
- blockedImport: USE_CLIENT_COMPONENTS,
313
- message: `${makeIntroForSpecificViolationMessage(
314
- USE_AGNOSTIC_LOGICS,
315
- USE_CLIENT_COMPONENTS
316
- )} ${
317
- jscommentsConfig[agnostic20ConfigName][USE_AGNOSTIC_LOGICS][
318
- USE_CLIENT_COMPONENTS
319
- ] // $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_CLIENT_COMPONENTS
320
- }`,
321
- },
221
+ makeBlockedImportSuggestingUseAgnostic(
222
+ USE_AGNOSTIC_LOGICS,
223
+ USE_SERVER_LOGICS
224
+ ) /* $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_SERVER_LOGICS */,
225
+ makeBlockedImportSuggestingUseAgnostic(
226
+ USE_AGNOSTIC_LOGICS,
227
+ USE_SERVER_COMPONENTS
228
+ ) /* $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_SERVER_COMPONENTS */,
229
+ makeBlockedImport(
230
+ USE_AGNOSTIC_LOGICS,
231
+ USE_SERVER_FUNCTIONS
232
+ ) /* $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_SERVER_FUNCTIONS */,
233
+ makeBlockedImport(
234
+ USE_AGNOSTIC_LOGICS,
235
+ USE_CLIENT_LOGICS
236
+ ) /* $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_CLIENT_LOGICS */,
237
+ makeBlockedImport(
238
+ USE_AGNOSTIC_LOGICS,
239
+ USE_CLIENT_COMPONENTS
240
+ ) /* $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_CLIENT_COMPONENTS */,
322
241
  // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_AGNOSTIC_LOGICS
323
242
  // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_AGNOSTIC_LOGICS#USE_AGNOSTIC_COMPONENTS
324
243
  ],
325
244
  [USE_AGNOSTIC_COMPONENTS]: [
326
- {
327
- blockedImport: USE_SERVER_LOGICS,
328
- message: `${makeIntroForSpecificViolationMessage(
329
- USE_AGNOSTIC_COMPONENTS,
330
- USE_SERVER_LOGICS
331
- )} ${
332
- jscommentsConfig[agnostic20ConfigName][USE_AGNOSTIC_COMPONENTS][
333
- USE_SERVER_LOGICS
334
- ] // $COMMENT#AGNOSTIC20#USE_AGNOSTIC_COMPONENTS#USE_SERVER_LOGICS
335
- }
336
- ${SUGGEST_USE_AGNOSTIC}`,
337
- },
338
- {
339
- blockedImport: USE_SERVER_COMPONENTS,
340
- message: `${makeIntroForSpecificViolationMessage(
341
- USE_AGNOSTIC_COMPONENTS,
342
- USE_SERVER_COMPONENTS
343
- )} ${
344
- jscommentsConfig[agnostic20ConfigName][USE_AGNOSTIC_COMPONENTS][
345
- USE_SERVER_COMPONENTS
346
- ] // $COMMENT#AGNOSTIC20#USE_AGNOSTIC_COMPONENTS#USE_SERVER_COMPONENTS
347
- }
348
- ${SUGGEST_USE_AGNOSTIC}`,
349
- },
245
+ makeBlockedImportSuggestingUseAgnostic(
246
+ USE_AGNOSTIC_COMPONENTS,
247
+ USE_SERVER_LOGICS
248
+ ) /* $COMMENT#AGNOSTIC20#USE_AGNOSTIC_COMPONENTS#USE_SERVER_LOGICS */,
249
+ makeBlockedImportSuggestingUseAgnostic(
250
+ USE_AGNOSTIC_COMPONENTS,
251
+ USE_SERVER_COMPONENTS
252
+ ) /* $COMMENT#AGNOSTIC20#USE_AGNOSTIC_COMPONENTS#USE_SERVER_COMPONENTS */,
350
253
  // USE_SERVER_FUNCTIONS allowed, because $COMMENT#AGNOSTIC20#USE_AGNOSTIC_COMPONENTS#USE_SERVER_FUNCTIONS
351
- {
352
- blockedImport: USE_CLIENT_LOGICS,
353
- message: `${makeIntroForSpecificViolationMessage(
354
- USE_AGNOSTIC_COMPONENTS,
355
- USE_CLIENT_LOGICS
356
- )} ${
357
- jscommentsConfig[agnostic20ConfigName][USE_AGNOSTIC_COMPONENTS][
358
- USE_CLIENT_LOGICS
359
- ] // $COMMENT#AGNOSTIC20#USE_AGNOSTIC_COMPONENTS#USE_CLIENT_LOGICS
360
- }`,
361
- },
254
+ makeBlockedImport(
255
+ USE_AGNOSTIC_COMPONENTS,
256
+ USE_CLIENT_LOGICS
257
+ ) /* $COMMENT#AGNOSTIC20#USE_AGNOSTIC_COMPONENTS#USE_CLIENT_LOGICS */,
362
258
  // USE_CLIENT_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_AGNOSTIC_COMPONENTS#USE_CLIENT_COMPONENTS
363
259
  // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#AGNOSTIC20#USE_AGNOSTIC_COMPONENTS#USE_AGNOSTIC_LOGICS
364
260
  // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#AGNOSTIC20#USE_AGNOSTIC_COMPONENTS#USE_AGNOSTIC_COMPONENTS
@@ -1,4 +1,3 @@
1
- import { effectiveDirectives_effectiveModules } from "../../../_commons/constants/bases.js";
2
1
  import {
3
2
  USE_SERVER,
4
3
  LOGICS,
@@ -145,7 +144,6 @@ export const makeMessageFromCurrentFileEffectiveDirective = (
145
144
  effectiveDirective
146
145
  ) =>
147
146
  makeMessageFromCurrentFileResolvedDirective(
148
- effectiveDirectives_effectiveModules,
149
147
  effectiveDirectives_blockedImports,
150
148
  effectiveDirective
151
149
  );
@@ -10,7 +10,6 @@ import {
10
10
  USE_CLIENT_CONTEXTS as COMMONS_USE_CLIENT_CONTEXTS,
11
11
  USE_AGNOSTIC_CONDITIONS as COMMONS_USE_AGNOSTIC_CONDITIONS,
12
12
  USE_AGNOSTIC_STRATEGIES as COMMONS_USE_AGNOSTIC_STRATEGIES,
13
- commentedDirectives_commentedModules,
14
13
  } from "../../../_commons/constants/bases.js";
15
14
 
16
15
  import { makeIntroForSpecificViolationMessage as commonsMakeIntroForSpecificViolationMessage } from "../../../_commons/utilities/helpers.js";
@@ -39,7 +38,7 @@ export const USE_AGNOSTIC_STRATEGIES = COMMONS_USE_AGNOSTIC_STRATEGIES;
39
38
 
40
39
  // commented directives array
41
40
  /** @type {CommentedDirectives} */
42
- export const commentedDirectivesArray = [
41
+ export const commentedDirectivesArray = Object.freeze([
43
42
  USE_SERVER_LOGICS,
44
43
  USE_CLIENT_LOGICS,
45
44
  USE_AGNOSTIC_LOGICS,
@@ -50,7 +49,7 @@ export const commentedDirectivesArray = [
50
49
  USE_CLIENT_CONTEXTS,
51
50
  USE_AGNOSTIC_CONDITIONS,
52
51
  USE_AGNOSTIC_STRATEGIES,
53
- ];
52
+ ]);
54
53
 
55
54
  // commented directives set
56
55
  /** @type {ReadonlySet<CommentedDirective>} */
@@ -83,7 +82,7 @@ export const AT_AGNOSTIC_CONDITIONS = "@agnosticConditions";
83
82
 
84
83
  // commented strategies array
85
84
  /** @type {CommentedStrategies} */
86
- export const strategiesArray = [
85
+ export const strategiesArray = Object.freeze([
87
86
  AT_SERVER_LOGICS,
88
87
  AT_CLIENT_LOGICS,
89
88
  AT_AGNOSTIC_LOGICS,
@@ -93,7 +92,7 @@ export const strategiesArray = [
93
92
  AT_SERVER_FUNCTIONS,
94
93
  AT_CLIENT_CONTEXTS,
95
94
  AT_AGNOSTIC_CONDITIONS,
96
- ];
95
+ ]);
97
96
 
98
97
  // commented strategies set
99
98
  /** @type {ReadonlySet<CommentedStrategy>} */
@@ -177,88 +176,62 @@ export const commentedDirectives_verificationReports = Object.freeze({
177
176
  /* commentedDirectives_blockedImports */
178
177
 
179
178
  /**
180
- * Makes the intro for each specific import rule violation messages.
181
- * @param {CommentedDirective} currentFileCommentedDirective The current file's commented directive.
182
- * @param {CommentedDirectiveWithoutUseAgnosticStrategies} importedFileCommentedDirective The imported file's commented directive.
183
- * @returns "[Current file commented modules] are not allowed to import [imported file commented modules]."
179
+ * Makes a blockedImport object for the identified blocked import at hand.
180
+ * @template {CommentedDirectiveWithoutUseAgnosticStrategies} T
181
+ * @template {CommentedDirectiveWithoutUseAgnosticStrategies} U
182
+ * @param {T} currentFileCommentedDirective The current file's commented directive.
183
+ * @param {U} importedFileCommentedDirective The imported file's commented directive.
184
+ * @returns The blockedImport object for the identified blocked import at hand.
184
185
  */
185
- const makeIntroForSpecificViolationMessage = (
186
+ export const makeBlockedImport = (
186
187
  currentFileCommentedDirective,
187
188
  importedFileCommentedDirective
188
- ) =>
189
- commonsMakeIntroForSpecificViolationMessage(
190
- commentedDirectives_commentedModules,
191
- currentFileCommentedDirective,
192
- importedFileCommentedDirective
193
- );
189
+ ) => {
190
+ return Object.freeze({
191
+ blockedImport: importedFileCommentedDirective,
192
+ message: `${commonsMakeIntroForSpecificViolationMessage(
193
+ currentFileCommentedDirective,
194
+ importedFileCommentedDirective
195
+ )} ${
196
+ jscommentsConfig[directive21ConfigName][currentFileCommentedDirective][
197
+ importedFileCommentedDirective
198
+ ]
199
+ }`,
200
+ });
201
+ };
194
202
 
195
203
  export const commentedDirectives_blockedImports = Object.freeze({
196
204
  [USE_SERVER_LOGICS]: [
197
205
  // USE_SERVER_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_SERVER_LOGICS
198
- {
199
- blockedImport: USE_CLIENT_LOGICS,
200
- message: `${makeIntroForSpecificViolationMessage(
201
- USE_SERVER_LOGICS,
202
- USE_CLIENT_LOGICS
203
- )} ${
204
- jscommentsConfig[directive21ConfigName][USE_SERVER_LOGICS][
205
- USE_CLIENT_LOGICS
206
- ] // $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_CLIENT_LOGICS
207
- }`,
208
- },
206
+ makeBlockedImport(
207
+ USE_SERVER_LOGICS,
208
+ USE_CLIENT_LOGICS
209
+ ) /* $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_CLIENT_LOGICS */,
209
210
  // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_AGNOSTIC_LOGICS
210
211
  // USE_SERVER_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_SERVER_COMPONENTS
211
- {
212
- blockedImport: USE_CLIENT_COMPONENTS,
213
- message: `${makeIntroForSpecificViolationMessage(
214
- USE_SERVER_LOGICS,
215
- USE_CLIENT_COMPONENTS
216
- )} ${
217
- jscommentsConfig[directive21ConfigName][USE_SERVER_LOGICS][
218
- USE_CLIENT_COMPONENTS
219
- ] // $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_CLIENT_COMPONENTS
220
- }`,
221
- },
212
+ makeBlockedImport(
213
+ USE_SERVER_LOGICS,
214
+ USE_CLIENT_COMPONENTS
215
+ ) /* $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_CLIENT_COMPONENTS */,
222
216
  // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_AGNOSTIC_COMPONENTS
223
217
  // USE_SERVER_FUNCTIONS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_SERVER_FUNCTIONS
224
- {
225
- blockedImport: USE_CLIENT_CONTEXTS,
226
- message: `${makeIntroForSpecificViolationMessage(
227
- USE_SERVER_LOGICS,
228
- USE_CLIENT_CONTEXTS
229
- )} ${
230
- jscommentsConfig[directive21ConfigName][USE_SERVER_LOGICS][
231
- USE_CLIENT_CONTEXTS
232
- ] // $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_CLIENT_CONTEXTS
233
- }`,
234
- },
218
+ makeBlockedImport(
219
+ USE_SERVER_LOGICS,
220
+ USE_CLIENT_CONTEXTS
221
+ ) /* $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_CLIENT_CONTEXTS */,
235
222
  // USE_AGNOSTIC_CONDITIONS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_AGNOSTIC_CONDITIONS
236
223
  ],
237
224
  [USE_CLIENT_LOGICS]: [
238
- {
239
- blockedImport: USE_SERVER_LOGICS,
240
- message: `${makeIntroForSpecificViolationMessage(
241
- USE_CLIENT_LOGICS,
242
- USE_SERVER_LOGICS
243
- )} ${
244
- jscommentsConfig[directive21ConfigName][USE_CLIENT_LOGICS][
245
- USE_SERVER_LOGICS
246
- ] // $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_SERVER_LOGICS
247
- }`,
248
- },
225
+ makeBlockedImport(
226
+ USE_CLIENT_LOGICS,
227
+ USE_SERVER_LOGICS
228
+ ) /* $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_SERVER_LOGICS */,
249
229
  // USE_CLIENT_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_CLIENT_LOGICS
250
230
  // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_AGNOSTIC_LOGICS
251
- {
252
- blockedImport: USE_SERVER_COMPONENTS,
253
- message: `${makeIntroForSpecificViolationMessage(
254
- USE_CLIENT_LOGICS,
255
- USE_SERVER_COMPONENTS
256
- )} ${
257
- jscommentsConfig[directive21ConfigName][USE_CLIENT_LOGICS][
258
- USE_SERVER_COMPONENTS
259
- ] // $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_SERVER_COMPONENTS
260
- }`,
261
- },
231
+ makeBlockedImport(
232
+ USE_CLIENT_LOGICS,
233
+ USE_SERVER_COMPONENTS
234
+ ) /* $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_SERVER_COMPONENTS */,
262
235
  // USE_CLIENT_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_CLIENT_COMPONENTS
263
236
  // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_AGNOSTIC_COMPONENTS
264
237
  // USE_SERVER_FUNCTIONS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_SERVER_FUNCTIONS
@@ -266,89 +239,40 @@ export const commentedDirectives_blockedImports = Object.freeze({
266
239
  // USE_AGNOSTIC_CONDITIONS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_LOGICS#USE_AGNOSTIC_CONDITIONS
267
240
  ],
268
241
  [USE_AGNOSTIC_LOGICS]: [
269
- {
270
- blockedImport: USE_SERVER_LOGICS,
271
- message: `${makeIntroForSpecificViolationMessage(
272
- USE_AGNOSTIC_LOGICS,
273
- USE_SERVER_LOGICS
274
- )} ${
275
- jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_LOGICS][
276
- USE_SERVER_LOGICS
277
- ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_SERVER_LOGICS
278
- }`,
279
- },
280
- {
281
- blockedImport: USE_CLIENT_LOGICS,
282
- message: `${makeIntroForSpecificViolationMessage(
283
- USE_AGNOSTIC_LOGICS,
284
- USE_CLIENT_LOGICS
285
- )} ${
286
- jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_LOGICS][
287
- USE_CLIENT_LOGICS
288
- ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_CLIENT_LOGICS
289
- }`,
290
- },
242
+ makeBlockedImport(
243
+ USE_AGNOSTIC_LOGICS,
244
+ USE_SERVER_LOGICS
245
+ ) /* $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_SERVER_LOGICS */,
246
+ makeBlockedImport(
247
+ USE_AGNOSTIC_LOGICS,
248
+ USE_CLIENT_LOGICS
249
+ ) /* $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_CLIENT_LOGICS */,
291
250
  // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_AGNOSTIC_LOGICS
292
- {
293
- blockedImport: USE_SERVER_COMPONENTS,
294
- message: `${makeIntroForSpecificViolationMessage(
295
- USE_AGNOSTIC_LOGICS,
296
- USE_SERVER_COMPONENTS
297
- )} ${
298
- jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_LOGICS][
299
- USE_SERVER_COMPONENTS
300
- ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_SERVER_COMPONENTS
301
- }`,
302
- },
303
- {
304
- blockedImport: USE_CLIENT_COMPONENTS,
305
- message: `${makeIntroForSpecificViolationMessage(
306
- USE_AGNOSTIC_LOGICS,
307
- USE_CLIENT_COMPONENTS
308
- )} ${
309
- jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_LOGICS][
310
- USE_CLIENT_COMPONENTS
311
- ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_CLIENT_COMPONENTS
312
- }`,
313
- },
251
+ makeBlockedImport(
252
+ USE_AGNOSTIC_LOGICS,
253
+ USE_SERVER_COMPONENTS
254
+ ) /* $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_SERVER_COMPONENTS */,
255
+ makeBlockedImport(
256
+ USE_AGNOSTIC_LOGICS,
257
+ USE_CLIENT_COMPONENTS
258
+ ) /* $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_CLIENT_COMPONENTS */,
314
259
  // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_AGNOSTIC_COMPONENTS
315
- {
316
- blockedImport: USE_SERVER_FUNCTIONS,
317
- message: `${makeIntroForSpecificViolationMessage(
318
- USE_AGNOSTIC_LOGICS,
319
- USE_SERVER_FUNCTIONS
320
- )} ${
321
- jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_LOGICS][
322
- USE_SERVER_FUNCTIONS
323
- ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_SERVER_FUNCTIONS
324
- }`,
325
- },
326
- {
327
- blockedImport: USE_CLIENT_CONTEXTS,
328
- message: `${makeIntroForSpecificViolationMessage(
329
- USE_AGNOSTIC_LOGICS,
330
- USE_CLIENT_CONTEXTS
331
- )} ${
332
- jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_LOGICS][
333
- USE_CLIENT_CONTEXTS
334
- ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_CLIENT_CONTEXTS
335
- }`,
336
- },
260
+ makeBlockedImport(
261
+ USE_AGNOSTIC_LOGICS,
262
+ USE_SERVER_FUNCTIONS
263
+ ) /* $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_SERVER_FUNCTIONS */,
264
+ makeBlockedImport(
265
+ USE_AGNOSTIC_LOGICS,
266
+ USE_CLIENT_CONTEXTS
267
+ ) /* $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_CLIENT_CONTEXTS */,
337
268
  // USE_AGNOSTIC_CONDITIONS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_LOGICS#USE_AGNOSTIC_CONDITIONS
338
269
  ],
339
270
  [USE_SERVER_COMPONENTS]: [
340
271
  // USE_SERVER_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_COMPONENTS#USE_SERVER_LOGICS
341
- {
342
- blockedImport: USE_CLIENT_LOGICS,
343
- message: `${makeIntroForSpecificViolationMessage(
344
- USE_SERVER_COMPONENTS,
345
- USE_CLIENT_LOGICS
346
- )} ${
347
- jscommentsConfig[directive21ConfigName][USE_SERVER_COMPONENTS][
348
- USE_CLIENT_LOGICS
349
- ] // $COMMENT#DIRECTIVE21#USE_SERVER_COMPONENTS#USE_CLIENT_LOGICS
350
- }`,
351
- },
272
+ makeBlockedImport(
273
+ USE_SERVER_COMPONENTS,
274
+ USE_CLIENT_LOGICS
275
+ ) /* $COMMENT#DIRECTIVE21#USE_SERVER_COMPONENTS#USE_CLIENT_LOGICS */,
352
276
  // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_COMPONENTS#USE_AGNOSTIC_LOGICS
353
277
  // USE_SERVER_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_COMPONENTS#USE_SERVER_COMPONENTS
354
278
  // USE_CLIENT_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_COMPONENTS#USE_CLIENT_COMPONENTS
@@ -358,30 +282,16 @@ export const commentedDirectives_blockedImports = Object.freeze({
358
282
  // USE_AGNOSTIC_CONDITIONS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_COMPONENTS#USE_AGNOSTIC_CONDITIONS
359
283
  ],
360
284
  [USE_CLIENT_COMPONENTS]: [
361
- {
362
- blockedImport: USE_SERVER_LOGICS,
363
- message: `${makeIntroForSpecificViolationMessage(
364
- USE_CLIENT_COMPONENTS,
365
- USE_SERVER_LOGICS
366
- )} ${
367
- jscommentsConfig[directive21ConfigName][USE_CLIENT_COMPONENTS][
368
- USE_SERVER_LOGICS
369
- ] // $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_SERVER_LOGICS
370
- }`,
371
- },
285
+ makeBlockedImport(
286
+ USE_CLIENT_COMPONENTS,
287
+ USE_SERVER_LOGICS
288
+ ) /* $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_SERVER_LOGICS */,
372
289
  // USE_CLIENT_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_CLIENT_LOGICS
373
290
  // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_AGNOSTIC_LOGICS
374
- {
375
- blockedImport: USE_SERVER_COMPONENTS,
376
- message: `${makeIntroForSpecificViolationMessage(
377
- USE_CLIENT_COMPONENTS,
378
- USE_SERVER_COMPONENTS
379
- )} ${
380
- jscommentsConfig[directive21ConfigName][USE_CLIENT_COMPONENTS][
381
- USE_SERVER_COMPONENTS
382
- ] // $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_SERVER_COMPONENTS
383
- }`,
384
- },
291
+ makeBlockedImport(
292
+ USE_CLIENT_COMPONENTS,
293
+ USE_SERVER_COMPONENTS
294
+ ) /* $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_SERVER_COMPONENTS */,
385
295
  // USE_CLIENT_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_CLIENT_COMPONENTS
386
296
  // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_AGNOSTIC_COMPONENTS
387
297
  // USE_SERVER_FUNCTIONS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_SERVER_FUNCTIONS
@@ -389,40 +299,19 @@ export const commentedDirectives_blockedImports = Object.freeze({
389
299
  // USE_AGNOSTIC_CONDITIONS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_COMPONENTS#USE_AGNOSTIC_CONDITIONS
390
300
  ],
391
301
  [USE_AGNOSTIC_COMPONENTS]: [
392
- {
393
- blockedImport: USE_SERVER_LOGICS,
394
- message: `${makeIntroForSpecificViolationMessage(
395
- USE_AGNOSTIC_COMPONENTS,
396
- USE_SERVER_LOGICS
397
- )} ${
398
- jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_COMPONENTS][
399
- USE_SERVER_LOGICS
400
- ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_SERVER_LOGICS
401
- }`,
402
- },
403
- {
404
- blockedImport: USE_CLIENT_LOGICS,
405
- message: `${makeIntroForSpecificViolationMessage(
406
- USE_AGNOSTIC_COMPONENTS,
407
- USE_CLIENT_LOGICS
408
- )} ${
409
- jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_COMPONENTS][
410
- USE_CLIENT_LOGICS
411
- ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_CLIENT_LOGICS
412
- }`,
413
- },
302
+ makeBlockedImport(
303
+ USE_AGNOSTIC_COMPONENTS,
304
+ USE_SERVER_LOGICS
305
+ ) /* $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_SERVER_LOGICS */,
306
+ makeBlockedImport(
307
+ USE_AGNOSTIC_COMPONENTS,
308
+ USE_CLIENT_LOGICS
309
+ ) /* $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_CLIENT_LOGICS */,
414
310
  // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_AGNOSTIC_LOGICS
415
- {
416
- blockedImport: USE_SERVER_COMPONENTS,
417
- message: `${makeIntroForSpecificViolationMessage(
418
- USE_AGNOSTIC_COMPONENTS,
419
- USE_SERVER_COMPONENTS
420
- )} ${
421
- jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_COMPONENTS][
422
- USE_SERVER_COMPONENTS
423
- ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_SERVER_COMPONENTS
424
- }`,
425
- },
311
+ makeBlockedImport(
312
+ USE_AGNOSTIC_COMPONENTS,
313
+ USE_SERVER_COMPONENTS
314
+ ) /* $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_SERVER_COMPONENTS */,
426
315
  // USE_CLIENT_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_CLIENT_COMPONENTS
427
316
  // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_AGNOSTIC_COMPONENTS
428
317
  // USE_SERVER_FUNCTIONS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_COMPONENTS#USE_SERVER_FUNCTIONS
@@ -431,100 +320,44 @@ export const commentedDirectives_blockedImports = Object.freeze({
431
320
  ],
432
321
  [USE_SERVER_FUNCTIONS]: [
433
322
  // USE_SERVER_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_SERVER_LOGICS
434
- {
435
- blockedImport: USE_CLIENT_LOGICS,
436
- message: `${makeIntroForSpecificViolationMessage(
437
- USE_SERVER_FUNCTIONS,
438
- USE_CLIENT_LOGICS
439
- )} ${
440
- jscommentsConfig[directive21ConfigName][USE_SERVER_FUNCTIONS][
441
- USE_CLIENT_LOGICS
442
- ] // $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_CLIENT_LOGICS
443
- }`,
444
- },
323
+ makeBlockedImport(
324
+ USE_SERVER_FUNCTIONS,
325
+ USE_CLIENT_LOGICS
326
+ ) /* $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_CLIENT_LOGICS */,
445
327
  // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_AGNOSTIC_LOGICS
446
- {
447
- blockedImport: USE_SERVER_COMPONENTS,
448
- message: `${makeIntroForSpecificViolationMessage(
449
- USE_SERVER_FUNCTIONS,
450
- USE_SERVER_COMPONENTS
451
- )} ${
452
- jscommentsConfig[directive21ConfigName][USE_SERVER_FUNCTIONS][
453
- USE_SERVER_COMPONENTS
454
- ] // $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_SERVER_COMPONENTS
455
- }`,
456
- },
457
- {
458
- blockedImport: USE_CLIENT_COMPONENTS,
459
- message: `${makeIntroForSpecificViolationMessage(
460
- USE_SERVER_FUNCTIONS,
461
- USE_CLIENT_COMPONENTS
462
- )} ${
463
- jscommentsConfig[directive21ConfigName][USE_SERVER_FUNCTIONS][
464
- USE_CLIENT_COMPONENTS
465
- ] // $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_CLIENT_COMPONENTS
466
- }`,
467
- },
468
- {
469
- blockedImport: USE_AGNOSTIC_COMPONENTS,
470
- message: `${makeIntroForSpecificViolationMessage(
471
- USE_SERVER_FUNCTIONS,
472
- USE_AGNOSTIC_COMPONENTS
473
- )} ${
474
- jscommentsConfig[directive21ConfigName][USE_SERVER_FUNCTIONS][
475
- USE_AGNOSTIC_COMPONENTS
476
- ] // $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_AGNOSTIC_COMPONENTS
477
- }`,
478
- },
328
+ makeBlockedImport(
329
+ USE_SERVER_FUNCTIONS,
330
+ USE_SERVER_COMPONENTS
331
+ ) /* $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_SERVER_COMPONENTS */,
332
+ makeBlockedImport(
333
+ USE_SERVER_FUNCTIONS,
334
+ USE_CLIENT_COMPONENTS
335
+ ) /* $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_CLIENT_COMPONENTS */,
336
+ makeBlockedImport(
337
+ USE_SERVER_FUNCTIONS,
338
+ USE_AGNOSTIC_COMPONENTS
339
+ ) /* $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_AGNOSTIC_COMPONENTS */,
479
340
  // USE_SERVER_FUNCTIONS allowed, because $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_SERVER_FUNCTIONS
480
- {
481
- blockedImport: USE_CLIENT_CONTEXTS,
482
- message: `${makeIntroForSpecificViolationMessage(
483
- USE_SERVER_FUNCTIONS,
484
- USE_CLIENT_CONTEXTS
485
- )} ${
486
- jscommentsConfig[directive21ConfigName][USE_SERVER_FUNCTIONS][
487
- USE_CLIENT_CONTEXTS
488
- ] // $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_CLIENT_CONTEXTS
489
- }`,
490
- },
491
- {
492
- blockedImport: USE_AGNOSTIC_CONDITIONS,
493
- message: `${makeIntroForSpecificViolationMessage(
494
- USE_SERVER_FUNCTIONS,
495
- USE_AGNOSTIC_CONDITIONS
496
- )} ${
497
- jscommentsConfig[directive21ConfigName][USE_SERVER_FUNCTIONS][
498
- USE_AGNOSTIC_CONDITIONS
499
- ] // $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_AGNOSTIC_CONDITIONS
500
- }`,
501
- },
341
+ makeBlockedImport(
342
+ USE_SERVER_FUNCTIONS,
343
+ USE_CLIENT_CONTEXTS
344
+ ) /* $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_CLIENT_CONTEXTS */,
345
+ makeBlockedImport(
346
+ USE_SERVER_FUNCTIONS,
347
+ USE_AGNOSTIC_CONDITIONS
348
+ ) /* $COMMENT#DIRECTIVE21#USE_SERVER_FUNCTIONS#USE_AGNOSTIC_CONDITIONS */,
502
349
  ],
503
350
  [USE_CLIENT_CONTEXTS]: [
504
- {
505
- blockedImport: USE_SERVER_LOGICS,
506
- message: `${makeIntroForSpecificViolationMessage(
507
- USE_CLIENT_CONTEXTS,
508
- USE_SERVER_LOGICS
509
- )} ${
510
- jscommentsConfig[directive21ConfigName][USE_CLIENT_CONTEXTS][
511
- USE_SERVER_LOGICS
512
- ] // $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_SERVER_LOGICS
513
- }`,
514
- },
351
+ makeBlockedImport(
352
+ USE_CLIENT_CONTEXTS,
353
+ USE_SERVER_LOGICS
354
+ ) /* $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_SERVER_LOGICS */,
515
355
  // USE_CLIENT_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_CLIENT_LOGICS
516
356
  // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_AGNOSTIC_LOGICS
517
- {
518
- blockedImport: USE_SERVER_COMPONENTS,
519
- message: `${makeIntroForSpecificViolationMessage(
520
- USE_CLIENT_CONTEXTS,
521
- USE_SERVER_COMPONENTS
522
- )} ${
523
- jscommentsConfig[directive21ConfigName][USE_CLIENT_CONTEXTS][
524
- USE_SERVER_COMPONENTS
525
- ] // $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_SERVER_COMPONENTS
526
- }`,
527
- },
357
+ makeBlockedImport(
358
+ USE_CLIENT_CONTEXTS,
359
+ USE_SERVER_COMPONENTS
360
+ ) /* $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_SERVER_COMPONENTS */,
528
361
  // USE_CLIENT_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_CLIENT_COMPONENTS
529
362
  // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_AGNOSTIC_COMPONENTS
530
363
  // USE_SERVER_FUNCTIONS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_SERVER_FUNCTIONS
@@ -532,57 +365,26 @@ export const commentedDirectives_blockedImports = Object.freeze({
532
365
  // USE_AGNOSTIC_CONDITIONS allowed, because $COMMENT#DIRECTIVE21#USE_CLIENT_CONTEXTS#USE_AGNOSTIC_CONDITIONS
533
366
  ],
534
367
  [USE_AGNOSTIC_CONDITIONS]: [
535
- {
536
- blockedImport: USE_SERVER_LOGICS,
537
- message: `${makeIntroForSpecificViolationMessage(
538
- USE_AGNOSTIC_CONDITIONS,
539
- USE_SERVER_LOGICS
540
- )} ${
541
- jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_CONDITIONS][
542
- USE_SERVER_LOGICS
543
- ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_SERVER_LOGICS
544
- }`,
545
- },
546
- {
547
- blockedImport: USE_CLIENT_LOGICS,
548
- message: `${makeIntroForSpecificViolationMessage(
549
- USE_AGNOSTIC_CONDITIONS,
550
- USE_CLIENT_LOGICS
551
- )} ${
552
- jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_CONDITIONS][
553
- USE_CLIENT_LOGICS
554
- ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_CLIENT_LOGICS
555
- }`,
556
- },
368
+ makeBlockedImport(
369
+ USE_AGNOSTIC_CONDITIONS,
370
+ USE_SERVER_LOGICS
371
+ ) /* $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_SERVER_LOGICS */,
372
+ makeBlockedImport(
373
+ USE_AGNOSTIC_CONDITIONS,
374
+ USE_CLIENT_LOGICS
375
+ ) /* $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_CLIENT_LOGICS */,
557
376
  // USE_AGNOSTIC_LOGICS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_AGNOSTIC_LOGICS
558
377
  // USE_SERVER_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_SERVER_COMPONENTS
559
378
  // USE_CLIENT_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_CLIENT_COMPONENTS
560
379
  // USE_AGNOSTIC_COMPONENTS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_AGNOSTIC_COMPONENTS
561
- {
562
- blockedImport: USE_SERVER_FUNCTIONS,
563
- message: `${makeIntroForSpecificViolationMessage(
564
- USE_AGNOSTIC_CONDITIONS,
565
- USE_SERVER_FUNCTIONS
566
- )} ${
567
- jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_CONDITIONS][
568
- USE_SERVER_FUNCTIONS
569
- ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_SERVER_FUNCTIONS
570
- }`,
571
- },
572
- {
573
- blockedImport: USE_CLIENT_CONTEXTS,
574
- message: `${makeIntroForSpecificViolationMessage(
575
- USE_AGNOSTIC_CONDITIONS,
576
- USE_CLIENT_CONTEXTS
577
- )} ${
578
- jscommentsConfig[directive21ConfigName][USE_AGNOSTIC_CONDITIONS][
579
- USE_CLIENT_CONTEXTS
580
- ] // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_CLIENT_CONTEXTS
581
- }`,
582
- },
380
+ makeBlockedImport(
381
+ USE_AGNOSTIC_CONDITIONS,
382
+ USE_SERVER_FUNCTIONS
383
+ ) /* $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_SERVER_FUNCTIONS */,
384
+ makeBlockedImport(
385
+ USE_AGNOSTIC_CONDITIONS,
386
+ USE_CLIENT_CONTEXTS
387
+ ) /* $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_CLIENT_CONTEXTS */,
583
388
  // USE_AGNOSTIC_CONDITIONS allowed, because $COMMENT#DIRECTIVE21#USE_AGNOSTIC_CONDITIONS#USE_AGNOSTIC_CONDITIONS
584
389
  ],
585
- [USE_AGNOSTIC_STRATEGIES]: [
586
- // $COMMENT#DIRECTIVE21#USE_AGNOSTIC_STRATEGIES
587
- ],
588
390
  });
@@ -186,6 +186,9 @@ export const importsFlow = (context, node, currentFileCommentedDirective) => {
186
186
  if (result.skip) return;
187
187
  const { importedFileCommentedDirective } = result;
188
188
 
189
+ // returns early is the current file is an Agnostic Strategies Module
190
+ if (currentFileCommentedDirective === USE_AGNOSTIC_STRATEGIES) return;
191
+
189
192
  if (
190
193
  isImportBlocked(
191
194
  currentFileCommentedDirective,
@@ -1,7 +1,4 @@
1
- import {
2
- exportNotStrategized,
3
- commentedDirectives_commentedModules,
4
- } from "../../../_commons/constants/bases.js";
1
+ import { exportNotStrategized } from "../../../_commons/constants/bases.js";
5
2
  import {
6
3
  USE_AGNOSTIC_LOGICS,
7
4
  USE_AGNOSTIC_STRATEGIES,
@@ -138,7 +135,7 @@ export const getCommentedDirectiveFromCurrentModule = (context) => {
138
135
  * - `'use agnostic strategies'`: Agnostic Strategies Modules may export JSX.
139
136
  * @param {CommentedDirective} directive The commented directive as written on top of the file (cannot be `null` at that stage).
140
137
  * @param {Extension} extension The JavaScript (TypeScript) extension of the file.
141
- * @returns {CommentedDirective | null} The verified commented directive, from which imports rules are applied. Returns `null` if the verification failed, upon which an error will be reported depending on the commented directive, since the error logic here is strictly binary.
138
+ * @returns The verified commented directive, from which imports rules are applied. Returns `null` if the verification failed, upon which an error will be reported depending on the commented directive, since the error logic here is strictly binary.
142
139
  */
143
140
  export const getVerifiedCommentedDirective = (directive, extension) => {
144
141
  const rule = commentedDirectives_extensionRules[directive];
@@ -226,8 +223,9 @@ export const getStrategizedDirective = (context, node) => {
226
223
 
227
224
  /**
228
225
  * Returns a boolean deciding if an imported file's commented directive is incompatible with the current file's commented directive.
229
- * @param {CommentedDirective} currentFileCommentedDirective The current file's commented directive.
230
- * @param {CommentedDirectiveWithoutUseAgnosticStrategies} importedFileCommentedDirective The imported file's commented directive.
226
+ * @template {CommentedDirectiveWithoutUseAgnosticStrategies} T
227
+ * @param {T} currentFileCommentedDirective The current file's commented directive.
228
+ * @param {T} importedFileCommentedDirective The imported file's commented directive.
231
229
  * @returns `true` if the import is blocked, as established in `commentedDirectives_BlockedImports`.
232
230
  */
233
231
  export const isImportBlocked = (
@@ -244,14 +242,13 @@ export const isImportBlocked = (
244
242
 
245
243
  /**
246
244
  * Lists in an message the commented modules incompatible with a commented module based on its commented directive.
247
- * @param {CommentedDirective} commentedDirective The commented directive of the commented module.
245
+ * @param {CommentedDirectiveWithoutUseAgnosticStrategies} commentedDirective The commented directive of the commented module.
248
246
  * @returns The message listing the incompatible commented modules.
249
247
  */
250
248
  export const makeMessageFromCurrentFileCommentedDirective = (
251
249
  commentedDirective
252
250
  ) =>
253
251
  makeMessageFromCurrentFileResolvedDirective(
254
- commentedDirectives_commentedModules,
255
252
  commentedDirectives_blockedImports,
256
253
  commentedDirective
257
254
  );
@@ -260,8 +257,9 @@ export const makeMessageFromCurrentFileCommentedDirective = (
260
257
 
261
258
  /**
262
259
  * Finds the `message` for the specific violation of commented directives import rules based on `commentedDirectives_BlockedImports`.
263
- * @param {CommentedDirective} currentFileCommentedDirective The current file's commented directive.
264
- * @param {CommentedDirectiveWithoutUseAgnosticStrategies} importedFileCommentedDirective The imported file's commented directive.
260
+ * @template {CommentedDirectiveWithoutUseAgnosticStrategies} T
261
+ * @param {T} currentFileCommentedDirective The current file's commented directive.
262
+ * @param {T} importedFileCommentedDirective The imported file's commented directive.
265
263
  * @returns The corresponding `message`.
266
264
  */
267
265
  export const findSpecificViolationMessage = (
@@ -8,7 +8,7 @@ import {
8
8
  } from "../_commons/constants/bases.js";
9
9
 
10
10
  /**
11
- * @typedef {import('../../types/agnostic20/_commons/typedefs.js').Plugin} Plugin
11
+ * @typedef {import('../../types/directive21/_commons/typedefs.js').Plugin} Plugin
12
12
  */
13
13
 
14
14
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-use-agnostic",
3
- "version": "0.10.3",
3
+ "version": "0.10.4",
4
4
  "description": "Highlights problematic server-client imports in projects made with the Fullstack React Architecture.",
5
5
  "keywords": [
6
6
  "eslint",