eslint-plugin-use-agnostic 1.6.10 → 1.7.1

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.
@@ -31,9 +31,9 @@ import {
31
31
  /* getCommentedDirectiveFromSourceCode */
32
32
 
33
33
  /**
34
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#DETECTQUOTETYPE
35
- * @param {string} string $COMMENT#JSDOC#PARAMS#DIRECTIVE21#STRING
36
- * @returns $COMMENT#JSDOC#RETURNS#DIRECTIVE21#DETECTQUOTETYPE
34
+ * Detects whether a string is single- or double-quoted.
35
+ * @param {string} string The original string.
36
+ * @returns `true` if single-quoted, `false` if double-quoted, `null` if neither.
37
37
  */
38
38
  const detectQuoteType = (string) => {
39
39
  if (string.startsWith("'") && string.endsWith("'")) {
@@ -46,9 +46,9 @@ const detectQuoteType = (string) => {
46
46
  };
47
47
 
48
48
  /**
49
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#STRIPSINGLEQUOTES
50
- * @param {string} string $COMMENT#JSDOC#PARAMS#DIRECTIVE21#STRING
51
- * @returns $COMMENT#JSDOC#RETURNS#DIRECTIVE21#STRIPSINGLEQUOTES
49
+ * Removes single quotes from a string known to be single-quoted.
50
+ * @param {string} string The original string.
51
+ * @returns The string with quotes removed.
52
52
  */
53
53
  const stripSingleQuotes = (string) => {
54
54
  if (string.startsWith("'") && string.endsWith("'")) {
@@ -58,9 +58,9 @@ const stripSingleQuotes = (string) => {
58
58
  };
59
59
 
60
60
  /**
61
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#STRIPDOUBLEQUOTES
62
- * @param {string} string $COMMENT#JSDOC#PARAMS#DIRECTIVE21#STRING
63
- * @returns $COMMENT#JSDOC#RETURNS#DIRECTIVE21#STRIPSINGLEQUOTES
61
+ * Removes double quotes from a string known to be double-quoted.
62
+ * @param {string} string The original string.
63
+ * @returns The string with quotes removed.
64
64
  */
65
65
  const stripDoubleQuotes = (string) => {
66
66
  if (string.startsWith('"') && string.endsWith('"')) {
@@ -70,21 +70,21 @@ const stripDoubleQuotes = (string) => {
70
70
  };
71
71
 
72
72
  /**
73
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#GETCOMMENTEDDIRECTIVEFROMSOURCECODE1
73
+ * Gets the commented directive of a module from its ESLint `SourceCode` object.
74
74
  *
75
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#GETCOMMENTEDDIRECTIVEFROMSOURCECODE2
76
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERLOGICSA
77
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTLOGICSA
78
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICLOGICSA
79
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERCOMPONENTSA
80
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTCOMPONENTSA
81
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICCOMPONENTSA
82
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERFUNCTIONSA
83
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTCONTEXTSA
84
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICCONDITIONSA
85
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICSTRATEGIESA
86
- * @param {SourceCode} sourceCode $COMMENT#JSDOC#PARAMS#DIRECTIVE21#SOURCECODE
87
- * @returns $COMMENT#JSDOC#RETURNS#DIRECTIVE21#GETCOMMENTEDDIRECTIVEFROMSOURCECODE
75
+ * Accepted directives for the default Directive-First Architecture are (single or double quotes included):
76
+ * - `'use server logics'`, `"use server logics"` denoting a Server Logics Module.
77
+ * - `'use client logics'`, `"use client logics"` denoting a Client Logics Module.
78
+ * - `'use agnostic logics'`, `"use agnostic logics"` denoting an Agnostic Logics Module.
79
+ * - `'use server components'`, `"use server components"` denoting a Server Components Module.
80
+ * - `'use client components'`, `"use client components"` denoting a Client Components Module.
81
+ * - `'use agnostic components'`, `"use agnostic components"` denoting an Agnostic Components Module.
82
+ * - `'use server functions'`, `"use server functions"` denoting a Server Functions Module.
83
+ * - `'use client contexts'`, `"use client contexts"` denoting a Client Contexts Module.
84
+ * - `'use agnostic conditions'`, `"use agnostic conditions"` denoting an Agnostic Conditions Module.
85
+ * - `'use agnostic strategies'`, `"use agnostic strategies"` denoting an Agnostic Strategies Module.
86
+ * @param {SourceCode} sourceCode The ESLint SourceCode object.
87
+ * @returns The commented directive, or lack thereof via `null`. Given the strictness of this architecture, the lack of a directive is considered a mistake. (Though rules may provide the opportunity to declare a default, and configs with preset defaults may become provided.)
88
88
  */
89
89
  export const getCommentedDirectiveFromSourceCode = (sourceCode) => {
90
90
  // gets all comments from the source code
@@ -132,21 +132,21 @@ export const getCommentedDirectiveFromSourceCode = (sourceCode) => {
132
132
  /* getCommentedDirectiveFromCurrentModule */
133
133
 
134
134
  /**
135
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#GETCOMMENTEDDIRECTIVEFROMCURRENTMODULE1
135
+ * Gets the commented directive of the current module.
136
136
  *
137
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#GETCOMMENTEDDIRECTIVEFROMSOURCECODE2
138
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERLOGICSA
139
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTLOGICSA
140
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICLOGICSA
141
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERCOMPONENTSA
142
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTCOMPONENTSA
143
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICCOMPONENTSA
144
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERFUNCTIONSA
145
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTCONTEXTSA
146
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICCONDITIONSA
147
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICSTRATEGIESA
148
- * @param {Context} context $COMMENT#JSDOC#PARAMS#CONTEXTB
149
- * @returns $COMMENT#JSDOC#RETURNS#DIRECTIVE21#GETCOMMENTEDDIRECTIVEFROMSOURCECODE
137
+ * Accepted directives for the default Directive-First Architecture are (single or double quotes included):
138
+ * - `'use server logics'`, `"use server logics"` denoting a Server Logics Module.
139
+ * - `'use client logics'`, `"use client logics"` denoting a Client Logics Module.
140
+ * - `'use agnostic logics'`, `"use agnostic logics"` denoting an Agnostic Logics Module.
141
+ * - `'use server components'`, `"use server components"` denoting a Server Components Module.
142
+ * - `'use client components'`, `"use client components"` denoting a Client Components Module.
143
+ * - `'use agnostic components'`, `"use agnostic components"` denoting an Agnostic Components Module.
144
+ * - `'use server functions'`, `"use server functions"` denoting a Server Functions Module.
145
+ * - `'use client contexts'`, `"use client contexts"` denoting a Client Contexts Module.
146
+ * - `'use agnostic conditions'`, `"use agnostic conditions"` denoting an Agnostic Conditions Module.
147
+ * - `'use agnostic strategies'`, `"use agnostic strategies"` denoting an Agnostic Strategies Module.
148
+ * @param {Context} context The ESLint rule's `context` object.
149
+ * @returns The commented directive, or lack thereof via `null`. Given the strictness of this architecture, the lack of a directive is considered a mistake. (Though rules may provide the opportunity to declare a default, and configs with preset defaults may become provided.)
150
150
  */
151
151
  export const getCommentedDirectiveFromCurrentModule = (context) => {
152
152
  const sourceCode = context.sourceCode;
@@ -158,21 +158,21 @@ export const getCommentedDirectiveFromCurrentModule = (context) => {
158
158
  /* getCommentedDirectiveFromImportedModule */
159
159
 
160
160
  /**
161
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#GETCOMMENTEDDIRECTIVEFROMIMPORTEDMODULE1
161
+ * Gets the commented directive of the imported module.
162
162
  *
163
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#GETCOMMENTEDDIRECTIVEFROMSOURCECODE2
164
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERLOGICSA
165
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTLOGICSA
166
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICLOGICSA
167
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERCOMPONENTSA
168
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTCOMPONENTSA
169
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICCOMPONENTSA
170
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERFUNCTIONSA
171
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTCONTEXTSA
172
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICCONDITIONSA
173
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICSTRATEGIESA
174
- * @param {string} resolvedPath $COMMENT#JSDOC#PARAMS#RESOLVEDPATH
175
- * @returns $COMMENT#JSDOC#RETURNS#DIRECTIVE21#GETCOMMENTEDDIRECTIVEFROMSOURCECODE Now also provides the obtained SourceCode object.
163
+ * Accepted directives for the default Directive-First Architecture are (single or double quotes included):
164
+ * - `'use server logics'`, `"use server logics"` denoting a Server Logics Module.
165
+ * - `'use client logics'`, `"use client logics"` denoting a Client Logics Module.
166
+ * - `'use agnostic logics'`, `"use agnostic logics"` denoting an Agnostic Logics Module.
167
+ * - `'use server components'`, `"use server components"` denoting a Server Components Module.
168
+ * - `'use client components'`, `"use client components"` denoting a Client Components Module.
169
+ * - `'use agnostic components'`, `"use agnostic components"` denoting an Agnostic Components Module.
170
+ * - `'use server functions'`, `"use server functions"` denoting a Server Functions Module.
171
+ * - `'use client contexts'`, `"use client contexts"` denoting a Client Contexts Module.
172
+ * - `'use agnostic conditions'`, `"use agnostic conditions"` denoting an Agnostic Conditions Module.
173
+ * - `'use agnostic strategies'`, `"use agnostic strategies"` denoting an Agnostic Strategies Module.
174
+ * @param {string} resolvedPath The resolved path of the imported module.
175
+ * @returns The commented directive, or lack thereof via `null`. Now also provides the obtained `SourceCode` object. Given the strictness of this architecture, the lack of a directive is considered a mistake. (Though rules may provide the opportunity to declare a default, and configs with preset defaults may become provided.)
176
176
  */
177
177
  export const getCommentedDirectiveFromImportedModule = (resolvedPath) => {
178
178
  const sourceCode = getSourceCodeFromFilePath(resolvedPath);
@@ -184,20 +184,20 @@ export const getCommentedDirectiveFromImportedModule = (resolvedPath) => {
184
184
  /* getVerifiedCommentedDirective */
185
185
 
186
186
  /**
187
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#GETVERIFIEDCOMMENTEDDIRECTIVE
188
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERLOGICSB
189
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTLOGICSB
190
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICLOGICSB
191
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERCOMPONENTSB
192
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTCOMPONENTSB
193
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICCOMPONENTSB
194
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERFUNCTIONSB
195
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTCONTEXTSB
196
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICCONDITIONSB
197
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICSTRATEGIESB
198
- * @param {CommentedDirective} directive $COMMENT#JSDOC#PARAMS#DIRECTIVE21#DIRECTIVE
199
- * @param {Extension} extension $COMMENT#JSDOC#PARAMS#EXTENSION
200
- * @returns $COMMENT#JSDOC#RETURNS#DIRECTIVE21#GETVERIFIEDCOMMENTEDDIRECTIVE
187
+ * Ensures that a module's commented directive is consistent with its file extension (depending on whether it ends with 'x' for JSX).
188
+ * - `'use server logics'`: Server Logics Modules do NOT export JSX.
189
+ * - `'use client logics'`: Client Logics Modules do NOT export JSX.
190
+ * - `'use agnostic logics'`: Agnostic Logics Modules do NOT export JSX.
191
+ * - `'use server components'`: Server Components Modules ONLY export JSX.
192
+ * - `'use client components'`: Client Components Modules ONLY export JSX.
193
+ * - `'use agnostic components'`: Agnostic Components Modules ONLY export JSX.
194
+ * - `'use server functions'`: Server Functions Modules do NOT export JSX.
195
+ * - `'use client contexts'`: Client Contexts Modules ONLY export JSX.
196
+ * - `'use agnostic conditions'`: Agnostic Conditions Modules ONLY export JSX.
197
+ * - `'use agnostic strategies'`: Agnostic Strategies Modules may export JSX.
198
+ * @param {CommentedDirective} directive The commented directive as written on top of the file (cannot be `null` at that stage).
199
+ * @param {Extension} extension The JavaScript (TypeScript) extension of the file.
200
+ * @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.
201
201
  */
202
202
  export const getVerifiedCommentedDirective = (directive, extension) => {
203
203
  const rule = commentedDirectives_extensionRules[directive];
@@ -214,10 +214,10 @@ export const getVerifiedCommentedDirective = (directive, extension) => {
214
214
  /* getStrategizedDirective */
215
215
 
216
216
  /**
217
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#GETSTRATEGIZEDDIRECTIVE
218
- * @param {Context} context $COMMENT#JSDOC#PARAMS#CONTEXTB
219
- * @param {ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | ExportDefaultDeclaration} node $COMMENT#JSDOC#PARAMS#NODE
220
- * @returns $COMMENT#JSDOC#RETURNS#DIRECTIVE21#GETSTRATEGIZEDDIRECTIVE
217
+ * Gets the interpreted directive from a specified commented Strategy (such as `@serverLogics`) nested inside the import (or export) declaration for an import (or export) from an Agnostic Strategies Module.
218
+ * @param {Context} context The ESLint rule's `context` object.
219
+ * @param {ImportDeclaration | ExportNamedDeclaration | ExportAllDeclaration | ExportDefaultDeclaration} node The ESLint `node` of the rule's current traversal.
220
+ * @returns The interpreted directive, a.k.a. strategized directive, or lack thereof via `null`.
221
221
  */
222
222
  export const getStrategizedDirective = (context, node) => {
223
223
  // gets the first nested `/* */` comment inside the node
@@ -246,11 +246,11 @@ export const getStrategizedDirective = (context, node) => {
246
246
  /* addressDirectiveIfAgnosticStrategies */
247
247
 
248
248
  /**
249
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#ADDRESSDIRECTIVEIFAGNOSTICSTRATEGIES
250
- * @param {Context} context $COMMENT#JSDOC#PARAMS#CONTEXTB
251
- * @param {ExportNamedDeclaration | ExportAllDeclaration | ExportDefaultDeclaration} node $COMMENT#JSDOC#PARAMS#NODE
252
- * @param {CommentedDirective} currentFileCommentedDirective $COMMENT#JSDOC#PARAMS#DIRECTIVE21#CURRENTFILECOMMENTEDDIRECTIVE
253
- * @returns $COMMENT#JSDOC#RETURNS#DIRECTIVE21#ADDRESSDIRECTIVEIFAGNOSTICSTRATEGIES
249
+ * Verifies the current node's export strategy if the current commented directive is `"use agnostic strategies"` by reporting `exportNotStrategized` in case an export is not strategized in an Agnostic Strategies Module.
250
+ * @param {Context} context The ESLint rule's `context` object.
251
+ * @param {ExportNamedDeclaration | ExportAllDeclaration | ExportDefaultDeclaration} node The ESLint `node` of the rule's current traversal.
252
+ * @param {CommentedDirective} currentFileCommentedDirective The current file's commented directive.
253
+ * @returns The commented directive, the addressed strategy (as a commented directive) or `null` in case of failure.
254
254
  */
255
255
  export const addressDirectiveIfAgnosticStrategies = (
256
256
  context,
@@ -276,10 +276,10 @@ export const addressDirectiveIfAgnosticStrategies = (
276
276
  /* isImportBlocked */
277
277
 
278
278
  /**
279
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#ISIMPORTBLOCKED
280
- * @param {CommentedDirectiveWithoutUseAgnosticStrategies} currentFileCommentedDirective $COMMENT#JSDOC#PARAMS#DIRECTIVE21#CURRENTFILECOMMENTEDDIRECTIVE
281
- * @param {CommentedDirectiveWithoutUseAgnosticStrategies} importedFileCommentedDirective $COMMENT#JSDOC#PARAMS#DIRECTIVE21#IMPORTEDFILECOMMENTEDDIRECTIVE
282
- * @returns $COMMENT#JSDOC#RETURNS#DIRECTIVE21#ISIMPORTBLOCKED
279
+ * Returns a boolean deciding if an imported file's commented directive is incompatible with the current file's commented directive.
280
+ * @param {CommentedDirectiveWithoutUseAgnosticStrategies} currentFileCommentedDirective The current file's commented directive.
281
+ * @param {CommentedDirectiveWithoutUseAgnosticStrategies} importedFileCommentedDirective The imported file's commented directive.
282
+ * @returns `true` if the import is blocked, as established in `commentedDirectives_BlockedImports`.
283
283
  */
284
284
  export const isImportBlocked = (
285
285
  currentFileCommentedDirective,
@@ -294,9 +294,9 @@ export const isImportBlocked = (
294
294
  /* makeMessageFromCurrentFileCommentedDirective */
295
295
 
296
296
  /**
297
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#MAKEMESSAGEFROMCURRENTFILECOMMENTEDDIRECTIVE
298
- * @param {CommentedDirectiveWithoutUseAgnosticStrategies} commentedDirective $COMMENT#JSDOC#PARAMS#DIRECTIVE21#COMMENTEDDIRECTIVE
299
- * @returns $COMMENT#JSDOC#RETURNS#DIRECTIVE21#MAKEMESSAGEFROMCURRENTFILECOMMENTEDDIRECTIVE
297
+ * Lists in an message the commented modules incompatible with a commented module based on its commented directive.
298
+ * @param {CommentedDirectiveWithoutUseAgnosticStrategies} commentedDirective The commented directive of the commented module.
299
+ * @returns The message listing the incompatible commented modules.
300
300
  */
301
301
  export const makeMessageFromCurrentFileCommentedDirective = (
302
302
  commentedDirective
@@ -309,10 +309,10 @@ export const makeMessageFromCurrentFileCommentedDirective = (
309
309
  /* findSpecificViolationMessage */
310
310
 
311
311
  /**
312
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#FINDSPECIFICVIOLATIONMESSAGE
313
- * @param {CommentedDirectiveWithoutUseAgnosticStrategies} currentFileCommentedDirective $COMMENT#JSDOC#PARAMS#DIRECTIVE21#CURRENTFILECOMMENTEDDIRECTIVE
314
- * @param {CommentedDirectiveWithoutUseAgnosticStrategies} importedFileCommentedDirective $COMMENT#JSDOC#PARAMS#DIRECTIVE21#IMPORTEDFILECOMMENTEDDIRECTIVE
315
- * @returns $COMMENT#JSDOC#RETURNS#FINDSPECIFICVIOLATIONMESSAGE
312
+ * Finds the `message` for the specific violation of commented directives import rules based on `commentedDirectives_BlockedImports`.
313
+ * @param {CommentedDirectiveWithoutUseAgnosticStrategies} currentFileCommentedDirective The current file's commented directive.
314
+ * @param {CommentedDirectiveWithoutUseAgnosticStrategies} importedFileCommentedDirective The imported file's commented directive.
315
+ * @returns The corresponding `message`.
316
316
  */
317
317
  export const findSpecificViolationMessage = (
318
318
  currentFileCommentedDirective,
@@ -12,9 +12,9 @@ import {
12
12
  */
13
13
 
14
14
  /**
15
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#MAKEDIRECTIVE21CONFIG
16
- * @param {Plugin} plugin $COMMENT#JSDOC#PARAMS#PLUGIN
17
- * @returns $COMMENT#JSDOC#RETURNS#DIRECTIVE21#MAKEDIRECTIVE21CONFIG
15
+ * Makes the directive21 config for the use-agnostic ESLint plugin.
16
+ * @param {Plugin} plugin The use-agnostic ESLint plugin itself.
17
+ * @returns The directive21 config's name as a key and its config as its value.
18
18
  */
19
19
  export const makeDirective21Config = (plugin) => ({
20
20
  [directive21ConfigName]: defineConfig([
package/library/index.js CHANGED
@@ -113,6 +113,13 @@ export {
113
113
  commentedStrategiesSet,
114
114
  // mapped commented strategies to their commented directives
115
115
  commentedStrategies_commentedDirectives,
116
+ // environments
117
+ SERVER,
118
+ CLIENT,
119
+ AGNOSTIC,
120
+ environments_allowedChainImportEnvironments,
121
+ // mapped commented directives to their React directives
122
+ commentedDirectives_reactDirectives,
116
123
  } from "./directive21/_commons/constants/bases.js";
117
124
 
118
125
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-use-agnostic",
3
- "version": "1.6.10",
3
+ "version": "1.7.1",
4
4
  "description": "Highlights problematic server-client imports in projects made with the Fullstack React Architecture.",
5
5
  "keywords": [
6
6
  "eslint",
package/types/index.d.ts CHANGED
@@ -92,56 +92,56 @@ export const directives_effectiveDirectives: Readonly<{
92
92
  }>;
93
93
 
94
94
  /**
95
- * $COMMENT#JSDOC#DEFINITIONS#AGNOSTIC20#GETDIRECTIVEFROMMODULE
96
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#NULLDIRECTIVE
97
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#USESERVER
98
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#USECLIENT
99
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#USEAGNOSTIC
100
- * @param ast $COMMENT#JSDOC#PARAMS#AGNOSTIC20#AST
101
- * @returns $COMMENT#JSDOC#RETURNS#AGNOSTIC20#GETDIRECTIVEFROMMODULE
95
+ * Gets the directive of a module from its Abstract Syntax Tree.
96
+ * - `null` denotes a server-by-default module, ideally a Server Module.
97
+ * - `'use server'` denotes a Server Functions Module.
98
+ * - `'use client'` denotes a Client Module.
99
+ * - `'use agnostic'` denotes an Agnostic Module (formerly Shared Module).
100
+ * @param ast The module's AST (Abstract Syntax Tree).
101
+ * @returns The directive, or lack thereof via `null`. The lack of a directive is considered server-by-default.
102
102
  */
103
103
  export const getDirectiveFromModule: (
104
104
  ast: TSESLintSourceCode.Program
105
105
  ) => "use server" | "use client" | "use agnostic" | null;
106
106
 
107
107
  /**
108
- * $COMMENT#JSDOC#DEFINITIONS#AGNOSTIC20#GETDIRECTIVEFROMCURRENTMODULE
109
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#NULLDIRECTIVE
110
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#USESERVER
111
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#USECLIENT
112
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#USEAGNOSTIC
113
- * @param context $COMMENT#JSDOC#PARAMS#CONTEXTB
114
- * @returns $COMMENT#JSDOC#RETURNS#AGNOSTIC20#GETDIRECTIVEFROMMODULE
108
+ * Gets the directive of the current module.
109
+ * - `null` denotes a server-by-default module, ideally a Server Module.
110
+ * - `'use server'` denotes a Server Functions Module.
111
+ * - `'use client'` denotes a Client Module.
112
+ * - `'use agnostic'` denotes an Agnostic Module (formerly Shared Module).
113
+ * @param context The ESLint rule's `context` object.
114
+ * @returns The directive, or lack thereof via `null`. The lack of a directive is considered server-by-default.
115
115
  */
116
116
  export const getDirectiveFromCurrentModule: (
117
117
  context: RuleContext<string, readonly unknown[]>
118
118
  ) => "use server" | "use client" | "use agnostic" | null;
119
119
 
120
120
  /**
121
- * $COMMENT#JSDOC#DEFINITIONS#AGNOSTIC20#GETDIRECTIVEFROMIMPORTEDMODULE
122
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#NULLDIRECTIVE
123
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#USESERVER
124
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#USECLIENT
125
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#USEAGNOSTIC
126
- * @param resolvedPath $COMMENT#JSDOC#PARAMS#RESOLVEDPATH
127
- * @returns $COMMENT#JSDOC#RETURNS#AGNOSTIC20#GETDIRECTIVEFROMMODULE
121
+ * Gets the directive of the imported module.
122
+ * - `null` denotes a server-by-default module, ideally a Server Module.
123
+ * - `'use server'` denotes a Server Functions Module.
124
+ * - `'use client'` denotes a Client Module.
125
+ * - `'use agnostic'` denotes an Agnostic Module (formerly Shared Module).
126
+ * @param resolvedPath The resolved path of the imported module.
127
+ * @returns The directive, or lack thereof via `null`. The lack of a directive is considered server-by-default.
128
128
  */
129
129
  export const getDirectiveFromImportedModule: (
130
130
  resolvedPath: string
131
131
  ) => "use server" | "use client" | "use agnostic" | null;
132
132
 
133
133
  /**
134
- * $COMMENT#JSDOC#DEFINITIONS#AGNOSTIC20#GETEFFECTIVEDIRECTIVE
135
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#USESERVERLOGICS
136
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#USESERVERCOMPONENTS
137
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#USESERVERFUNCTIONS
138
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#USECLIENTLOGICS
139
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#USECLIENTCOMPONENTS
140
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#USEAGNOSTICLOGICS
141
- * - $COMMENT#JSDOC#DETAILS#AGNOSTIC20#USEAGNOSTICCOMPONENTS
142
- * @param directive $COMMENT#JSDOC#PARAMS#AGNOSTIC20#DIRECTIVE
143
- * @param extension $COMMENT#JSDOC#PARAMS#EXTENSION
144
- * @returns $COMMENT#JSDOC#RETURNS#AGNOSTIC20#GETEFFECTIVEDIRECTIVE
134
+ * Gets the effective directive of a module, based on the combination of its directive (or lack thereof) and its extension (depending on whether it ends with 'x' for JSX).
135
+ * - `'use server logics'` denotes a Server Logics Module.
136
+ * - `'use server components'` denotes a Server Components Module.
137
+ * - `'use server functions'` denotes a Server Functions Module.
138
+ * - `'use client logics'` denotes a Client Logics Module.
139
+ * - `'use client components'` denotes a Client Components Module.
140
+ * - `'use agnostic logics'` denotes an Agnostic Logics Module.
141
+ * - `'use agnostic components'` denotes an Agnostic Components Module.
142
+ * @param directive The directive as written on top of the file (`"no directive"` if no valid directive).
143
+ * @param extension The JavaScript (TypeScript) extension of the file.
144
+ * @returns The effective directive, from which imports rules are applied.
145
145
  */
146
146
  export const getEffectiveDirective: (
147
147
  directive: "use server" | "use client" | "use agnostic" | "no directive",
@@ -169,10 +169,10 @@ export const getEffectiveDirective: (
169
169
  | null;
170
170
 
171
171
  /**
172
- * $COMMENT#JSDOC#DEFINITIONS#AGNOSTIC20#ISIMPORTBLOCKED
173
- * @param currentFileEffectiveDirective $COMMENT#JSDOC#PARAMS#AGNOSTIC20#CURRENTFILEEFFECTIVEDIRECTIVE
174
- * @param importedFileEffectiveDirective $COMMENT#JSDOC#PARAMS#AGNOSTIC20#IMPORTEDFILEEFFECTIVEDIRECTIVE
175
- * @returns $COMMENT#JSDOC#RETURNS#AGNOSTIC20#ISIMPORTBLOCKED
172
+ * Returns a boolean deciding if an imported file's effective directive is incompatible with the current file's effective directive.
173
+ * @param currentFileEffectiveDirective The current file's effective directive.
174
+ * @param importedFileEffectiveDirective The imported file's effective directive.
175
+ * @returns `true` if the import is blocked, as established in `effectiveDirectives_BlockedImports`.
176
176
  */
177
177
  export const isImportBlockedAgnostic20: (
178
178
  currentFileEffectiveDirective:
@@ -303,22 +303,47 @@ export const commentedStrategies_commentedDirectives: Readonly<{
303
303
  [AT_AGNOSTIC_CONDITIONS]: "use agnostic conditions";
304
304
  }>;
305
305
 
306
+ // environments
307
+ export const SERVER: "server";
308
+ export const CLIENT: "client";
309
+ export const AGNOSTIC: "agnostic";
310
+
311
+ export const environments_allowedChainImportEnvironments: Readonly<{
312
+ [SERVER]: readonly ["server", "agnostic"];
313
+ [CLIENT]: readonly ["client", "agnostic"];
314
+ [AGNOSTIC]: readonly ["agnostic"];
315
+ }>;
316
+
317
+ // mapped commented directives to their React directives
318
+ export const commentedDirectives_reactDirectives: Readonly<{
319
+ [USE_SERVER_LOGICS]: null;
320
+ [USE_CLIENT_LOGICS]: "use client";
321
+ [USE_AGNOSTIC_LOGICS]: "use agnostic";
322
+ [USE_SERVER_COMPONENTS]: null;
323
+ [USE_CLIENT_COMPONENTS]: "use client";
324
+ [USE_AGNOSTIC_COMPONENTS]: "use agnostic";
325
+ [USE_SERVER_FUNCTIONS]: "use server";
326
+ [USE_CLIENT_CONTEXTS]: "use client";
327
+ [USE_AGNOSTIC_CONDITIONS]: null;
328
+ [USE_AGNOSTIC_STRATEGIES]: null;
329
+ }>;
330
+
306
331
  /**
307
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#GETCOMMENTEDDIRECTIVEFROMSOURCECODE1
332
+ * Gets the commented directive of a module from its ESLint `SourceCode` object.
308
333
  *
309
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#GETCOMMENTEDDIRECTIVEFROMSOURCECODE2
310
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERLOGICSA
311
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTLOGICSA
312
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICLOGICSA
313
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERCOMPONENTSA
314
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTCOMPONENTSA
315
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICCOMPONENTSA
316
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERFUNCTIONSA
317
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTCONTEXTSA
318
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICCONDITIONSA
319
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICSTRATEGIESA
320
- * @param sourceCode $COMMENT#JSDOC#PARAMS#DIRECTIVE21#SOURCECODE
321
- * @returns $COMMENT#JSDOC#RETURNS#DIRECTIVE21#GETCOMMENTEDDIRECTIVEFROMSOURCECODE
334
+ * Accepted directives for the default Directive-First Architecture are (single or double quotes included):
335
+ * - `'use server logics'`, `"use server logics"` denoting a Server Logics Module.
336
+ * - `'use client logics'`, `"use client logics"` denoting a Client Logics Module.
337
+ * - `'use agnostic logics'`, `"use agnostic logics"` denoting an Agnostic Logics Module.
338
+ * - `'use server components'`, `"use server components"` denoting a Server Components Module.
339
+ * - `'use client components'`, `"use client components"` denoting a Client Components Module.
340
+ * - `'use agnostic components'`, `"use agnostic components"` denoting an Agnostic Components Module.
341
+ * - `'use server functions'`, `"use server functions"` denoting a Server Functions Module.
342
+ * - `'use client contexts'`, `"use client contexts"` denoting a Client Contexts Module.
343
+ * - `'use agnostic conditions'`, `"use agnostic conditions"` denoting an Agnostic Conditions Module.
344
+ * - `'use agnostic strategies'`, `"use agnostic strategies"` denoting an Agnostic Strategies Module.
345
+ * @param sourceCode The ESLint SourceCode object.
346
+ * @returns The commented directive, or lack thereof via `null`. Given the strictness of this architecture, the lack of a directive is considered a mistake. (Though rules may provide the opportunity to declare a default, and configs with preset defaults may become provided.)
322
347
  */
323
348
  export const getCommentedDirectiveFromSourceCode: (
324
349
  sourceCode: ESLintSourceCode
@@ -336,21 +361,21 @@ export const getCommentedDirectiveFromSourceCode: (
336
361
  | null;
337
362
 
338
363
  /**
339
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#GETCOMMENTEDDIRECTIVEFROMCURRENTMODULE1
364
+ * Gets the commented directive of the current module.
340
365
  *
341
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#GETCOMMENTEDDIRECTIVEFROMSOURCECODE2
342
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERLOGICSA
343
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTLOGICSA
344
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICLOGICSA
345
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERCOMPONENTSA
346
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTCOMPONENTSA
347
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICCOMPONENTSA
348
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERFUNCTIONSA
349
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTCONTEXTSA
350
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICCONDITIONSA
351
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICSTRATEGIESA
352
- * @param context $COMMENT#JSDOC#PARAMS#CONTEXTB
353
- * @returns $COMMENT#JSDOC#RETURNS#DIRECTIVE21#GETCOMMENTEDDIRECTIVEFROMSOURCECODE
366
+ * Accepted directives for the default Directive-First Architecture are (single or double quotes included):
367
+ * - `'use server logics'`, `"use server logics"` denoting a Server Logics Module.
368
+ * - `'use client logics'`, `"use client logics"` denoting a Client Logics Module.
369
+ * - `'use agnostic logics'`, `"use agnostic logics"` denoting an Agnostic Logics Module.
370
+ * - `'use server components'`, `"use server components"` denoting a Server Components Module.
371
+ * - `'use client components'`, `"use client components"` denoting a Client Components Module.
372
+ * - `'use agnostic components'`, `"use agnostic components"` denoting an Agnostic Components Module.
373
+ * - `'use server functions'`, `"use server functions"` denoting a Server Functions Module.
374
+ * - `'use client contexts'`, `"use client contexts"` denoting a Client Contexts Module.
375
+ * - `'use agnostic conditions'`, `"use agnostic conditions"` denoting an Agnostic Conditions Module.
376
+ * - `'use agnostic strategies'`, `"use agnostic strategies"` denoting an Agnostic Strategies Module.
377
+ * @param context The ESLint rule's `context` object.
378
+ * @returns The commented directive, or lack thereof via `null`. Given the strictness of this architecture, the lack of a directive is considered a mistake. (Though rules may provide the opportunity to declare a default, and configs with preset defaults may become provided.)
354
379
  */
355
380
  export const getCommentedDirectiveFromCurrentModule: (
356
381
  context: RuleContext<string, readonly unknown[]>
@@ -368,21 +393,21 @@ export const getCommentedDirectiveFromCurrentModule: (
368
393
  | null;
369
394
 
370
395
  /**
371
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#GETCOMMENTEDDIRECTIVEFROMIMPORTEDMODULE1
396
+ * Gets the commented directive of the imported module.
372
397
  *
373
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#GETCOMMENTEDDIRECTIVEFROMSOURCECODE2
374
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERLOGICSA
375
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTLOGICSA
376
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICLOGICSA
377
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERCOMPONENTSA
378
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTCOMPONENTSA
379
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICCOMPONENTSA
380
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERFUNCTIONSA
381
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTCONTEXTSA
382
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICCONDITIONSA
383
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICSTRATEGIESA
384
- * @param resolvedPath $COMMENT#JSDOC#PARAMS#RESOLVEDPATH
385
- * @returns $COMMENT#JSDOC#RETURNS#DIRECTIVE21#GETCOMMENTEDDIRECTIVEFROMSOURCECODE
398
+ * Accepted directives for the default Directive-First Architecture are (single or double quotes included):
399
+ * - `'use server logics'`, `"use server logics"` denoting a Server Logics Module.
400
+ * - `'use client logics'`, `"use client logics"` denoting a Client Logics Module.
401
+ * - `'use agnostic logics'`, `"use agnostic logics"` denoting an Agnostic Logics Module.
402
+ * - `'use server components'`, `"use server components"` denoting a Server Components Module.
403
+ * - `'use client components'`, `"use client components"` denoting a Client Components Module.
404
+ * - `'use agnostic components'`, `"use agnostic components"` denoting an Agnostic Components Module.
405
+ * - `'use server functions'`, `"use server functions"` denoting a Server Functions Module.
406
+ * - `'use client contexts'`, `"use client contexts"` denoting a Client Contexts Module.
407
+ * - `'use agnostic conditions'`, `"use agnostic conditions"` denoting an Agnostic Conditions Module.
408
+ * - `'use agnostic strategies'`, `"use agnostic strategies"` denoting an Agnostic Strategies Module.
409
+ * @param resolvedPath The resolved path of the imported module.
410
+ * @returns The commented directive, or lack thereof via `null`. Given the strictness of this architecture, the lack of a directive is considered a mistake. (Though rules may provide the opportunity to declare a default, and configs with preset defaults may become provided.)
386
411
  */
387
412
  export const getCommentedDirectiveFromImportedModule: (
388
413
  resolvedPath: string
@@ -400,20 +425,20 @@ export const getCommentedDirectiveFromImportedModule: (
400
425
  | null;
401
426
 
402
427
  /**
403
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#GETVERIFIEDCOMMENTEDDIRECTIVE
404
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERLOGICSB
405
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTLOGICSB
406
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICLOGICSB
407
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERCOMPONENTSB
408
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTCOMPONENTSB
409
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICCOMPONENTSB
410
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USESERVERFUNCTIONSB
411
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USECLIENTCONTEXTSB
412
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICCONDITIONSB
413
- * - $COMMENT#JSDOC#DETAILS#DIRECTIVE21#USEAGNOSTICSTRATEGIESB
414
- * @param directive $COMMENT#JSDOC#PARAMS#DIRECTIVE21#DIRECTIVE
415
- * @param extension $COMMENT#JSDOC#PARAMS#EXTENSION
416
- * @returns $COMMENT#JSDOC#RETURNS#DIRECTIVE21#GETVERIFIEDCOMMENTEDDIRECTIVE
428
+ * Ensures that a module's commented directive is consistent with its file extension (depending on whether it ends with 'x' for JSX).
429
+ * - `'use server logics'`: Server Logics Modules do NOT export JSX.
430
+ * - `'use client logics'`: Client Logics Modules do NOT export JSX.
431
+ * - `'use agnostic logics'`: Agnostic Logics Modules do NOT export JSX.
432
+ * - `'use server components'`: Server Components Modules ONLY export JSX.
433
+ * - `'use client components'`: Client Components Modules ONLY export JSX.
434
+ * - `'use agnostic components'`: Agnostic Components Modules ONLY export JSX.
435
+ * - `'use server functions'`: Server Functions Modules do NOT export JSX.
436
+ * - `'use client contexts'`: Client Contexts Modules ONLY export JSX.
437
+ * - `'use agnostic conditions'`: Agnostic Conditions Modules ONLY export JSX.
438
+ * - `'use agnostic strategies'`: Agnostic Strategies Modules may export JSX.
439
+ * @param directive The commented directive as written on top of the file (cannot be `null` at that stage).
440
+ * @param extension The JavaScript (TypeScript) extension of the file.
441
+ * @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.
417
442
  */
418
443
  export const getVerifiedCommentedDirective: (
419
444
  directive:
@@ -454,10 +479,10 @@ export const getVerifiedCommentedDirective: (
454
479
  | null;
455
480
 
456
481
  /**
457
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#GETSTRATEGIZEDDIRECTIVE
458
- * @param context $COMMENT#JSDOC#PARAMS#CONTEXTB
459
- * @param node $COMMENT#JSDOC#PARAMS#NODE
460
- * @returns $COMMENT#JSDOC#RETURNS#DIRECTIVE21#GETSTRATEGIZEDDIRECTIVE
482
+ * Gets the interpreted directive from a specified commented Strategy (such as `@serverLogics`) nested inside the import (or export) declaration for an import (or export) from an Agnostic Strategies Module.
483
+ * @param context The ESLint rule's `context` object.
484
+ * @param node The ESLint `node` of the rule's current traversal.
485
+ * @returns The interpreted directive, a.k.a. strategized directive, or lack thereof via `null`.
461
486
  */
462
487
  export const getStrategizedDirective: (
463
488
  context: RuleContext<string, readonly unknown[]>,
@@ -479,10 +504,10 @@ export const getStrategizedDirective: (
479
504
  | null;
480
505
 
481
506
  /**
482
- * $COMMENT#JSDOC#DEFINITIONS#DIRECTIVE21#ISIMPORTBLOCKED
483
- * @param currentFileCommentedDirective $COMMENT#JSDOC#PARAMS#DIRECTIVE21#CURRENTFILECOMMENTEDDIRECTIVE
484
- * @param importedFileCommentedDirective $COMMENT#JSDOC#PARAMS#DIRECTIVE21#IMPORTEDFILECOMMENTEDDIRECTIVE
485
- * @returns $COMMENT#JSDOC#RETURNS#DIRECTIVE21#ISIMPORTBLOCKED
507
+ * Returns a boolean deciding if an imported file's commented directive is incompatible with the current file's commented directive.
508
+ * @param currentFileCommentedDirective The current file's commented directive.
509
+ * @param importedFileCommentedDirective The imported file's commented directive.
510
+ * @returns `true` if the import is blocked, as established in `commentedDirectives_BlockedImports`.
486
511
  */
487
512
  export const isImportBlockedDirective21: (
488
513
  currentFileCommentedDirective: