eslint-plugin-use-agnostic 0.10.4 → 0.10.5
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.
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import {
|
|
2
|
+
serverLogicsComments,
|
|
3
|
+
serverComponentsComments,
|
|
4
|
+
serverFunctionsComments,
|
|
5
|
+
clientLogicsComments,
|
|
6
|
+
clientComponentsComments,
|
|
7
|
+
agnosticLogicsComments,
|
|
8
|
+
agnosticComponentsComments,
|
|
9
|
+
} from "./modules-comments.js";
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
USE_SERVER_LOGICS,
|
|
13
|
+
USE_CLIENT_LOGICS,
|
|
14
|
+
USE_AGNOSTIC_LOGICS,
|
|
15
|
+
USE_SERVER_COMPONENTS,
|
|
16
|
+
USE_CLIENT_COMPONENTS,
|
|
17
|
+
USE_AGNOSTIC_COMPONENTS,
|
|
18
|
+
USE_SERVER_FUNCTIONS,
|
|
19
|
+
} from "../../../library/_commons/constants/bases.js";
|
|
20
|
+
|
|
21
|
+
export const agnostic20Comments = Object.freeze({
|
|
22
|
+
[USE_SERVER_LOGICS]: serverLogicsComments,
|
|
23
|
+
[USE_SERVER_COMPONENTS]: serverComponentsComments,
|
|
24
|
+
[USE_SERVER_FUNCTIONS]: serverFunctionsComments,
|
|
25
|
+
[USE_CLIENT_LOGICS]: clientLogicsComments,
|
|
26
|
+
[USE_CLIENT_COMPONENTS]: clientComponentsComments,
|
|
27
|
+
[USE_AGNOSTIC_LOGICS]: agnosticLogicsComments,
|
|
28
|
+
[USE_AGNOSTIC_COMPONENTS]: agnosticComponentsComments,
|
|
29
|
+
});
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import {
|
|
2
|
+
USE_SERVER_LOGICS,
|
|
3
|
+
USE_CLIENT_LOGICS,
|
|
4
|
+
USE_AGNOSTIC_LOGICS,
|
|
5
|
+
USE_SERVER_COMPONENTS,
|
|
6
|
+
USE_CLIENT_COMPONENTS,
|
|
7
|
+
USE_AGNOSTIC_COMPONENTS,
|
|
8
|
+
USE_SERVER_FUNCTIONS,
|
|
9
|
+
} from "../../../library/_commons/constants/bases.js";
|
|
10
|
+
|
|
11
|
+
export const serverLogicsComments = Object.freeze({
|
|
12
|
+
// $COMMENT#AGNOSTIC20#USE_SERVER_LOGICS#USE_SERVER_LOGICS
|
|
13
|
+
[USE_SERVER_LOGICS]:
|
|
14
|
+
/* valid */ "Server Logics can compose with one another.",
|
|
15
|
+
[USE_SERVER_COMPONENTS]:
|
|
16
|
+
/* valid */ "Server Components are OK to be composed with Server Logics as long as the Server Logics Module, by convention, does not export React components.",
|
|
17
|
+
[USE_SERVER_FUNCTIONS]:
|
|
18
|
+
/* valid */ "Server Functions, being able to import one another, can compose and do so via Server Logics, despite this method seeming superfluous at first glance. (Perhaps a preferrable use case for this has been found or could be found either today or in the future.)",
|
|
19
|
+
[USE_CLIENT_LOGICS]:
|
|
20
|
+
/* invalid */ "Client Logics should never leak to the server.",
|
|
21
|
+
[USE_CLIENT_COMPONENTS]:
|
|
22
|
+
/* invalid */ "Client Components cannot be tinkered with on the server.",
|
|
23
|
+
[USE_AGNOSTIC_LOGICS]:
|
|
24
|
+
/* valid */ "Agnostic Logics can run safely on the server just like they can on the client.",
|
|
25
|
+
[USE_AGNOSTIC_COMPONENTS]:
|
|
26
|
+
/* valid */ "Agnostic Components can be composed with Logics on the server just like they can on the client, as long at the Server Logics Module, by convention, does not export React components.",
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const serverComponentsComments = Object.freeze({
|
|
30
|
+
[USE_SERVER_LOGICS]:
|
|
31
|
+
/* valid */ "Server Logics, being logic from the server, can safely support Server Components.",
|
|
32
|
+
[USE_SERVER_COMPONENTS]:
|
|
33
|
+
/* valid */ "Server Components can compose with one another, assuming thanks to the inclusion of the 'use agnostic' directive that they are actual Server Components.",
|
|
34
|
+
[USE_SERVER_FUNCTIONS]:
|
|
35
|
+
/* valid */ "Server Functions can be passed to imported Client Components within Server Components Modules, even though indeed Server Components Modules and Server Components can make their own Server Functions through inline 'use server' directives.",
|
|
36
|
+
[USE_CLIENT_LOGICS]:
|
|
37
|
+
/* invalid */ "Client Logics should never leak to the server.",
|
|
38
|
+
[USE_CLIENT_COMPONENTS]:
|
|
39
|
+
/* valid */ "Client Components can be nested inside Server Components either to wrap some of the tree with client state accessible through child Client Components and pass through Server Components, or to create client boundaries when the root of the application is planted on the server.",
|
|
40
|
+
[USE_AGNOSTIC_LOGICS]:
|
|
41
|
+
/* valid */ "Agnostic Logics can run safely on the server just like they can on the client.",
|
|
42
|
+
[USE_AGNOSTIC_COMPONENTS]:
|
|
43
|
+
/* valid */ "Agnostic Components can render safely on the server just like they can on the client.",
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
export const serverFunctionsComments = Object.freeze({
|
|
47
|
+
[USE_SERVER_LOGICS]:
|
|
48
|
+
/* valid */ "Server Logics, being logic from the server, can safely support Server Functions.",
|
|
49
|
+
[USE_SERVER_COMPONENTS]:
|
|
50
|
+
/* invalid */ "Server Components aren't allowed because Server Functions have no business working with React Components.",
|
|
51
|
+
[USE_SERVER_FUNCTIONS]:
|
|
52
|
+
/* valid */ "Server Functions, even though they don't need to import one another and the same results can be generated via Server Logics for the outcome of a single Server Function, can still compose with one another. (Perhaps a preferrable use case for this has been found or could be found either today or in the future.)",
|
|
53
|
+
[USE_CLIENT_LOGICS]:
|
|
54
|
+
/* invalid */ "Client Logics should never leak to the server.",
|
|
55
|
+
[USE_CLIENT_COMPONENTS]:
|
|
56
|
+
/* invalid */ "Client Components aren't allowed because Server Functions have no business working with React Components.",
|
|
57
|
+
[USE_AGNOSTIC_LOGICS]:
|
|
58
|
+
/* valid */ "Agnostic Logics can run safely on the server just like they can on the client.",
|
|
59
|
+
[USE_AGNOSTIC_COMPONENTS]:
|
|
60
|
+
/* invalid */ "Agnostic Components aren't allowed because Server Functions have no business working with React Components.",
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
export const clientLogicsComments = Object.freeze({
|
|
64
|
+
[USE_SERVER_LOGICS]:
|
|
65
|
+
/* invalid */ "Server Logics should never leak to the client.",
|
|
66
|
+
[USE_SERVER_COMPONENTS]:
|
|
67
|
+
/* invalid */ "Server Components cannot be thinkered with on the client.",
|
|
68
|
+
[USE_SERVER_FUNCTIONS]:
|
|
69
|
+
/* valid */ "Server Functions can technically be attached to Client Components that are being tinkered with within Client Logics Modules.",
|
|
70
|
+
[USE_CLIENT_LOGICS]:
|
|
71
|
+
/* valid */ "Client Logics can compose with one another.",
|
|
72
|
+
[USE_CLIENT_COMPONENTS]:
|
|
73
|
+
/* valid */ "Client Components are OK to be composed with Client Logics as long as the Client Logics Module, by convention, does not export React components.",
|
|
74
|
+
[USE_AGNOSTIC_LOGICS]:
|
|
75
|
+
/* valid */ "Agnostic Logics can run safely on the client just like they can on the server.",
|
|
76
|
+
[USE_AGNOSTIC_COMPONENTS]:
|
|
77
|
+
/* valid */ "Agnostic Components can be composed with Logics on the client just like they can on the server, as long as the Client Logics Module, by convention, does not export React components.",
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
export const clientComponentsComments = Object.freeze({
|
|
81
|
+
[USE_SERVER_LOGICS]:
|
|
82
|
+
/* invalid */ "Server Logics should never leak to the client.",
|
|
83
|
+
[USE_SERVER_COMPONENTS]:
|
|
84
|
+
/* invalid */ "Server Components may only pass through Client Components via the children prop within Server Components Modules.",
|
|
85
|
+
[USE_SERVER_FUNCTIONS]:
|
|
86
|
+
/* valid */ "Server Functions are specifically triggered by Client Components.",
|
|
87
|
+
[USE_CLIENT_LOGICS]:
|
|
88
|
+
/* valid */ "Client Logics, being logic from the client, can safely support Client Components.",
|
|
89
|
+
[USE_CLIENT_COMPONENTS]:
|
|
90
|
+
/* valid */ "Client Components can compose with one another.",
|
|
91
|
+
[USE_AGNOSTIC_LOGICS]:
|
|
92
|
+
/* valid */ "Agnostic Logics can run safely on the client just like they can on the server.",
|
|
93
|
+
[USE_AGNOSTIC_COMPONENTS]:
|
|
94
|
+
/* valid */ "Agnostic Components can render safely on the client just like they can on the server.",
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
export const agnosticLogicsComments = Object.freeze({
|
|
98
|
+
[USE_SERVER_LOGICS]:
|
|
99
|
+
/* invalid */ "Server Logics cannot run on both the server and the client.",
|
|
100
|
+
[USE_SERVER_COMPONENTS]:
|
|
101
|
+
/* invalid */ "Server Components cannot be tinkered with on both the server and the client.",
|
|
102
|
+
[USE_SERVER_FUNCTIONS]:
|
|
103
|
+
/* invalid */ "Server Functions can be modified on the server and on the client, but their use cases on both environments are not one-to-one compatible, since they're being addressed as they are on the server and addressed as references on the client.",
|
|
104
|
+
[USE_CLIENT_LOGICS]:
|
|
105
|
+
/* invalid */ "Client Logics cannot run on both the server and the client.",
|
|
106
|
+
[USE_CLIENT_COMPONENTS]:
|
|
107
|
+
/* invalid */ "Client Components cannot be tinkered with on both the server and the client.",
|
|
108
|
+
[USE_AGNOSTIC_LOGICS]:
|
|
109
|
+
/* valid */ "Agnostic Logics can compose with one another.",
|
|
110
|
+
[USE_AGNOSTIC_COMPONENTS]:
|
|
111
|
+
/* valid */ "Agnostic Components can be composed with Logics agnostically as long as the Agnostic Logics Module, by convention, does not export React components.",
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
export const agnosticComponentsComments = Object.freeze({
|
|
115
|
+
[USE_SERVER_LOGICS]:
|
|
116
|
+
/* invalid */ "Server Logics cannot run on both the server and the client.",
|
|
117
|
+
[USE_SERVER_COMPONENTS]:
|
|
118
|
+
/* invalid */ "Server Components, unlike Client Components, cannot make silos of their own once on the opposing environment (the client in this case), and therefore cannot be executed from the client, making them unable to execute agnostically from both the server and the client.",
|
|
119
|
+
[USE_SERVER_FUNCTIONS]:
|
|
120
|
+
/* valid */ "Server Functions can be passed to Client Components as props when Client Components are also legally imported into Agnostic Components Modules.",
|
|
121
|
+
[USE_CLIENT_LOGICS]:
|
|
122
|
+
/* invalid */ "Client Logics cannot run on both the server and the client.",
|
|
123
|
+
[USE_CLIENT_COMPONENTS]:
|
|
124
|
+
/* valid */ "Client Components can be nested inside Agnostic Components either to wrap some of the tree with client state accessible through child Client Components and pass through Server Components (if still on the Server Tree), or to create client boundaries when the root of the application is planted on the server.",
|
|
125
|
+
[USE_AGNOSTIC_LOGICS]:
|
|
126
|
+
/* valid */ "Agnostic Logics, being environment-agnostic logic, can safely support Agnostic Components.",
|
|
127
|
+
[USE_AGNOSTIC_COMPONENTS]:
|
|
128
|
+
/* valid */ "Agnostic Components can compose with one another.",
|
|
129
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import {
|
|
2
|
+
serverLogicsComments,
|
|
3
|
+
clientLogicsComments,
|
|
4
|
+
agnosticLogicsComments,
|
|
5
|
+
serverComponentsComments,
|
|
6
|
+
clientComponentsComments,
|
|
7
|
+
agnosticComponentsComments,
|
|
8
|
+
serverFunctionsComments,
|
|
9
|
+
clientContextsComments,
|
|
10
|
+
agnosticConditionsComments,
|
|
11
|
+
} from "./modules-comments.js";
|
|
12
|
+
|
|
13
|
+
import {
|
|
14
|
+
USE_SERVER_LOGICS,
|
|
15
|
+
USE_CLIENT_LOGICS,
|
|
16
|
+
USE_AGNOSTIC_LOGICS,
|
|
17
|
+
USE_SERVER_COMPONENTS,
|
|
18
|
+
USE_CLIENT_COMPONENTS,
|
|
19
|
+
USE_AGNOSTIC_COMPONENTS,
|
|
20
|
+
USE_SERVER_FUNCTIONS,
|
|
21
|
+
USE_CLIENT_CONTEXTS,
|
|
22
|
+
USE_AGNOSTIC_CONDITIONS,
|
|
23
|
+
USE_AGNOSTIC_STRATEGIES,
|
|
24
|
+
} from "../../../library/_commons/constants/bases.js";
|
|
25
|
+
|
|
26
|
+
export const directive21Comments = Object.freeze({
|
|
27
|
+
[USE_SERVER_LOGICS]: serverLogicsComments,
|
|
28
|
+
[USE_CLIENT_LOGICS]: clientLogicsComments,
|
|
29
|
+
[USE_AGNOSTIC_LOGICS]: agnosticLogicsComments,
|
|
30
|
+
[USE_SERVER_COMPONENTS]: serverComponentsComments,
|
|
31
|
+
[USE_CLIENT_COMPONENTS]: clientComponentsComments,
|
|
32
|
+
[USE_AGNOSTIC_COMPONENTS]: agnosticComponentsComments,
|
|
33
|
+
[USE_SERVER_FUNCTIONS]: serverFunctionsComments,
|
|
34
|
+
[USE_CLIENT_CONTEXTS]: clientContextsComments,
|
|
35
|
+
[USE_AGNOSTIC_CONDITIONS]: agnosticConditionsComments,
|
|
36
|
+
[USE_AGNOSTIC_STRATEGIES]:
|
|
37
|
+
/* valid */ "(Special) Agnostic Strategies Modules can import all known modules, except themselves since they cannot be imported as they are, only as and via Strategies. (Since Agnostic Strategies Modules cannot be imported as they are, there is no such things as a 'use agnostic strategies' importFileCommentedDirective.)",
|
|
38
|
+
});
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import {
|
|
2
|
+
USE_SERVER_LOGICS,
|
|
3
|
+
USE_CLIENT_LOGICS,
|
|
4
|
+
USE_AGNOSTIC_LOGICS,
|
|
5
|
+
USE_SERVER_COMPONENTS,
|
|
6
|
+
USE_CLIENT_COMPONENTS,
|
|
7
|
+
USE_AGNOSTIC_COMPONENTS,
|
|
8
|
+
USE_SERVER_FUNCTIONS,
|
|
9
|
+
USE_CLIENT_CONTEXTS,
|
|
10
|
+
USE_AGNOSTIC_CONDITIONS,
|
|
11
|
+
} from "../../../library/_commons/constants/bases.js";
|
|
12
|
+
|
|
13
|
+
export const serverLogicsComments = Object.freeze({
|
|
14
|
+
// $COMMENT#DIRECTIVE21#USE_SERVER_LOGICS#USE_SERVER_LOGICS
|
|
15
|
+
[USE_SERVER_LOGICS]:
|
|
16
|
+
/* valid */ "Prime Server Logics can compose with one another.",
|
|
17
|
+
[USE_CLIENT_LOGICS]:
|
|
18
|
+
/* invalid */ "Prime Client Logics should never leak to the server.",
|
|
19
|
+
[USE_AGNOSTIC_LOGICS]:
|
|
20
|
+
/* valid */ "Prime Agnostic Logics can run safely on the server just like they can on the client.",
|
|
21
|
+
[USE_SERVER_COMPONENTS]:
|
|
22
|
+
/* valid */ "Lineal Server Components are OK to be composed with Prime Server Logics as long as the Prime Server Logics Module, by convention, does not export React components.",
|
|
23
|
+
[USE_CLIENT_COMPONENTS]:
|
|
24
|
+
/* invalid */ "Lineal Client Components, like any Client Components, cannot be tinkered with on the server.",
|
|
25
|
+
[USE_AGNOSTIC_COMPONENTS]:
|
|
26
|
+
/* valid */ "Lineal Agnostic Components can be composed with any Prime Environment Logics agnostically as long as the Prime Environment Logics Module, by convention, does not export React components.",
|
|
27
|
+
[USE_SERVER_FUNCTIONS]:
|
|
28
|
+
/* valid */ "(Special) Server Functions, being able to import one another, can compose and do so via Prime Server Logics, despite this method seeming superfluous at first glance. (Perhaps a preferrable use case for this has been found or could be found either today or in the future.)",
|
|
29
|
+
[USE_CLIENT_CONTEXTS]:
|
|
30
|
+
/* invalid */ "Client Contexts Components, like any Client Components, cannot be tinkered with on the server.",
|
|
31
|
+
[USE_AGNOSTIC_CONDITIONS]:
|
|
32
|
+
/* valid */ "(Special) Agnostic Conditions Components are able to safely render on the server, guaranteeing that only their `ComponentForServer` will be effectively involved in Prime Server Logics Modules.",
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
export const clientLogicsComments = Object.freeze({
|
|
36
|
+
[USE_SERVER_LOGICS]:
|
|
37
|
+
/* invalid */ "Prime Server Logics should never leak to the client.",
|
|
38
|
+
[USE_CLIENT_LOGICS]:
|
|
39
|
+
/* valid */ "Prime Client Logics can compose with one another.",
|
|
40
|
+
[USE_AGNOSTIC_LOGICS]:
|
|
41
|
+
/* valid */ "Prime Agnostic Logics can run safely on the client just like they can on the server.",
|
|
42
|
+
[USE_SERVER_COMPONENTS]:
|
|
43
|
+
/* invalid */ "Lineal Server Components cannot be thinkered with on the client.",
|
|
44
|
+
[USE_CLIENT_COMPONENTS]:
|
|
45
|
+
/* valid */ "Lineal Client Components, like any Client Components, are OK to be composed with Prime Client Logics as long as the Prime Client Logics Module, by convention, does not export React components.",
|
|
46
|
+
[USE_AGNOSTIC_COMPONENTS]:
|
|
47
|
+
/* valid */ "Lineal Agnostic Components can be composed with any Prime Environment Logics agnostically as long as the Prime Environment Logics Module, by convention, does not export React components.",
|
|
48
|
+
[USE_SERVER_FUNCTIONS]:
|
|
49
|
+
/* valid */ "(Special) Server Functions can technically be attached to Client Components that are being tinkered with within Client Logics Modules.",
|
|
50
|
+
[USE_CLIENT_CONTEXTS]:
|
|
51
|
+
/* valid */ "(Special) Client Contexts Components, like any Client Components, are OK to be composed with Prime Client Logics as long as the Prime Client Logics Module, by convention, does not export React components.",
|
|
52
|
+
[USE_AGNOSTIC_CONDITIONS]:
|
|
53
|
+
/* valid */ "(Special) Agnostic Conditions Components are able to safely render on the client, guaranteeing that only their `ComponentForClient` will be effectively involved in Prime Client Logics Modules.",
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
export const agnosticLogicsComments = Object.freeze({
|
|
57
|
+
[USE_SERVER_LOGICS]:
|
|
58
|
+
/* invalid */ "Prime Server Logics cannot run on both the server and the client.",
|
|
59
|
+
[USE_CLIENT_LOGICS]:
|
|
60
|
+
/* invalid */ "Prime Client Logics cannot run on both the server and the client.",
|
|
61
|
+
[USE_AGNOSTIC_LOGICS]:
|
|
62
|
+
/* valid */ "Prime Agnostic Logics can compose with one another.",
|
|
63
|
+
[USE_SERVER_COMPONENTS]:
|
|
64
|
+
/* invalid */ "Lineal Server Components cannot be tinkered with on both the server and the client.",
|
|
65
|
+
[USE_CLIENT_COMPONENTS]:
|
|
66
|
+
/* invalid */ "Lineal Client Components, like any Client Components, cannot be tinkered with on both the server and the client.",
|
|
67
|
+
[USE_AGNOSTIC_COMPONENTS]:
|
|
68
|
+
/* valid */ "Lineal Agnostic Components can be composed with any Prime Environment Logics agnostically as long as the Prime Environment Logics Module, by convention, does not export React components.",
|
|
69
|
+
[USE_SERVER_FUNCTIONS]:
|
|
70
|
+
/* invalid */ "(Special) Server Functions can be modified on the server and on the client, but their use cases on both environments are not one-to-one compatible, since they're being addressed as they are on the server and addressed as references on the client.",
|
|
71
|
+
[USE_CLIENT_CONTEXTS]:
|
|
72
|
+
/* invalid */ "(Special) Client Contexts Components, like any Client Components, cannot be tinkered with on both the server and the client.",
|
|
73
|
+
[USE_AGNOSTIC_CONDITIONS]:
|
|
74
|
+
/* valid */ "(Special) Agnostic Conditions Components, as if they were Lineal Agnostic Components themselves, can be composed with any Prime Environment Logics agnostically as long as the Prime Environment Logics Module, by convention, does not export React components.",
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export const serverComponentsComments = Object.freeze({
|
|
78
|
+
[USE_SERVER_LOGICS]:
|
|
79
|
+
/* valid */ "Prime Server Logics, being logic from the server, can safely support Lineal Server Components.",
|
|
80
|
+
[USE_CLIENT_LOGICS]:
|
|
81
|
+
/* invalid */ "Prime Client Logics should never leak to the server.",
|
|
82
|
+
[USE_AGNOSTIC_LOGICS]:
|
|
83
|
+
/* valid */ "Prime Agnostic Logics can run safely on the server just like they can on the client.",
|
|
84
|
+
[USE_SERVER_COMPONENTS]:
|
|
85
|
+
/* valid */ "Lineal Server Components can compose with one another, now that thanks to the inclusion of Agnostic Components they are actual Server Components.",
|
|
86
|
+
[USE_CLIENT_COMPONENTS]:
|
|
87
|
+
/* valid */ "Lineal Client Components can be nested inside Server Components to create client boundaries when the root of the application is planted on the server.",
|
|
88
|
+
[USE_AGNOSTIC_COMPONENTS]:
|
|
89
|
+
/* valid */ "Lineal Agnostic Components can render safely on the server just like they can on the client.",
|
|
90
|
+
[USE_SERVER_FUNCTIONS]:
|
|
91
|
+
/* valid */ "(Special) Server Functions can be passed to imported Client Components within Lineal Server Components Modules, even though indeed Lineal Server Components Modules and Lineal Server Components can make their own Server Functions through inline 'use server' directives.",
|
|
92
|
+
[USE_CLIENT_CONTEXTS]:
|
|
93
|
+
/* valid */ "(Special) Client Contexts Components can be nested inside Server Components to wrap some of the tree with client state accessible through child Client Components, and to pass through Server Components when the root of the application is planted on the server.",
|
|
94
|
+
[USE_AGNOSTIC_CONDITIONS]:
|
|
95
|
+
/* valid */ "(Special) Agnostic Conditions Components, as if they were Lineal Agnostic Components themselves, can render safely on the server just like they can on the client.",
|
|
96
|
+
});
|
|
97
|
+
|
|
98
|
+
export const clientComponentsComments = Object.freeze({
|
|
99
|
+
[USE_SERVER_LOGICS]:
|
|
100
|
+
/* invalid */ "Prime Server Logics should never leak to the client.",
|
|
101
|
+
[USE_CLIENT_LOGICS]:
|
|
102
|
+
/* valid */ "Prime Client Logics, being logic from the client, can safely support Lineal Client Components, like any Client Components.",
|
|
103
|
+
[USE_AGNOSTIC_LOGICS]:
|
|
104
|
+
/* valid */ "Prime Agnostic Logics can run safely on the client just like they can on the server.",
|
|
105
|
+
[USE_SERVER_COMPONENTS]:
|
|
106
|
+
/* invalid */ "Lineal Server Components cannot be the children of Lineal Client Components.",
|
|
107
|
+
[USE_CLIENT_COMPONENTS]:
|
|
108
|
+
/* valid */ "Lineal Client Components can compose with one another.",
|
|
109
|
+
[USE_AGNOSTIC_COMPONENTS]:
|
|
110
|
+
/* valid */ "Lineal Agnostic Components can render safely on the client just like they can on the server.",
|
|
111
|
+
[USE_SERVER_FUNCTIONS]:
|
|
112
|
+
/* valid */ "(Special) Server Functions are specifically triggered by Client Components.",
|
|
113
|
+
[USE_CLIENT_CONTEXTS]:
|
|
114
|
+
/* valid */ "(Special) Client Contexts Components can effectively become Lineal and only render their children on the client via this mechanism since, by a Client Contexts Component being the child of a Lineal Client Component, the Client Contexts Component's children become the grand-children of an ancestor Lineal Client Component, enforcing them to render exclusively on the client.",
|
|
115
|
+
[USE_AGNOSTIC_CONDITIONS]:
|
|
116
|
+
/* valid */ "(Special) Agnostic Conditions Components, as if they were Lineal Agnostic Components themselves, can render safely on the client just like they can on the server.",
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
export const agnosticComponentsComments = Object.freeze({
|
|
120
|
+
[USE_SERVER_LOGICS]:
|
|
121
|
+
/* invalid */ "Prime Server Logics cannot run on both the server and the client.",
|
|
122
|
+
[USE_CLIENT_LOGICS]:
|
|
123
|
+
/* invalid */ "Prime Client Logics cannot run on both the server and the client.",
|
|
124
|
+
[USE_AGNOSTIC_LOGICS]:
|
|
125
|
+
/* valid */ "Prime Agnostic Logics, being environment-agnostic logic, can safely support Agnostic Components.",
|
|
126
|
+
[USE_SERVER_COMPONENTS]:
|
|
127
|
+
/* invalid */ "Lineal Server Components, unlike Lineal Client Components, cannot make silos of their own once on the opposing environment (the client in this case), and therefore cannot be executed from the client, making them unable to execute agnostically from both the server and the client.",
|
|
128
|
+
[USE_CLIENT_COMPONENTS]:
|
|
129
|
+
/* valid */ "Lineal Client Components can be nested inside Agnostic Components to create client boundaries when the root of the application is planted on the server.",
|
|
130
|
+
[USE_AGNOSTIC_COMPONENTS]:
|
|
131
|
+
/* valid */ "Lineal Agnostic Components, can compose with one another.",
|
|
132
|
+
[USE_SERVER_FUNCTIONS]:
|
|
133
|
+
/* valid */ "(Special) Server Functions can be passed to Client Components as props when Client Components are also legally imported into Agnostic Components Modules.",
|
|
134
|
+
[USE_CLIENT_CONTEXTS]:
|
|
135
|
+
/* valid */ "(Special) Client Contexts Components can be nested inside Agnostic Components to wrap some of the tree with client state accessible through child Client Components, and to pass through Server Components (if still on the Server Tree) when the root of the application is planted on the server.",
|
|
136
|
+
[USE_AGNOSTIC_CONDITIONS]:
|
|
137
|
+
/* valid */ "(Special) Agnostic Conditions Components can compose with Lineal Agnostic Components as if they were Lineal Agnostic Components themselves, making them a necessary mechanism for Server Components to be nested in Agnostic Components.",
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
export const serverFunctionsComments = Object.freeze({
|
|
141
|
+
[USE_SERVER_LOGICS]:
|
|
142
|
+
/* valid */ "Prime Server Logics, being logic from the server, can safely support (Special) Server Functions.",
|
|
143
|
+
[USE_CLIENT_LOGICS]:
|
|
144
|
+
/* invalid */ "Prime Client Logics should never leak to the server.",
|
|
145
|
+
[USE_AGNOSTIC_LOGICS]:
|
|
146
|
+
/* valid */ "Prime Agnostic Logics can run safely on the server just like they can on the client.",
|
|
147
|
+
[USE_SERVER_COMPONENTS]:
|
|
148
|
+
/* invalid */ "Lineal Server Components aren't allowed because (Special) Server Functions have no business working with React Components.",
|
|
149
|
+
[USE_CLIENT_COMPONENTS]:
|
|
150
|
+
/* invalid */ "Lineal Client Components aren't allowed because (Special) Server Functions have no business working with React Components.",
|
|
151
|
+
[USE_AGNOSTIC_COMPONENTS]:
|
|
152
|
+
/* invalid */ "Lineal Agnostic Components aren't allowed because (Special) Server Functions have no business working with React Components.",
|
|
153
|
+
[USE_SERVER_FUNCTIONS]:
|
|
154
|
+
/* valid */ "(Special) Server Functions, even though they don't need to import one another and the same results can be generated via Prime Server Logics for the outcome of a single Server Function, can still compose with one another. (Perhaps a preferrable use case for this has been found or could be found either today or in the future.)",
|
|
155
|
+
[USE_CLIENT_CONTEXTS]:
|
|
156
|
+
/* invalid */ "(Special) Client Contexts Components aren't allowed because (Special) Server Functions have no business working with React Components.",
|
|
157
|
+
[USE_AGNOSTIC_CONDITIONS]:
|
|
158
|
+
/* invalid */ "(Special) Agnostic Conditions Components aren't allowed because (Special) Server Functions have no business working with React Components.",
|
|
159
|
+
});
|
|
160
|
+
|
|
161
|
+
export const clientContextsComments = Object.freeze({
|
|
162
|
+
[USE_SERVER_LOGICS]:
|
|
163
|
+
/* invalid */ "Prime Server Logics should never leak to the client.",
|
|
164
|
+
[USE_CLIENT_LOGICS]:
|
|
165
|
+
/* valid */ "Prime Client Logics, being logic from the client, can safely support (Special) Client Contexts Components, like any Client Components.",
|
|
166
|
+
[USE_AGNOSTIC_LOGICS]:
|
|
167
|
+
/* valid */ "Prime Agnostic Logics can run safely on the client just like they can on the server.",
|
|
168
|
+
[USE_SERVER_COMPONENTS]:
|
|
169
|
+
/* invalid */ "Lineal Server Components may only pass through (Special) Client Contexts Components via the children prop within Server Components Modules.",
|
|
170
|
+
[USE_CLIENT_COMPONENTS]:
|
|
171
|
+
/* valid */ "Lineal Client Components can create client boundaries within (Special) Client Contexts Components.",
|
|
172
|
+
[USE_AGNOSTIC_COMPONENTS]:
|
|
173
|
+
/* valid */ "Lineal Agnostic Components can render safely on the client just like they can on the server.",
|
|
174
|
+
[USE_SERVER_FUNCTIONS]:
|
|
175
|
+
/* valid */ "(Special) Server Functions are specifically triggered by Client Components.",
|
|
176
|
+
[USE_CLIENT_CONTEXTS]:
|
|
177
|
+
/* valid */ "(Special) Client Contexts Components can compose with one another.",
|
|
178
|
+
[USE_AGNOSTIC_CONDITIONS]:
|
|
179
|
+
/* valid */ "(Special) Agnostic Conditions Components, as if they were Lineal Agnostic Components themselves, can render safely on the client just like they can on the server, in a mechanism that allows (Special) Client Contexts Components to safely and indirectly compose with child Server Components within Client Contexts Modules.",
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
export const agnosticConditionsComments = Object.freeze({
|
|
183
|
+
[USE_SERVER_LOGICS]:
|
|
184
|
+
/* invalid */ "Prime Server Logics cannot run on both the server and the client.",
|
|
185
|
+
[USE_CLIENT_LOGICS]:
|
|
186
|
+
/* invalid */ "Prime Client Logics cannot run on both the server and the client.",
|
|
187
|
+
[USE_AGNOSTIC_LOGICS]:
|
|
188
|
+
/* valid */ "Prime Agnostic Logics, being environment-agnostic logic, can safely support Agnostic Components, including (Special) Agnostic Conditions Components. (In this case this is necessary for the import of the `conditionAgnosticComponent` function needed to make Agnostic Conditions Components.)",
|
|
189
|
+
[USE_SERVER_COMPONENTS]:
|
|
190
|
+
/* valid */ "Lineal Server Components are to be paired as `ComponentForServer` components with `ComponentForClient` components to form (Special) Agnostic Conditions Components.",
|
|
191
|
+
[USE_CLIENT_COMPONENTS]:
|
|
192
|
+
/* valid */ "Lineal Client Components are to be paired as `ComponentForClient` components with `ComponentForServer` components to form (Special) Agnostic Conditions Components.",
|
|
193
|
+
[USE_AGNOSTIC_COMPONENTS]:
|
|
194
|
+
/* valid */ "Lineal Agnostic Components can take the place of `ComponentForServer` and/or `ComponentForClient` components to form (Special) Agnostic Conditions Components.",
|
|
195
|
+
[USE_SERVER_FUNCTIONS]:
|
|
196
|
+
/* invalid */ "(Special) Server Functions are not accepted because (Special) Agnostic Conditions Components only take finite, imported components as arguments in their making. As such, assigning props to these components, including Server Functions, is not made within Agnostic Conditions Modules.",
|
|
197
|
+
[USE_CLIENT_CONTEXTS]:
|
|
198
|
+
/* invalid */ "(Special) Client Contexts Components cannot be used as component arguments for (Special) Agnostic Conditions Components since they only take Lineal Components as arguments in their making.",
|
|
199
|
+
[USE_AGNOSTIC_CONDITIONS]:
|
|
200
|
+
/* valid */ "(Special) Agnostic Conditions Components, despite not being Lineal Components themselves, output components that can only be Lineal and compatible with their attributed rendering environments, making them acceptable arguments in the making of Agnostic Conditions Components.",
|
|
201
|
+
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "eslint-plugin-use-agnostic",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5",
|
|
4
4
|
"description": "Highlights problematic server-client imports in projects made with the Fullstack React Architecture.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"author": "Luther Tchofo Safo <luther@tchofo-safo-portfolio.me>",
|
|
22
22
|
"files": [
|
|
23
23
|
"library",
|
|
24
|
-
"types/index.d.ts"
|
|
24
|
+
"types/index.d.ts",
|
|
25
|
+
"jscomments"
|
|
25
26
|
],
|
|
26
27
|
"exports": {
|
|
27
28
|
".": {
|