eslint-plugin-use-agnostic 1.7.0 → 1.7.2
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.
|
@@ -4,3 +4,5 @@ import { resolvedConfigData } from "../../../comments.config.mjs";
|
|
|
4
4
|
|
|
5
5
|
/** @type {ResolvedConfigData} `resolvedConfigData` can be imported as is but I've noticed that for some reason the type-safety is more advanced when it is re-typed and re-exported, here as `commentVariablesData`. */
|
|
6
6
|
export const commentVariablesData = resolvedConfigData;
|
|
7
|
+
|
|
8
|
+
export const directive21Data = commentVariablesData.directive21;
|
|
@@ -396,6 +396,7 @@ export const environments_allowedChainImportEnvironments = Object.freeze({
|
|
|
396
396
|
[AGNOSTIC]: agnostic_allowedChainImportEnvironments,
|
|
397
397
|
});
|
|
398
398
|
|
|
399
|
+
// mapped commented directives to their React directives
|
|
399
400
|
export const commentedDirectives_reactDirectives = Object.freeze({
|
|
400
401
|
[USE_SERVER_LOGICS]: null,
|
|
401
402
|
[USE_CLIENT_LOGICS]: "use client",
|
|
@@ -409,6 +410,7 @@ export const commentedDirectives_reactDirectives = Object.freeze({
|
|
|
409
410
|
[USE_AGNOSTIC_STRATEGIES]: null,
|
|
410
411
|
});
|
|
411
412
|
|
|
413
|
+
// mapped React directives to textual needs
|
|
412
414
|
/** @type {Map<typeof USE_SERVER | typeof USE_CLIENT | typeof USE_AGNOSTIC | null, `the React "${typeof USE_SERVER}"` | `the React "${typeof USE_CLIENT}"` | `the React "${typeof USE_AGNOSTIC}"` | "no React" `>} */
|
|
413
415
|
export const reactDirectives_asTexts = new Map([
|
|
414
416
|
[USE_SERVER, `the React "${USE_SERVER}"`],
|
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 {
|
|
@@ -123,3 +130,5 @@ export {
|
|
|
123
130
|
getStrategizedDirective,
|
|
124
131
|
isImportBlocked as isImportBlockedDirective21,
|
|
125
132
|
} from "./directive21/_commons/utilities/helpers.js";
|
|
133
|
+
|
|
134
|
+
export { directive21Data } from "../jscomments/_commons/constants/data.js";
|
package/package.json
CHANGED
package/types/index.d.ts
CHANGED
|
@@ -16,8 +16,6 @@ export const directive21ConfigName: "directive21";
|
|
|
16
16
|
export const enforceEffectiveDirectivesRuleName: "enforce-effective-directives-import-rules";
|
|
17
17
|
export const enforceCommentedDirectivesRuleName: "enforce-commented-directives-import-rules";
|
|
18
18
|
|
|
19
|
-
// NEW
|
|
20
|
-
|
|
21
19
|
// JavaScript/TypeScript extensions array
|
|
22
20
|
export const EXTENSIONS: readonly [
|
|
23
21
|
".tsx",
|
|
@@ -303,6 +301,34 @@ export const commentedStrategies_commentedDirectives: Readonly<{
|
|
|
303
301
|
[AT_AGNOSTIC_CONDITIONS]: "use agnostic conditions";
|
|
304
302
|
}>;
|
|
305
303
|
|
|
304
|
+
// environments
|
|
305
|
+
export const SERVER: "server";
|
|
306
|
+
export const CLIENT: "client";
|
|
307
|
+
export const AGNOSTIC: "agnostic";
|
|
308
|
+
|
|
309
|
+
export const environments_allowedChainImportEnvironments: Readonly<{
|
|
310
|
+
[SERVER]: readonly ["server", "agnostic"];
|
|
311
|
+
[CLIENT]: readonly ["client", "agnostic"];
|
|
312
|
+
[AGNOSTIC]: readonly ["agnostic"];
|
|
313
|
+
}>;
|
|
314
|
+
|
|
315
|
+
// mapped commented directives to their React directives
|
|
316
|
+
export const commentedDirectives_reactDirectives: Readonly<{
|
|
317
|
+
[USE_SERVER_LOGICS]: null;
|
|
318
|
+
[USE_CLIENT_LOGICS]: "use client";
|
|
319
|
+
[USE_AGNOSTIC_LOGICS]: "use agnostic";
|
|
320
|
+
[USE_SERVER_COMPONENTS]: null;
|
|
321
|
+
[USE_CLIENT_COMPONENTS]: "use client";
|
|
322
|
+
[USE_AGNOSTIC_COMPONENTS]: "use agnostic";
|
|
323
|
+
[USE_SERVER_FUNCTIONS]: "use server";
|
|
324
|
+
[USE_CLIENT_CONTEXTS]: "use client";
|
|
325
|
+
[USE_AGNOSTIC_CONDITIONS]: null;
|
|
326
|
+
[USE_AGNOSTIC_STRATEGIES]: null;
|
|
327
|
+
}>;
|
|
328
|
+
|
|
329
|
+
/** Typing currently unavailable. To be used by chaining .importingCommentedDirective.importedCommentedDirective to obtained the reason why a module import is or not allowed. */
|
|
330
|
+
export const directive21Data: object;
|
|
331
|
+
|
|
306
332
|
/**
|
|
307
333
|
* Gets the commented directive of a module from its ESLint `SourceCode` object.
|
|
308
334
|
*
|