@ddd-ts-kit/eslint-plugin 0.114.1 → 0.115.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.fr.md +5 -3
- package/README.md +3 -2
- package/dist/rules/domain-events-dispatched-on-save.d.ts.map +1 -1
- package/dist/rules/domain-events-dispatched-on-save.js +3 -4
- package/dist/rules/domain-events-dispatched-on-save.js.map +1 -1
- package/dist/rules/purity.d.ts.map +1 -1
- package/dist/rules/purity.js +5 -64
- package/dist/rules/purity.js.map +1 -1
- package/dist/support/globals/ambient-name.d.ts.map +1 -1
- package/dist/support/globals/ambient-name.js +3 -2
- package/dist/support/globals/ambient-name.js.map +1 -1
- package/dist/support/purity/purity-rule.d.ts +4 -0
- package/dist/support/purity/purity-rule.d.ts.map +1 -0
- package/dist/support/{purity-rule.js → purity/purity-rule.js} +28 -42
- package/dist/support/purity/purity-rule.js.map +1 -0
- package/dist/support/purity/reference/forbidden-call.d.ts +4 -0
- package/dist/support/purity/reference/forbidden-call.d.ts.map +1 -0
- package/dist/support/purity/reference/forbidden-call.js +5 -0
- package/dist/support/purity/reference/forbidden-call.js.map +1 -0
- package/dist/support/purity/reference/forbidden-construction.d.ts +4 -0
- package/dist/support/purity/reference/forbidden-construction.d.ts.map +1 -0
- package/dist/support/purity/reference/forbidden-construction.js +8 -0
- package/dist/support/purity/reference/forbidden-construction.js.map +1 -0
- package/dist/support/purity/reference/forbidden-member.d.ts +4 -0
- package/dist/support/purity/reference/forbidden-member.d.ts.map +1 -0
- package/dist/support/purity/reference/forbidden-member.js +9 -0
- package/dist/support/purity/reference/forbidden-member.js.map +1 -0
- package/dist/support/purity/reference/forbidden-named-import.d.ts +4 -0
- package/dist/support/purity/reference/forbidden-named-import.d.ts.map +1 -0
- package/dist/support/purity/reference/forbidden-named-import.js +7 -0
- package/dist/support/purity/reference/forbidden-named-import.js.map +1 -0
- package/dist/support/purity/reference/global-objects.d.ts +3 -0
- package/dist/support/purity/reference/global-objects.d.ts.map +1 -0
- package/dist/support/purity/reference/global-objects.js +3 -0
- package/dist/support/purity/reference/global-objects.js.map +1 -0
- package/dist/support/{purity-rule.d.ts → purity/reference/purity-table.d.ts} +8 -6
- package/dist/support/purity/reference/purity-table.d.ts.map +1 -0
- package/dist/support/purity/reference/purity-table.js +2 -0
- package/dist/support/purity/reference/purity-table.js.map +1 -0
- package/dist/support/purity/reference/purity-tables.d.ts +48 -0
- package/dist/support/purity/reference/purity-tables.d.ts.map +1 -0
- package/dist/support/purity/reference/purity-tables.js +68 -0
- package/dist/support/purity/reference/purity-tables.js.map +1 -0
- package/dist/support/suppressions/suppressed-lines.d.ts +5 -1
- package/dist/support/suppressions/suppressed-lines.d.ts.map +1 -1
- package/dist/support/suppressions/suppressed-lines.js +30 -11
- package/dist/support/suppressions/suppressed-lines.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/rules/domain-events-dispatched-on-save.fr.md +6 -6
- package/docs/rules/domain-events-dispatched-on-save.md +5 -5
- package/docs/rules/purity-no-ambient-randomness.fr.md +2 -2
- package/docs/rules/purity-no-ambient-randomness.md +1 -1
- package/docs/rules/purity-no-environment.fr.md +2 -2
- package/docs/rules/purity-no-environment.md +1 -1
- package/docs/rules/purity-no-system-clock.fr.md +2 -2
- package/docs/rules/purity-no-system-clock.md +1 -1
- package/package.json +3 -3
- package/dist/support/purity-rule.d.ts.map +0 -1
- package/dist/support/purity-rule.js.map +0 -1
package/README.fr.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[English](README.md) · **Français**
|
|
2
|
-
<!-- translation-of: README.md sha256:
|
|
2
|
+
<!-- translation-of: README.md sha256:cc618b2821586c57 -->
|
|
3
3
|
|
|
4
4
|
# @ddd-ts-kit/eslint-plugin
|
|
5
5
|
|
|
@@ -243,7 +243,7 @@ chaque règle à `error`.
|
|
|
243
243
|
| [`presentation/guard-at-the-edge`](docs/rules/presentation-guard-at-the-edge.fr.md) | `ddd-ts-kit/presentation-guard-at-the-edge` | un `*.guard.ts` n'importe rien de `domain/` ni de `infrastructure/`, aucun *repository*, aucune unité de travail, aucun bus de commandes | `error` | maison |
|
|
244
244
|
| [`presentation/shared-cache-varies`](docs/rules/presentation-shared-cache-varies.fr.md) | `ddd-ts-kit/presentation-shared-cache-varies` | une politique de cache `public` d'une route, d'un contrôleur ou d'un groupe de routes qui connaît son appelant nomme dans `vary` ce dont sa réponse dépend | `error` | maison |
|
|
245
245
|
| [`application/command-query-separation`](docs/rules/application-command-query-separation.fr.md) | `ddd-ts-kit/application-command-query-separation` | rien sous `application/queries` n'appelle `save`, `delete`, `publish` sur une dépendance | `warn` | maison |
|
|
246
|
-
| [`domain-events/dispatched-on-save`](docs/rules/domain-events-dispatched-on-save.fr.md) | `ddd-ts-kit/domain-events-dispatched-on-save` | pas de `
|
|
246
|
+
| [`domain-events/dispatched-on-save`](docs/rules/domain-events-dispatched-on-save.fr.md) | `ddd-ts-kit/domain-events-dispatched-on-save` | pas de `takeRecordedEvents()` dans `application/` et `infrastructure/` ; aucun `DomainEventDispatcher` importé, listé comme dépendance ou reçu par un constructeur dans `application/commands`, `application/queries` et un adaptateur de *repository* | `error` | maison |
|
|
247
247
|
| [`domain-events/transactional-before-commit`](docs/rules/domain-events-transactional-before-commit.fr.md) | `ddd-ts-kit/domain-events-transactional-before-commit` | une classe portant `@DomainEventHandler` sans `phase: 'after-commit'` ne dépend d'aucun `Cache`, `Lock`, `RateLimiter`, `JobScheduler` ou `EventBus` du kernel ni de rien d'importé de `infrastructure/`, d'un autre contexte, de la plateforme ou d'un *package* autre que `@ddd-ts-kit/kernel` et `@ddd-ts-kit/auth` ; un gestionnaire after-commit ne dépend pas d'`IntegrationEventPublisher`. Les adaptateurs d'un port de `application/ports/` et la phase d'un gestionnaire du style explicite sont tenus par le *checker* de la CLI | `error` | maison |
|
|
248
248
|
| [`event-sourcing/state-in-apply`](docs/rules/event-sourcing-state-in-apply.fr.md) | `ddd-ts-kit/event-sourcing-state-in-apply` | un agrégat en *event sourcing* ne change son état que dans ses méthodes d'application (`apply<Fact>`, `restore`), et une méthode d'application n'enregistre aucun événement | `error` | maison |
|
|
249
249
|
| [`event-sourcing/past-tense`](docs/rules/event-sourcing-past-tense.fr.md) | `ddd-ts-kit/event-sourcing-past-tense` | les événements qu'un agrégat en *event sourcing* importe de `domain/events/` sont nommés au passé | `error` | maison |
|
|
@@ -398,7 +398,9 @@ ESLint de l'éditeur après avoir modifié `ddd-ts-kit.config.json`.
|
|
|
398
398
|
|
|
399
399
|
Deux choses fonctionnent comme avec le *checker* de la CLI : `rules.<id>: "off"` dans la config
|
|
400
400
|
fait taire la règle même quand la config ESLint l'active, et
|
|
401
|
-
`// ddd-ts-kit-disable-next-line <id> -- <reason>` fait taire une ligne pour les deux outils.
|
|
401
|
+
`// ddd-ts-kit-disable-next-line <id> -- <reason>` fait taire une ligne pour les deux outils. Elle
|
|
402
|
+
nomme plusieurs règles séparées par des virgules (`<id>, <id> -- <reason>`), et des directives
|
|
403
|
+
l'une au-dessus de l'autre couvrent toutes la ligne qui suit la dernière. Une
|
|
402
404
|
désactivation sans raison ne fait rien taire, et `governance/recorded-deviation` demande que la
|
|
403
405
|
raison renvoie à un enregistrement de décision (`ADR-<number>`) :
|
|
404
406
|
|
package/README.md
CHANGED
|
@@ -239,7 +239,7 @@ is an error whatever the configured limit). `strict` sets every rule to `error`.
|
|
|
239
239
|
| [`presentation/guard-at-the-edge`](docs/rules/presentation-guard-at-the-edge.md) | `ddd-ts-kit/presentation-guard-at-the-edge` | a `*.guard.ts` imports nothing from `domain/` or `infrastructure/`, no repository, no unit of work, no command bus | `error` | custom |
|
|
240
240
|
| [`presentation/shared-cache-varies`](docs/rules/presentation-shared-cache-varies.md) | `ddd-ts-kit/presentation-shared-cache-varies` | a `public` cache policy of a route, a controller or a route group that knows its caller names in `vary` what its answer depends on | `error` | custom |
|
|
241
241
|
| [`application/command-query-separation`](docs/rules/application-command-query-separation.md) | `ddd-ts-kit/application-command-query-separation` | nothing under `application/queries` calls `save`, `delete`, `publish` on a dependency | `warn` | custom |
|
|
242
|
-
| [`domain-events/dispatched-on-save`](docs/rules/domain-events-dispatched-on-save.md) | `ddd-ts-kit/domain-events-dispatched-on-save` | no `
|
|
242
|
+
| [`domain-events/dispatched-on-save`](docs/rules/domain-events-dispatched-on-save.md) | `ddd-ts-kit/domain-events-dispatched-on-save` | no `takeRecordedEvents()` in `application/` and `infrastructure/`; no `DomainEventDispatcher` imported, listed as a dependency or received by a constructor in `application/commands`, `application/queries` and a repository adapter | `error` | custom |
|
|
243
243
|
| [`domain-events/transactional-before-commit`](docs/rules/domain-events-transactional-before-commit.md) | `ddd-ts-kit/domain-events-transactional-before-commit` | a class carrying `@DomainEventHandler` without `phase: 'after-commit'` depends on no `Cache`, `Lock`, `RateLimiter`, `JobScheduler` or `EventBus` of the kernel and on nothing imported from `infrastructure/`, another context, the platform or a package other than `@ddd-ts-kit/kernel` and `@ddd-ts-kit/auth`; an after-commit handler does not depend on `IntegrationEventPublisher`. The adapters of an `application/ports/` port and the phase of an explicit-style handler are held by the CLI checker | `error` | custom |
|
|
244
244
|
| [`event-sourcing/state-in-apply`](docs/rules/event-sourcing-state-in-apply.md) | `ddd-ts-kit/event-sourcing-state-in-apply` | an event-sourced aggregate changes its state only in its apply methods (`apply<Fact>`, `restore`), and an apply method records no event | `error` | custom |
|
|
245
245
|
| [`event-sourcing/past-tense`](docs/rules/event-sourcing-past-tense.md) | `ddd-ts-kit/event-sourcing-past-tense` | the events an event-sourced aggregate imports from `domain/events/` are named in the past tense | `error` | custom |
|
|
@@ -390,7 +390,8 @@ editor after changing `ddd-ts-kit.config.json`.
|
|
|
390
390
|
|
|
391
391
|
Two things work as with the CLI checker: `rules.<id>: "off"` in the config silences the rule
|
|
392
392
|
even when the ESLint config enables it, and `// ddd-ts-kit-disable-next-line <id> -- <reason>`
|
|
393
|
-
silences one line for both tools.
|
|
393
|
+
silences one line for both tools. It names several rules after commas (`<id>, <id> -- <reason>`),
|
|
394
|
+
and directives one above the other all cover the line after the last of them. A suppression without a reason silences nothing, and
|
|
394
395
|
`governance/recorded-deviation` asks that the reason point to a decision record (`ADR-<number>`):
|
|
395
396
|
|
|
396
397
|
```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-events-dispatched-on-save.d.ts","sourceRoot":"","sources":["../../src/rules/domain-events-dispatched-on-save.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAiB,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"domain-events-dispatched-on-save.d.ts","sourceRoot":"","sources":["../../src/rules/domain-events-dispatched-on-save.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAiB,MAAM,0BAA0B,CAAC;AAoBxF,eAAO,MAAM,4BAA4B,gGA2CvC,CAAC"}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
-
import { propertyName } from '../support/globals/property-name.js';
|
|
3
2
|
import { dependencyListListener } from '../support/ports/dependency-list-listener.js';
|
|
4
3
|
import { defineRule } from '../support/rule/define-rule.js';
|
|
5
4
|
import { parameterTypeName } from '../support/types/parameter-type-name.js';
|
|
6
5
|
const DISPATCHER = 'DomainEventDispatcher';
|
|
7
|
-
const PULL = '
|
|
6
|
+
const PULL = 'takeRecordedEvents';
|
|
8
7
|
const ON_SAVE = 'events leave with the save: `await repository.save(aggregate)` and nothing else; a removal that announces an event takes the aggregate.';
|
|
9
8
|
export const domainEventsDispatchedOnSave = defineRule({
|
|
10
9
|
id: 'domain-events/dispatched-on-save',
|
|
11
10
|
type: 'problem',
|
|
12
11
|
recommended: 'error',
|
|
13
|
-
description: 'Domain events leave with the save: no `
|
|
12
|
+
description: 'Domain events leave with the save: no `takeRecordedEvents()` in application/ or infrastructure/, no DomainEventDispatcher in a command, a query or a repository adapter.',
|
|
14
13
|
messages: {
|
|
15
14
|
pulled: `\`${PULL}()\` is called in {{place}}: ${ON_SAVE}`,
|
|
16
15
|
dispatcher: `${DISPATCHER} is {{how}} in {{place}}: ${ON_SAVE}`,
|
|
@@ -75,7 +74,7 @@ function judgedAs(file) {
|
|
|
75
74
|
};
|
|
76
75
|
}
|
|
77
76
|
function isPull(node) {
|
|
78
|
-
return node.callee.type === AST_NODE_TYPES.
|
|
77
|
+
return node.callee.type === AST_NODE_TYPES.Identifier && node.callee.name === PULL;
|
|
79
78
|
}
|
|
80
79
|
function importsDispatcher(specifier) {
|
|
81
80
|
if (specifier.type !== AST_NODE_TYPES.ImportSpecifier) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"domain-events-dispatched-on-save.js","sourceRoot":"","sources":["../../src/rules/domain-events-dispatched-on-save.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAgC,MAAM,0BAA0B,CAAC;AAExF,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"domain-events-dispatched-on-save.js","sourceRoot":"","sources":["../../src/rules/domain-events-dispatched-on-save.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAgC,MAAM,0BAA0B,CAAC;AAExF,OAAO,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,MAAM,UAAU,GAAG,uBAAuB,CAAC;AAC3C,MAAM,IAAI,GAAG,oBAAoB,CAAC;AAElC,MAAM,OAAO,GACX,yIAAyI,CAAC;AAU5I,MAAM,CAAC,MAAM,4BAA4B,GAAG,UAAU,CAA0B;IAC9E,EAAE,EAAE,kCAAkC;IACtC,IAAI,EAAE,SAAS;IACf,WAAW,EAAE,OAAO;IACpB,WAAW,EACT,0KAA0K;IAC5K,QAAQ,EAAE;QACR,MAAM,EAAE,KAAK,IAAI,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AAC,KAAK,KAAK,gBAAgB,EAAE,CAAC;QACxC,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO;QACL,KAAK,EAAE,kBAAkB,MAAM,EAAE;QACjC,iBAAiB,EAAE,MAAM,KAAK,aAAa,IAAI,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,gBAAgB,CAAC;KACpF,CAAC;AACJ,CAAC;AAED,SAAS,MAAM,CAAC,IAA6B;IAC3C,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,IAAI,CAAC;AACrF,CAAC;AAED,SAAS,iBAAiB,CAAC,SAAgC;IACzD,IAAI,SAAS,CAAC,IAAI,KAAK,cAAc,CAAC,eAAe,EAAE,CAAC;QACtD,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,EAAE,QAAQ,EAAE,GAAG,SAAS,CAAC;IAE/B,OAAO,CAAC,QAAQ,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,UAAU,CAAC;AACvG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purity.d.ts","sourceRoot":"","sources":["../../src/rules/purity.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"purity.d.ts","sourceRoot":"","sources":["../../src/rules/purity.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,oKAAsD,CAAC;AAEvF,eAAO,MAAM,yBAAyB,oKAA4D,CAAC;AAEnG,eAAO,MAAM,mBAAmB,oKAAqD,CAAC"}
|
package/dist/rules/purity.js
CHANGED
|
@@ -1,65 +1,6 @@
|
|
|
1
|
-
import { purityRule } from '../support/purity-rule.js';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
members: { Date: ['now'], performance: ['now', 'timeOrigin'] },
|
|
7
|
-
calls: ['Date'],
|
|
8
|
-
constructions: [],
|
|
9
|
-
bareConstructions: ['Date'],
|
|
10
|
-
modules: [],
|
|
11
|
-
namedImports: {},
|
|
12
|
-
});
|
|
13
|
-
export const purityNoAmbientRandomness = purityRule({
|
|
14
|
-
id: 'purity/no-ambient-randomness',
|
|
15
|
-
description: 'No Math.random, crypto.randomUUID or id library in domain/ or application/: identifiers come from the IdGenerator port.',
|
|
16
|
-
instead: 'Receive the identifier as a parameter in the domain, and take it from the IdGenerator port (`this.ids.next()`) in a handler, so that a test gets predictable identifiers.',
|
|
17
|
-
members: { Math: ['random'], crypto: ['randomUUID', 'getRandomValues', 'randomBytes', 'randomInt'] },
|
|
18
|
-
calls: ['randomUUID'],
|
|
19
|
-
constructions: [],
|
|
20
|
-
bareConstructions: [],
|
|
21
|
-
modules: [
|
|
22
|
-
'uuid',
|
|
23
|
-
'nanoid',
|
|
24
|
-
'ulid',
|
|
25
|
-
'ulidx',
|
|
26
|
-
'cuid',
|
|
27
|
-
'@paralleldrive/cuid2',
|
|
28
|
-
'ksuid',
|
|
29
|
-
'shortid',
|
|
30
|
-
'uuidv7',
|
|
31
|
-
'hyperid',
|
|
32
|
-
'bson',
|
|
33
|
-
],
|
|
34
|
-
namedImports: { crypto: ['randomUUID', 'getRandomValues', 'randomBytes', 'randomInt', 'webcrypto'] },
|
|
35
|
-
});
|
|
36
|
-
export const purityNoEnvironment = purityRule({
|
|
37
|
-
id: 'purity/no-environment',
|
|
38
|
-
description: 'No process.env, console, file system or network access in domain/ or application/.',
|
|
39
|
-
instead: 'Declare what is needed as a port in application/ports (a configuration value object, a logger, a gateway), implement it in infrastructure/ and bind it in the module file.',
|
|
40
|
-
members: { process: ['env', 'argv', 'cwd', 'exit', 'stdout', 'stderr', 'stdin'], console: [] },
|
|
41
|
-
calls: ['fetch'],
|
|
42
|
-
constructions: ['XMLHttpRequest', 'WebSocket', 'EventSource'],
|
|
43
|
-
bareConstructions: [],
|
|
44
|
-
modules: [
|
|
45
|
-
'fs',
|
|
46
|
-
'http',
|
|
47
|
-
'https',
|
|
48
|
-
'http2',
|
|
49
|
-
'net',
|
|
50
|
-
'dgram',
|
|
51
|
-
'dns',
|
|
52
|
-
'tls',
|
|
53
|
-
'child_process',
|
|
54
|
-
'worker_threads',
|
|
55
|
-
'os',
|
|
56
|
-
'readline',
|
|
57
|
-
'axios',
|
|
58
|
-
'node-fetch',
|
|
59
|
-
'undici',
|
|
60
|
-
'got',
|
|
61
|
-
'dotenv',
|
|
62
|
-
],
|
|
63
|
-
namedImports: {},
|
|
64
|
-
});
|
|
1
|
+
import { purityRule } from '../support/purity/purity-rule.js';
|
|
2
|
+
import { PURITY_TABLES } from '../support/purity/reference/purity-tables.js';
|
|
3
|
+
export const purityNoSystemClock = purityRule(PURITY_TABLES['purity/no-system-clock']);
|
|
4
|
+
export const purityNoAmbientRandomness = purityRule(PURITY_TABLES['purity/no-ambient-randomness']);
|
|
5
|
+
export const purityNoEnvironment = purityRule(PURITY_TABLES['purity/no-environment']);
|
|
65
6
|
//# sourceMappingURL=purity.js.map
|
package/dist/rules/purity.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"purity.js","sourceRoot":"","sources":["../../src/rules/purity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"purity.js","sourceRoot":"","sources":["../../src/rules/purity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE1E,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC,aAAa,CAAC,wBAAwB,CAAC,CAAC,CAAC;AAEvF,MAAM,CAAC,MAAM,yBAAyB,GAAG,UAAU,CAAC,aAAa,CAAC,8BAA8B,CAAC,CAAC,CAAC;AAEnG,MAAM,CAAC,MAAM,mBAAmB,GAAG,UAAU,CAAC,aAAa,CAAC,uBAAuB,CAAC,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ambient-name.d.ts","sourceRoot":"","sources":["../../../src/support/globals/ambient-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;
|
|
1
|
+
{"version":3,"file":"ambient-name.d.ts","sourceRoot":"","sources":["../../../src/support/globals/ambient-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAO7F;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,MAAM,GAAG,SAAS,CAE9G"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ASTUtils, AST_NODE_TYPES, TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
import { GLOBAL_OBJECTS } from '../purity/reference/global-objects.js';
|
|
2
3
|
import { propertyName } from './property-name.js';
|
|
3
|
-
const GLOBAL_OBJECTS = new Set(['globalThis', 'window', 'self', 'global']);
|
|
4
4
|
/** How many `const` aliases are followed back to what they name: `const a = Date; const b = a;`. */
|
|
5
5
|
const ALIAS_DEPTH = 4;
|
|
6
6
|
/**
|
|
@@ -20,7 +20,8 @@ function nameOf(sourceCode, node, depth) {
|
|
|
20
20
|
if (node.type !== AST_NODE_TYPES.MemberExpression || node.object.type !== AST_NODE_TYPES.Identifier) {
|
|
21
21
|
return undefined;
|
|
22
22
|
}
|
|
23
|
-
if (!GLOBAL_OBJECTS.
|
|
23
|
+
if (!GLOBAL_OBJECTS.includes(node.object.name) ||
|
|
24
|
+
identifierName(sourceCode, node.object, depth) !== node.object.name) {
|
|
24
25
|
return undefined;
|
|
25
26
|
}
|
|
26
27
|
return propertyName(node);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ambient-name.js","sourceRoot":"","sources":["../../../src/support/globals/ambient-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAiB,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"ambient-name.js","sourceRoot":"","sources":["../../../src/support/globals/ambient-name.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAiB,MAAM,0BAA0B,CAAC;AAC7F,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAE/C,oGAAoG;AACpG,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,UAAyC,EAAE,IAAmB;IACxF,OAAO,MAAM,CAAC,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;AACrC,CAAC;AAED,SAAS,MAAM,CAAC,UAAyC,EAAE,IAAmB,EAAE,KAAa;IAC3F,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU,EAAE,CAAC;QAC5C,OAAO,cAAc,CAAC,UAAU,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;IAED,IAAI,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,gBAAgB,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU,EAAE,CAAC;QACpG,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IACE,CAAC,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QAC1C,cAAc,CAAC,UAAU,EAAE,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,KAAK,IAAI,CAAC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CAAC;AACrG,CAAC;AAED,2EAA2E;AAC3E,SAAS,YAAY,CAAC,WAAiD;IACrE,MAAM,CAAC,UAAU,EAAE,GAAG,MAAM,CAAC,GAAG,WAAW,CAAC;IAE5C,IACE,UAAU,EAAE,IAAI,KAAK,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,QAAQ;QAC3D,MAAM,CAAC,MAAM,GAAG,CAAC;QACjB,UAAU,CAAC,MAAM,CAAC,IAAI,KAAK,OAAO;QAClC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU,EACrD,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,IAAI,SAAS,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PurityTable } from './reference/purity-table.js';
|
|
2
|
+
/** The three purity/* rules share one mechanism: forbidden globals and modules in domain/ and application/. */
|
|
3
|
+
export declare function purityRule(table: PurityTable): import("@typescript-eslint/utils/ts-eslint").RuleModule<"imported" | "used", [], import("../../index.js").RuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
4
|
+
//# sourceMappingURL=purity-rule.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purity-rule.d.ts","sourceRoot":"","sources":["../../../src/support/purity/purity-rule.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAE5D,+GAA+G;AAC/G,wBAAgB,UAAU,CAAC,KAAK,EAAE,WAAW,yKAiC5C"}
|
|
@@ -1,19 +1,23 @@
|
|
|
1
1
|
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
2
|
+
import { ambientName } from '../globals/ambient-name.js';
|
|
3
|
+
import { propertyName } from '../globals/property-name.js';
|
|
4
|
+
import { importListener } from '../imports/import-listener.js';
|
|
5
|
+
import { innerLayer } from '../imports/inner-layer.js';
|
|
6
|
+
import { defineRule } from '../rule/define-rule.js';
|
|
7
|
+
import { forbiddenCall } from './reference/forbidden-call.js';
|
|
8
|
+
import { forbiddenConstruction } from './reference/forbidden-construction.js';
|
|
9
|
+
import { forbiddenMember } from './reference/forbidden-member.js';
|
|
10
|
+
import { forbiddenNamedImport } from './reference/forbidden-named-import.js';
|
|
7
11
|
/** The three purity/* rules share one mechanism: forbidden globals and modules in domain/ and application/. */
|
|
8
|
-
export function purityRule(
|
|
12
|
+
export function purityRule(table) {
|
|
9
13
|
return defineRule({
|
|
10
|
-
id:
|
|
14
|
+
id: table.id,
|
|
11
15
|
type: 'problem',
|
|
12
16
|
recommended: 'error',
|
|
13
|
-
description:
|
|
17
|
+
description: table.description,
|
|
14
18
|
messages: {
|
|
15
|
-
used: `{{what}} is used in the {{layer}} layer. ${
|
|
16
|
-
imported: `"{{name}}" is imported in the {{layer}} layer. ${
|
|
19
|
+
used: `{{what}} is used in the {{layer}} layer. ${table.fix}`,
|
|
20
|
+
imported: `"{{name}}" is imported in the {{layer}} layer. ${table.fix}`,
|
|
17
21
|
},
|
|
18
22
|
create({ file, sourceCode, report }) {
|
|
19
23
|
const layer = innerLayer(file);
|
|
@@ -22,14 +26,14 @@ export function purityRule(rule) {
|
|
|
22
26
|
}
|
|
23
27
|
const { used, imported } = reporters(layer, report);
|
|
24
28
|
const ambient = (node) => ambientName(sourceCode, node) ?? '';
|
|
25
|
-
const imports = moduleImports(
|
|
29
|
+
const imports = moduleImports(table, file, imported);
|
|
26
30
|
return {
|
|
27
31
|
...imports,
|
|
28
|
-
ImportDeclaration: importDeclarationListener(
|
|
29
|
-
MemberExpression: (node) => used(node, forbiddenMember(
|
|
30
|
-
'CallExpression:exit': (node) => used(node,
|
|
31
|
-
NewExpression: (node) => used(node, forbiddenConstruction(
|
|
32
|
-
VariableDeclarator: destructuringListener(
|
|
32
|
+
ImportDeclaration: importDeclarationListener(table, imports, used),
|
|
33
|
+
MemberExpression: (node) => used(node, forbiddenMember(table, ambient(node.object), propertyName(node))),
|
|
34
|
+
'CallExpression:exit': (node) => used(node, forbiddenCall(table, ambient(node.callee))),
|
|
35
|
+
NewExpression: (node) => used(node, forbiddenConstruction(table, ambient(node.callee), node.arguments.length > 0)),
|
|
36
|
+
VariableDeclarator: destructuringListener(table, ambient, used),
|
|
33
37
|
};
|
|
34
38
|
},
|
|
35
39
|
});
|
|
@@ -45,19 +49,19 @@ function reporters(layer, report) {
|
|
|
45
49
|
};
|
|
46
50
|
}
|
|
47
51
|
/** The modules the rule forbids as a whole, however the file names them. */
|
|
48
|
-
function moduleImports(
|
|
52
|
+
function moduleImports(table, file, imported) {
|
|
49
53
|
return importListener(file, ({ node, target }) => {
|
|
50
|
-
if (target.kind !== 'file' &&
|
|
54
|
+
if (target.kind !== 'file' && table.modules.includes(moduleName(target))) {
|
|
51
55
|
imported(node, target.name);
|
|
52
56
|
}
|
|
53
57
|
});
|
|
54
58
|
}
|
|
55
59
|
/** The module as the import listener judges it, then each named import the rule forbids. */
|
|
56
|
-
function importDeclarationListener(
|
|
60
|
+
function importDeclarationListener(table, imports, used) {
|
|
57
61
|
return (node) => {
|
|
58
62
|
imports.ImportDeclaration(node);
|
|
59
63
|
for (const specifier of namedSpecifiersOf(node)) {
|
|
60
|
-
used(specifier, forbiddenNamedImport(
|
|
64
|
+
used(specifier, forbiddenNamedImport(table, node.source.value, importedName(specifier)));
|
|
61
65
|
}
|
|
62
66
|
};
|
|
63
67
|
}
|
|
@@ -67,25 +71,15 @@ function moduleName(target) {
|
|
|
67
71
|
function namedSpecifiersOf(node) {
|
|
68
72
|
return node.specifiers.filter((specifier) => specifier.type === AST_NODE_TYPES.ImportSpecifier);
|
|
69
73
|
}
|
|
70
|
-
function
|
|
71
|
-
|
|
72
|
-
return rule.namedImports[source.replace(/^node:/, '')]?.includes(name) === true
|
|
73
|
-
? `${name} of "${source}"`
|
|
74
|
-
: undefined;
|
|
75
|
-
}
|
|
76
|
-
function forbiddenMember(rule, object, property) {
|
|
77
|
-
const members = Object.hasOwn(rule.members, object) ? rule.members[object] : undefined;
|
|
78
|
-
if (members === undefined || property === undefined) {
|
|
79
|
-
return undefined;
|
|
80
|
-
}
|
|
81
|
-
return members.length === 0 || members.includes(property) ? `${object}.${property}` : undefined;
|
|
74
|
+
function importedName(node) {
|
|
75
|
+
return node.imported.type === AST_NODE_TYPES.Identifier ? node.imported.name : node.imported.value;
|
|
82
76
|
}
|
|
83
77
|
/** `const { env } = process` reads `process.env` as surely as the member expression does. */
|
|
84
|
-
function destructuringListener(
|
|
78
|
+
function destructuringListener(table, ambient, used) {
|
|
85
79
|
return (node) => {
|
|
86
80
|
const source = node.init === null ? '' : ambient(node.init);
|
|
87
81
|
for (const [property, name] of destructured(node)) {
|
|
88
|
-
used(property, forbiddenMember(
|
|
82
|
+
used(property, forbiddenMember(table, source, name));
|
|
89
83
|
}
|
|
90
84
|
};
|
|
91
85
|
}
|
|
@@ -110,12 +104,4 @@ function keyName(property) {
|
|
|
110
104
|
? property.key.value
|
|
111
105
|
: undefined;
|
|
112
106
|
}
|
|
113
|
-
function forbiddenConstruction(rule, callee, argumentCount) {
|
|
114
|
-
if (rule.constructions.includes(callee)) {
|
|
115
|
-
return `new ${callee}`;
|
|
116
|
-
}
|
|
117
|
-
return rule.bareConstructions.includes(callee) && argumentCount === 0
|
|
118
|
-
? `new ${callee}() without argument`
|
|
119
|
-
: undefined;
|
|
120
|
-
}
|
|
121
107
|
//# sourceMappingURL=purity-rule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purity-rule.js","sourceRoot":"","sources":["../../../src/support/purity/purity-rule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AAEzE,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC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IACtD,CAAC,CAAC,CAAC;AACL,CAAC;AAED,SAAS,OAAO,CAAC,QAA2B;IAC1C,IAAI,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;QAC1E,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;IAC3B,CAAC;IAED,OAAO,QAAQ,CAAC,GAAG,CAAC,IAAI,KAAK,cAAc,CAAC,OAAO,IAAI,OAAO,QAAQ,CAAC,GAAG,CAAC,KAAK,KAAK,QAAQ;QAC3F,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,KAAK;QACpB,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PurityTable } from './purity-table.js';
|
|
2
|
+
/** How a finding names the call of a global when the table forbids it: `fetch()`. */
|
|
3
|
+
export declare function forbiddenCall(table: PurityTable, callee: string): string | undefined;
|
|
4
|
+
//# sourceMappingURL=forbidden-call.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forbidden-call.d.ts","sourceRoot":"","sources":["../../../../src/support/purity/reference/forbidden-call.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,qFAAqF;AACrF,wBAAgB,aAAa,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAEpF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forbidden-call.js","sourceRoot":"","sources":["../../../../src/support/purity/reference/forbidden-call.ts"],"names":[],"mappings":"AAEA,qFAAqF;AACrF,MAAM,UAAU,aAAa,CAAC,KAAkB,EAAE,MAAc;IAC9D,OAAO,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PurityTable } from './purity-table.js';
|
|
2
|
+
/** How a finding names `new callee` when the table forbids it: always, or only when nothing is given to the constructor. */
|
|
3
|
+
export declare function forbiddenConstruction(table: PurityTable, callee: string, hasArguments: boolean): string | undefined;
|
|
4
|
+
//# sourceMappingURL=forbidden-construction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forbidden-construction.d.ts","sourceRoot":"","sources":["../../../../src/support/purity/reference/forbidden-construction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,4HAA4H;AAC5H,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAMnH"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** How a finding names `new callee` when the table forbids it: always, or only when nothing is given to the constructor. */
|
|
2
|
+
export function forbiddenConstruction(table, callee, hasArguments) {
|
|
3
|
+
if (table.constructions.includes(callee)) {
|
|
4
|
+
return `new ${callee}`;
|
|
5
|
+
}
|
|
6
|
+
return table.bareConstructions.includes(callee) && !hasArguments ? `new ${callee}() without argument` : undefined;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=forbidden-construction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forbidden-construction.js","sourceRoot":"","sources":["../../../../src/support/purity/reference/forbidden-construction.ts"],"names":[],"mappings":"AAEA,4HAA4H;AAC5H,MAAM,UAAU,qBAAqB,CAAC,KAAkB,EAAE,MAAc,EAAE,YAAqB;IAC7F,IAAI,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC;QACzC,OAAO,OAAO,MAAM,EAAE,CAAC;IACzB,CAAC;IAED,OAAO,KAAK,CAAC,iBAAiB,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,OAAO,MAAM,qBAAqB,CAAC,CAAC,CAAC,SAAS,CAAC;AACpH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PurityTable } from './purity-table.js';
|
|
2
|
+
/** How a finding names the member `object.property` when the table forbids it: `process.env`, any member of `console`. */
|
|
3
|
+
export declare function forbiddenMember(table: PurityTable, object: string, property: string | undefined): string | undefined;
|
|
4
|
+
//# sourceMappingURL=forbidden-member.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forbidden-member.d.ts","sourceRoot":"","sources":["../../../../src/support/purity/reference/forbidden-member.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,0HAA0H;AAC1H,wBAAgB,eAAe,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAQpH"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** How a finding names the member `object.property` when the table forbids it: `process.env`, any member of `console`. */
|
|
2
|
+
export function forbiddenMember(table, object, property) {
|
|
3
|
+
const members = Object.hasOwn(table.members, object) ? table.members[object] : undefined;
|
|
4
|
+
if (members === undefined || property === undefined) {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
return members.length === 0 || members.includes(property) ? `${object}.${property}` : undefined;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=forbidden-member.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forbidden-member.js","sourceRoot":"","sources":["../../../../src/support/purity/reference/forbidden-member.ts"],"names":[],"mappings":"AAEA,0HAA0H;AAC1H,MAAM,UAAU,eAAe,CAAC,KAAkB,EAAE,MAAc,EAAE,QAA4B;IAC9F,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAEzF,IAAI,OAAO,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QACpD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAClG,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { PurityTable } from './purity-table.js';
|
|
2
|
+
/** How a finding names an export imported by name when the table forbids it: `randomBytes of "node:crypto"`. */
|
|
3
|
+
export declare function forbiddenNamedImport(table: PurityTable, source: string, name: string): string | undefined;
|
|
4
|
+
//# sourceMappingURL=forbidden-named-import.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forbidden-named-import.d.ts","sourceRoot":"","sources":["../../../../src/support/purity/reference/forbidden-named-import.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD,gHAAgH;AAChH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAIzG"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** How a finding names an export imported by name when the table forbids it: `randomBytes of "node:crypto"`. */
|
|
2
|
+
export function forbiddenNamedImport(table, source, name) {
|
|
3
|
+
return table.namedImports[source.replace(/^node:/, '')]?.includes(name) === true
|
|
4
|
+
? `${name} of "${source}"`
|
|
5
|
+
: undefined;
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=forbidden-named-import.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"forbidden-named-import.js","sourceRoot":"","sources":["../../../../src/support/purity/reference/forbidden-named-import.ts"],"names":[],"mappings":"AAEA,gHAAgH;AAChH,MAAM,UAAU,oBAAoB,CAAC,KAAkB,EAAE,MAAc,EAAE,IAAY;IACnF,OAAO,KAAK,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,KAAK,IAAI;QAC9E,CAAC,CAAC,GAAG,IAAI,QAAQ,MAAM,GAAG;QAC1B,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-objects.d.ts","sourceRoot":"","sources":["../../../../src/support/purity/reference/global-objects.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAC3G,eAAO,MAAM,cAAc,EAAE,SAAS,MAAM,EAA+C,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"global-objects.js","sourceRoot":"","sources":["../../../../src/support/purity/reference/global-objects.ts"],"names":[],"mappings":"AAAA,2GAA2G;AAC3G,MAAM,CAAC,MAAM,cAAc,GAAsB,CAAC,YAAY,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* What one purity/* rule forbids in domain/ and application/, and what it says. The ESLint plugin
|
|
3
|
+
* and `ddd-ts-kit check` both judge from it: the plugin on the syntax tree, the checker on the text.
|
|
4
|
+
*/
|
|
5
|
+
export interface PurityTable {
|
|
2
6
|
readonly id: string;
|
|
3
7
|
readonly description: string;
|
|
4
|
-
/** What to do instead,
|
|
5
|
-
readonly
|
|
8
|
+
/** What to do instead, said with every finding. */
|
|
9
|
+
readonly fix: string;
|
|
6
10
|
/** Global object to the members that give the access; an empty list means every member. */
|
|
7
11
|
readonly members: Readonly<Record<string, readonly string[]>>;
|
|
8
12
|
readonly calls: readonly string[];
|
|
@@ -14,6 +18,4 @@ export interface Purity {
|
|
|
14
18
|
/** Built-in to the named exports that are forbidden while the rest of the module is not judged here. */
|
|
15
19
|
readonly namedImports: Readonly<Record<string, readonly string[]>>;
|
|
16
20
|
}
|
|
17
|
-
|
|
18
|
-
export declare function purityRule(rule: Purity): import("@typescript-eslint/utils/ts-eslint").RuleModule<"imported" | "used", [], import("../index.js").RuleDocs, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
19
|
-
//# sourceMappingURL=purity-rule.d.ts.map
|
|
21
|
+
//# sourceMappingURL=purity-table.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purity-table.d.ts","sourceRoot":"","sources":["../../../../src/support/purity/reference/purity-table.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,mDAAmD;IACnD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,2FAA2F;IAC3F,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;IAC9D,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,kFAAkF;IAClF,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9C,+FAA+F;IAC/F,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,wGAAwG;IACxG,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;CACpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purity-table.js","sourceRoot":"","sources":["../../../../src/support/purity/reference/purity-table.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/** One table per purity/* rule, under its id of the architecture reference. */
|
|
2
|
+
export declare const PURITY_TABLES: {
|
|
3
|
+
readonly 'purity/no-system-clock': {
|
|
4
|
+
readonly id: 'purity/no-system-clock';
|
|
5
|
+
readonly description: 'No new Date() without argument, Date.now(), Date() or performance.now() in domain/ or application/: time comes from the Clock port.';
|
|
6
|
+
readonly fix: 'Receive the instant as a parameter in the domain, and take it from the Clock port (`this.clock.now()`) in a handler, so that a test fixes time with FixedClock.';
|
|
7
|
+
readonly members: {
|
|
8
|
+
readonly Date: readonly ["now"];
|
|
9
|
+
readonly performance: readonly ["now", "timeOrigin"];
|
|
10
|
+
};
|
|
11
|
+
readonly calls: readonly ["Date"];
|
|
12
|
+
readonly constructions: readonly [];
|
|
13
|
+
readonly bareConstructions: readonly ["Date"];
|
|
14
|
+
readonly modules: readonly [];
|
|
15
|
+
readonly namedImports: {};
|
|
16
|
+
};
|
|
17
|
+
readonly 'purity/no-ambient-randomness': {
|
|
18
|
+
readonly id: 'purity/no-ambient-randomness';
|
|
19
|
+
readonly description: 'No Math.random, crypto.randomUUID or id library in domain/ or application/: identifiers come from the IdGenerator port.';
|
|
20
|
+
readonly fix: 'Receive the identifier as a parameter in the domain, and take it from the IdGenerator port (`this.ids.next()`) in a handler, so that a test gets predictable identifiers.';
|
|
21
|
+
readonly members: {
|
|
22
|
+
readonly Math: readonly ["random"];
|
|
23
|
+
readonly crypto: string[];
|
|
24
|
+
};
|
|
25
|
+
readonly calls: readonly ["randomUUID"];
|
|
26
|
+
readonly constructions: readonly [];
|
|
27
|
+
readonly bareConstructions: readonly [];
|
|
28
|
+
readonly modules: readonly ["uuid", "nanoid", "ulid", "ulidx", "cuid", "@paralleldrive/cuid2", "ksuid", "shortid", "uuidv7", "hyperid", "bson"];
|
|
29
|
+
readonly namedImports: {
|
|
30
|
+
readonly crypto: readonly [...string[], "webcrypto"];
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
readonly 'purity/no-environment': {
|
|
34
|
+
readonly id: 'purity/no-environment';
|
|
35
|
+
readonly description: 'No process.env, console, file system or network access in domain/ or application/.';
|
|
36
|
+
readonly fix: 'Declare what is needed as a port in application/ports (an abstract class: a configuration, a logger, a gateway), implement it in infrastructure/ and bind it in the module file.';
|
|
37
|
+
readonly members: {
|
|
38
|
+
readonly process: readonly ["env", "argv", "cwd", "exit", "stdout", "stderr", "stdin"];
|
|
39
|
+
readonly console: readonly [];
|
|
40
|
+
};
|
|
41
|
+
readonly calls: readonly ["fetch"];
|
|
42
|
+
readonly constructions: readonly ["XMLHttpRequest", "WebSocket", "EventSource"];
|
|
43
|
+
readonly bareConstructions: readonly [];
|
|
44
|
+
readonly modules: readonly ["fs", "http", "https", "http2", "net", "dgram", "dns", "tls", "child_process", "worker_threads", "os", "readline", "axios", "node-fetch", "undici", "got", "dotenv"];
|
|
45
|
+
readonly namedImports: {};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=purity-tables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purity-tables.d.ts","sourceRoot":"","sources":["../../../../src/support/purity/reference/purity-tables.ts"],"names":[],"mappings":"AAIA,+EAA+E;AAC/E,eAAO,MAAM,aAAa;;iBAEtB,EAAE,EAAE,wBAAwB;iBAC5B,WAAW,EACT,qIAAqI;iBACvI,GAAG,EAAE,iKAAiK;iBACtK,OAAO;qBAAI,IAAI;qBAAW,WAAW;;iBACrC,KAAK;iBACL,aAAa;iBACb,iBAAiB;iBACjB,OAAO;iBACP,YAAY;;;iBAGZ,EAAE,EAAE,8BAA8B;iBAClC,WAAW,EACT,yHAAyH;iBAC3H,GAAG,EAAE,2KAA2K;iBAChL,OAAO;qBAAI,IAAI;qBAAc,MAAM;;iBACnC,KAAK;iBACL,aAAa;iBACb,iBAAiB;iBACjB,OAAO;iBAaP,YAAY;qBAAI,MAAM;;;;iBAGtB,EAAE,EAAE,uBAAuB;iBAC3B,WAAW,EAAE,oFAAoF;iBACjG,GAAG,EAAE,kLAAkL;iBACvL,OAAO;qBAAI,OAAO;qBAA+D,OAAO;;iBACxF,KAAK;iBACL,aAAa;iBACb,iBAAiB;iBACjB,OAAO;iBAmBP,YAAY;;CAEgC,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
const RANDOM_OF_CRYPTO = ['randomUUID', 'getRandomValues', 'randomBytes', 'randomInt'];
|
|
2
|
+
/** One table per purity/* rule, under its id of the architecture reference. */
|
|
3
|
+
export const PURITY_TABLES = {
|
|
4
|
+
'purity/no-system-clock': {
|
|
5
|
+
id: 'purity/no-system-clock',
|
|
6
|
+
description: 'No new Date() without argument, Date.now(), Date() or performance.now() in domain/ or application/: time comes from the Clock port.',
|
|
7
|
+
fix: 'Receive the instant as a parameter in the domain, and take it from the Clock port (`this.clock.now()`) in a handler, so that a test fixes time with FixedClock.',
|
|
8
|
+
members: { Date: ['now'], performance: ['now', 'timeOrigin'] },
|
|
9
|
+
calls: ['Date'],
|
|
10
|
+
constructions: [],
|
|
11
|
+
bareConstructions: ['Date'],
|
|
12
|
+
modules: [],
|
|
13
|
+
namedImports: {},
|
|
14
|
+
},
|
|
15
|
+
'purity/no-ambient-randomness': {
|
|
16
|
+
id: 'purity/no-ambient-randomness',
|
|
17
|
+
description: 'No Math.random, crypto.randomUUID or id library in domain/ or application/: identifiers come from the IdGenerator port.',
|
|
18
|
+
fix: 'Receive the identifier as a parameter in the domain, and take it from the IdGenerator port (`this.ids.next()`) in a handler, so that a test gets predictable identifiers.',
|
|
19
|
+
members: { Math: ['random'], crypto: RANDOM_OF_CRYPTO },
|
|
20
|
+
calls: ['randomUUID'],
|
|
21
|
+
constructions: [],
|
|
22
|
+
bareConstructions: [],
|
|
23
|
+
modules: [
|
|
24
|
+
'uuid',
|
|
25
|
+
'nanoid',
|
|
26
|
+
'ulid',
|
|
27
|
+
'ulidx',
|
|
28
|
+
'cuid',
|
|
29
|
+
'@paralleldrive/cuid2',
|
|
30
|
+
'ksuid',
|
|
31
|
+
'shortid',
|
|
32
|
+
'uuidv7',
|
|
33
|
+
'hyperid',
|
|
34
|
+
'bson',
|
|
35
|
+
],
|
|
36
|
+
namedImports: { crypto: [...RANDOM_OF_CRYPTO, 'webcrypto'] },
|
|
37
|
+
},
|
|
38
|
+
'purity/no-environment': {
|
|
39
|
+
id: 'purity/no-environment',
|
|
40
|
+
description: 'No process.env, console, file system or network access in domain/ or application/.',
|
|
41
|
+
fix: 'Declare what is needed as a port in application/ports (an abstract class: a configuration, a logger, a gateway), implement it in infrastructure/ and bind it in the module file.',
|
|
42
|
+
members: { process: ['env', 'argv', 'cwd', 'exit', 'stdout', 'stderr', 'stdin'], console: [] },
|
|
43
|
+
calls: ['fetch'],
|
|
44
|
+
constructions: ['XMLHttpRequest', 'WebSocket', 'EventSource'],
|
|
45
|
+
bareConstructions: [],
|
|
46
|
+
modules: [
|
|
47
|
+
'fs',
|
|
48
|
+
'http',
|
|
49
|
+
'https',
|
|
50
|
+
'http2',
|
|
51
|
+
'net',
|
|
52
|
+
'dgram',
|
|
53
|
+
'dns',
|
|
54
|
+
'tls',
|
|
55
|
+
'child_process',
|
|
56
|
+
'worker_threads',
|
|
57
|
+
'os',
|
|
58
|
+
'readline',
|
|
59
|
+
'axios',
|
|
60
|
+
'node-fetch',
|
|
61
|
+
'undici',
|
|
62
|
+
'got',
|
|
63
|
+
'dotenv',
|
|
64
|
+
],
|
|
65
|
+
namedImports: {},
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=purity-tables.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"purity-tables.js","sourceRoot":"","sources":["../../../../src/support/purity/reference/purity-tables.ts"],"names":[],"mappings":"AAEA,MAAM,gBAAgB,GAAG,CAAC,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,WAAW,CAAC,CAAC;AAEvF,+EAA+E;AAC/E,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,wBAAwB,EAAE;QACxB,EAAE,EAAE,wBAAwB;QAC5B,WAAW,EACT,qIAAqI;QACvI,GAAG,EAAE,iKAAiK;QACtK,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,WAAW,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE;QAC9D,KAAK,EAAE,CAAC,MAAM,CAAC;QACf,aAAa,EAAE,EAAE;QACjB,iBAAiB,EAAE,CAAC,MAAM,CAAC;QAC3B,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,EAAE;KACjB;IACD,8BAA8B,EAAE;QAC9B,EAAE,EAAE,8BAA8B;QAClC,WAAW,EACT,yHAAyH;QAC3H,GAAG,EAAE,2KAA2K;QAChL,OAAO,EAAE,EAAE,IAAI,EAAE,CAAC,QAAQ,CAAC,EAAE,MAAM,EAAE,gBAAgB,EAAE;QACvD,KAAK,EAAE,CAAC,YAAY,CAAC;QACrB,aAAa,EAAE,EAAE;QACjB,iBAAiB,EAAE,EAAE;QACrB,OAAO,EAAE;YACP,MAAM;YACN,QAAQ;YACR,MAAM;YACN,OAAO;YACP,MAAM;YACN,sBAAsB;YACtB,OAAO;YACP,SAAS;YACT,QAAQ;YACR,SAAS;YACT,MAAM;SACP;QACD,YAAY,EAAE,EAAE,MAAM,EAAE,CAAC,GAAG,gBAAgB,EAAE,WAAW,CAAC,EAAE;KAC7D;IACD,uBAAuB,EAAE;QACvB,EAAE,EAAE,uBAAuB;QAC3B,WAAW,EAAE,oFAAoF;QACjG,GAAG,EAAE,kLAAkL;QACvL,OAAO,EAAE,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE;QAC9F,KAAK,EAAE,CAAC,OAAO,CAAC;QAChB,aAAa,EAAE,CAAC,gBAAgB,EAAE,WAAW,EAAE,aAAa,CAAC;QAC7D,iBAAiB,EAAE,EAAE;QACrB,OAAO,EAAE;YACP,IAAI;YACJ,MAAM;YACN,OAAO;YACP,OAAO;YACP,KAAK;YACL,OAAO;YACP,KAAK;YACL,KAAK;YACL,eAAe;YACf,gBAAgB;YAChB,IAAI;YACJ,UAAU;YACV,OAAO;YACP,YAAY;YACZ,QAAQ;YACR,KAAK;YACL,QAAQ;SACT;QACD,YAAY,EAAE,EAAE;KACjB;CAC6C,CAAC"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { type TSESLint } from '@typescript-eslint/utils';
|
|
2
|
-
/**
|
|
2
|
+
/**
|
|
3
|
+
* Lines silenced for `ruleId` by the suppression comment the CLI checker understands too: a comment
|
|
4
|
+
* on its own line that names the rule, alone or in a list after commas, and gives a reason. Directives
|
|
5
|
+
* one above the other all cover the line after the last of them.
|
|
6
|
+
*/
|
|
3
7
|
export declare function suppressedLines(sourceCode: Readonly<TSESLint.SourceCode>, ruleId: string): ReadonlySet<number>;
|
|
4
8
|
//# sourceMappingURL=suppressed-lines.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suppressed-lines.d.ts","sourceRoot":"","sources":["../../../src/support/suppressions/suppressed-lines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,QAAQ,
|
|
1
|
+
{"version":3,"file":"suppressed-lines.d.ts","sourceRoot":"","sources":["../../../src/support/suppressions/suppressed-lines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAmB,KAAK,QAAQ,EAAiB,MAAM,0BAA0B,CAAC;AAMzF;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,CAQ9G"}
|
|
@@ -1,17 +1,36 @@
|
|
|
1
1
|
import { AST_TOKEN_TYPES } from '@typescript-eslint/utils';
|
|
2
2
|
import { sharesLineWithCode } from './shares-line-with-code.js';
|
|
3
|
-
const DIRECTIVE = /^ddd-ts-kit-disable-next-line
|
|
4
|
-
|
|
3
|
+
const DIRECTIVE = /^ddd-ts-kit-disable-next-line(?:\W|$)/;
|
|
4
|
+
const NAMED_WITH_A_REASON = /^ddd-ts-kit-disable-next-line\s+(.*?)\s*--\s*\S/;
|
|
5
|
+
/**
|
|
6
|
+
* Lines silenced for `ruleId` by the suppression comment the CLI checker understands too: a comment
|
|
7
|
+
* on its own line that names the rule, alone or in a list after commas, and gives a reason. Directives
|
|
8
|
+
* one above the other all cover the line after the last of them.
|
|
9
|
+
*/
|
|
5
10
|
export function suppressedLines(sourceCode, ruleId) {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
const directives = sourceCode
|
|
12
|
+
.getAllComments()
|
|
13
|
+
.filter((comment) => isDirective(comment) && !sharesLineWithCode(sourceCode, comment));
|
|
14
|
+
return new Set(directives.flatMap((comment, index) => (silences(comment, ruleId) ? [lineAfterStack(directives, index)] : [])));
|
|
15
|
+
}
|
|
16
|
+
function isDirective(comment) {
|
|
17
|
+
return comment.type === AST_TOKEN_TYPES.Line && DIRECTIVE.test(comment.value.trim());
|
|
18
|
+
}
|
|
19
|
+
function silences(comment, ruleId) {
|
|
20
|
+
const named = NAMED_WITH_A_REASON.exec(comment.value.trim())?.[1] ?? '';
|
|
21
|
+
return named
|
|
22
|
+
.split(',')
|
|
23
|
+
.map((id) => id.trim())
|
|
24
|
+
.includes(ruleId);
|
|
25
|
+
}
|
|
26
|
+
function lineAfterStack(directives, from) {
|
|
27
|
+
let last = from;
|
|
28
|
+
while (directives[last + 1]?.loc.start.line === lineOf(directives[last]) + 1) {
|
|
29
|
+
last += 1;
|
|
14
30
|
}
|
|
15
|
-
return
|
|
31
|
+
return lineOf(directives[last]) + 1;
|
|
32
|
+
}
|
|
33
|
+
function lineOf(comment) {
|
|
34
|
+
return comment?.loc.end.line ?? 0;
|
|
16
35
|
}
|
|
17
36
|
//# sourceMappingURL=suppressed-lines.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"suppressed-lines.js","sourceRoot":"","sources":["../../../src/support/suppressions/suppressed-lines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,
|
|
1
|
+
{"version":3,"file":"suppressed-lines.js","sourceRoot":"","sources":["../../../src/support/suppressions/suppressed-lines.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAgC,MAAM,0BAA0B,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAE7D,MAAM,SAAS,GAAG,uCAAuC,CAAC;AAC1D,MAAM,mBAAmB,GAAG,iDAAiD,CAAC;AAE9E;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,UAAyC,EAAE,MAAc;IACvF,MAAM,UAAU,GAAG,UAAU;SAC1B,cAAc,EAAE;SAChB,MAAM,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,CAAC;IAEzF,OAAO,IAAI,GAAG,CACZ,UAAU,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAC/G,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,OAAyB;IAC5C,OAAO,OAAO,CAAC,IAAI,KAAK,eAAe,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;AACvF,CAAC;AAED,SAAS,QAAQ,CAAC,OAAyB,EAAE,MAAc;IACzD,MAAM,KAAK,GAAG,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;IAExE,OAAO,KAAK;SACT,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;SACtB,QAAQ,CAAC,MAAM,CAAC,CAAC;AACtB,CAAC;AAED,SAAS,cAAc,CAAC,UAAuC,EAAE,IAAY;IAC3E,IAAI,IAAI,GAAG,IAAI,CAAC;IAEhB,OAAO,UAAU,CAAC,IAAI,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7E,IAAI,IAAI,CAAC,CAAC;IACZ,CAAC;IAED,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC;AACtC,CAAC;AAED,SAAS,MAAM,CAAC,OAAqC;IACnD,OAAO,OAAO,EAAE,GAAG,CAAC,GAAG,CAAC,IAAI,IAAI,CAAC,CAAC;AACpC,CAAC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.115.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.115.0';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[English](domain-events-dispatched-on-save.md) · **Français**
|
|
2
|
-
<!-- translation-of: domain-events-dispatched-on-save.md sha256:
|
|
2
|
+
<!-- translation-of: domain-events-dispatched-on-save.md sha256:8737ca0a75ea5658 -->
|
|
3
3
|
|
|
4
4
|
# ddd-ts-kit/domain-events-dispatched-on-save
|
|
5
5
|
|
|
@@ -13,7 +13,7 @@ Les événements du domaine partent avec l'enregistrement. Une fois résolue une
|
|
|
13
13
|
|
|
14
14
|
## Signalé
|
|
15
15
|
|
|
16
|
-
- un appel à `.
|
|
16
|
+
- un appel à `.takeRecordedEvents()` dans tout fichier de production sous `application/` ou `infrastructure/` d'un contexte
|
|
17
17
|
- dans `application/commands/`, `application/queries/` et un adaptateur de *repository* (`infrastructure/persistence/**/*.repository.ts`) : `DomainEventDispatcher` importé (de n'importe quel module, imports de type seul compris), nommé dans une liste de dépendances, ou typant un paramètre de constructeur
|
|
18
18
|
|
|
19
19
|
Incorrect :
|
|
@@ -34,7 +34,7 @@ export class IssueInvoiceHandler {
|
|
|
34
34
|
const invoice = Invoice.issue(command.customerId, this.clock.now());
|
|
35
35
|
|
|
36
36
|
await this.invoices.save(invoice);
|
|
37
|
-
await this.dispatcher.dispatch(invoice
|
|
37
|
+
await this.dispatcher.dispatch(takeRecordedEvents(invoice));
|
|
38
38
|
|
|
39
39
|
return invoice.id;
|
|
40
40
|
}
|
|
@@ -66,9 +66,9 @@ export class IssueInvoiceHandler {
|
|
|
66
66
|
|
|
67
67
|
## Détails
|
|
68
68
|
|
|
69
|
-
`
|
|
69
|
+
`takeRecordedEvents` se lit comme l'appel de la fonction du noyau (`takeRecordedEvents(invoice)`, `takeRecordedEvents(this.invoice)`) : une déclaration de ce nom, un identifiant seul et une méthode de ce nom sur un autre objet ne sont pas cet appel. Une liste de dépendances est le dernier argument d'un décorateur de déclaration de `@ddd-ts-kit/kernel/declarations` (`@CommandHandler(M, [..])`, `@QueryHandler`, `@Repository`) et le second argument de `.toClass(C, [..])` et de `.handledBy(H, [..])`.
|
|
70
70
|
|
|
71
|
-
Ne sont pas jugés : `domain/` (l'agrégat enregistre et remet ses propres événements), les *specs* et tout ce qui est sous `test/` d'un contexte, `<context>.module.ts` (le module explicite peut encore enregistrer des gestionnaires d'événements sur le distributeur), la plateforme, `main.ts`, `apps/` et tout fichier hors d'un contexte. `application/event-handlers/` et `application/integration/` ne sont tenus qu'à la partie `
|
|
71
|
+
Ne sont pas jugés : `domain/` (l'agrégat enregistre et remet ses propres événements), les *specs* et tout ce qui est sous `test/` d'un contexte, `<context>.module.ts` (le module explicite peut encore enregistrer des gestionnaires d'événements sur le distributeur), la plateforme, `main.ts`, `apps/` et tout fichier hors d'un contexte. `application/event-handlers/` et `application/integration/` ne sont tenus qu'à la partie `takeRecordedEvents()`.
|
|
72
72
|
|
|
73
73
|
## Options
|
|
74
74
|
|
|
@@ -83,4 +83,4 @@ Aucune.
|
|
|
83
83
|
|
|
84
84
|
## Avec le checker de la CLI
|
|
85
85
|
|
|
86
|
-
`ddd-ts-kit check` signale le même identifiant à partir du texte des fichiers : un constat par ligne qui appelle `.
|
|
86
|
+
`ddd-ts-kit check` signale le même identifiant à partir du texte des fichiers : un constat par ligne qui appelle `.takeRecordedEvents(`, par import qui lie `DomainEventDispatcher`, par liste de dépendances et par constructeur qui le nomme. Cette règle fait autorité.
|
|
@@ -12,7 +12,7 @@ Domain events leave with the save. After a repository method that was handed an
|
|
|
12
12
|
|
|
13
13
|
## Reported
|
|
14
14
|
|
|
15
|
-
- a call to `.
|
|
15
|
+
- a call to `.takeRecordedEvents()` in any production file under `application/` or `infrastructure/` of a context
|
|
16
16
|
- in `application/commands/`, `application/queries/` and a repository adapter (`infrastructure/persistence/**/*.repository.ts`): `DomainEventDispatcher` imported (from any module, type-only imports included), named in a dependency list, or typing a constructor parameter
|
|
17
17
|
|
|
18
18
|
Incorrect:
|
|
@@ -33,7 +33,7 @@ export class IssueInvoiceHandler {
|
|
|
33
33
|
const invoice = Invoice.issue(command.customerId, this.clock.now());
|
|
34
34
|
|
|
35
35
|
await this.invoices.save(invoice);
|
|
36
|
-
await this.dispatcher.dispatch(invoice
|
|
36
|
+
await this.dispatcher.dispatch(takeRecordedEvents(invoice));
|
|
37
37
|
|
|
38
38
|
return invoice.id;
|
|
39
39
|
}
|
|
@@ -65,9 +65,9 @@ export class IssueInvoiceHandler {
|
|
|
65
65
|
|
|
66
66
|
## Details
|
|
67
67
|
|
|
68
|
-
`
|
|
68
|
+
`takeRecordedEvents` is read as a call of the function of the kernel (`takeRecordedEvents(invoice)`, `takeRecordedEvents(this.invoice)`): a declaration of that name, a bare identifier and a method of that name on another object are not that call. A dependency list is the last argument of a declaration decorator of `@ddd-ts-kit/kernel/declarations` (`@CommandHandler(M, [..])`, `@QueryHandler`, `@Repository`) and the second argument of `.toClass(C, [..])` and `.handledBy(H, [..])`.
|
|
69
69
|
|
|
70
|
-
Not judged: `domain/` (the aggregate records and hands over its own events), the specs and everything under `test/` of a context, `<context>.module.ts` (the explicit module may still register event handlers on the dispatcher), the platform, `main.ts`, `apps/` and every file outside a context. `application/event-handlers/` and `application/integration/` are held to the `
|
|
70
|
+
Not judged: `domain/` (the aggregate records and hands over its own events), the specs and everything under `test/` of a context, `<context>.module.ts` (the explicit module may still register event handlers on the dispatcher), the platform, `main.ts`, `apps/` and every file outside a context. `application/event-handlers/` and `application/integration/` are held to the `takeRecordedEvents()` part only.
|
|
71
71
|
|
|
72
72
|
## Options
|
|
73
73
|
|
|
@@ -82,4 +82,4 @@ None.
|
|
|
82
82
|
|
|
83
83
|
## With the CLI checker
|
|
84
84
|
|
|
85
|
-
`ddd-ts-kit check` reports the same id from the text of the files: one finding per line that calls `.
|
|
85
|
+
`ddd-ts-kit check` reports the same id from the text of the files: one finding per line that calls `.takeRecordedEvents(`, per import that binds `DomainEventDispatcher`, per dependency list and per constructor that names it. This rule is the authority.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[English](purity-no-ambient-randomness.md) · **Français**
|
|
2
|
-
<!-- translation-of: purity-no-ambient-randomness.md sha256:
|
|
2
|
+
<!-- translation-of: purity-no-ambient-randomness.md sha256:e3dd2d5e9b547a63 -->
|
|
3
3
|
|
|
4
4
|
# ddd-ts-kit/purity-no-ambient-randomness
|
|
5
5
|
|
|
@@ -44,4 +44,4 @@ Aucune.
|
|
|
44
44
|
|
|
45
45
|
## Avec le checker de la CLI
|
|
46
46
|
|
|
47
|
-
`ddd-ts-kit check`
|
|
47
|
+
`ddd-ts-kit check` juge d'après la même table et formule un constat de la même façon, sur le texte du fichier là où cette règle lit son arbre syntaxique. Il distingue de la globale un paramètre, une variable, un nom déstructuré, une fonction ou une classe que le fichier déclare, et d'un appel une méthode déclarée sous le nom d'une globale. Cette règle fait autorité là où ils diffèrent : le checker ne suit aucun alias (`const clock = Date`, `import { randomUUID as id }`), ne masque un `var` que dans son bloc et une variable de boucle sans accolades que dans l'en-tête de la boucle, lit `typeof process.env` dans un type comme un usage, et prend pour un appel une signature qui n'a ni corps, ni type de retour, ni modificateur, ou qui suit un membre qu'aucun point-virgule ne termine.
|
|
@@ -43,4 +43,4 @@ None.
|
|
|
43
43
|
|
|
44
44
|
## With the CLI checker
|
|
45
45
|
|
|
46
|
-
`ddd-ts-kit check`
|
|
46
|
+
`ddd-ts-kit check` judges from the same table and words a finding the same way, on the text of the file where this rule reads its syntax tree. It knows a parameter, a variable, a destructured name, a function or a class the file declares from the global, and a method declared under the name of a global from a call. This rule is the authority where they differ: the checker follows no alias (`const clock = Date`, `import { randomUUID as id }`), hides a `var` in its block only and a loop variable without braces in the head of the loop only, reads `typeof process.env` in a type as a use, and takes for a call a signature that has neither body, return type nor modifier, or that follows a member no semicolon ends.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[English](purity-no-environment.md) · **Français**
|
|
2
|
-
<!-- translation-of: purity-no-environment.md sha256:
|
|
2
|
+
<!-- translation-of: purity-no-environment.md sha256:7dd80578329702db -->
|
|
3
3
|
|
|
4
4
|
# ddd-ts-kit/purity-no-environment
|
|
5
5
|
|
|
@@ -46,4 +46,4 @@ Aucune.
|
|
|
46
46
|
|
|
47
47
|
## Avec le checker de la CLI
|
|
48
48
|
|
|
49
|
-
`ddd-ts-kit check`
|
|
49
|
+
`ddd-ts-kit check` juge d'après la même table et formule un constat de la même façon, sur le texte du fichier là où cette règle lit son arbre syntaxique. Il distingue de la globale un paramètre, une variable, un nom déstructuré, une fonction ou une classe que le fichier déclare, et d'un appel une méthode déclarée sous le nom d'une globale. Cette règle fait autorité là où ils diffèrent : le checker ne suit aucun alias (`const clock = Date`, `import { randomUUID as id }`), ne masque un `var` que dans son bloc et une variable de boucle sans accolades que dans l'en-tête de la boucle, lit `typeof process.env` dans un type comme un usage, et prend pour un appel une signature qui n'a ni corps, ni type de retour, ni modificateur, ou qui suit un membre qu'aucun point-virgule ne termine.
|
|
@@ -45,4 +45,4 @@ None.
|
|
|
45
45
|
|
|
46
46
|
## With the CLI checker
|
|
47
47
|
|
|
48
|
-
`ddd-ts-kit check`
|
|
48
|
+
`ddd-ts-kit check` judges from the same table and words a finding the same way, on the text of the file where this rule reads its syntax tree. It knows a parameter, a variable, a destructured name, a function or a class the file declares from the global, and a method declared under the name of a global from a call. This rule is the authority where they differ: the checker follows no alias (`const clock = Date`, `import { randomUUID as id }`), hides a `var` in its block only and a loop variable without braces in the head of the loop only, reads `typeof process.env` in a type as a use, and takes for a call a signature that has neither body, return type nor modifier, or that follows a member no semicolon ends.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
[English](purity-no-system-clock.md) · **Français**
|
|
2
|
-
<!-- translation-of: purity-no-system-clock.md sha256:
|
|
2
|
+
<!-- translation-of: purity-no-system-clock.md sha256:c7cb0528139ea317 -->
|
|
3
3
|
|
|
4
4
|
# ddd-ts-kit/purity-no-system-clock
|
|
5
5
|
|
|
@@ -50,4 +50,4 @@ Aucune.
|
|
|
50
50
|
|
|
51
51
|
## Avec le checker de la CLI
|
|
52
52
|
|
|
53
|
-
`ddd-ts-kit check`
|
|
53
|
+
`ddd-ts-kit check` juge d'après la même table et formule un constat de la même façon, sur le texte du fichier là où cette règle lit son arbre syntaxique. Il distingue de la globale un paramètre, une variable, un nom déstructuré, une fonction ou une classe que le fichier déclare, et d'un appel une méthode déclarée sous le nom d'une globale. Cette règle fait autorité là où ils diffèrent : le checker ne suit aucun alias (`const clock = Date`, `import { randomUUID as id }`), ne masque un `var` que dans son bloc et une variable de boucle sans accolades que dans l'en-tête de la boucle, lit `typeof process.env` dans un type comme un usage, et prend pour un appel une signature qui n'a ni corps, ni type de retour, ni modificateur, ou qui suit un membre qu'aucun point-virgule ne termine.
|
|
@@ -49,4 +49,4 @@ None.
|
|
|
49
49
|
|
|
50
50
|
## With the CLI checker
|
|
51
51
|
|
|
52
|
-
`ddd-ts-kit check`
|
|
52
|
+
`ddd-ts-kit check` judges from the same table and words a finding the same way, on the text of the file where this rule reads its syntax tree. It knows a parameter, a variable, a destructured name, a function or a class the file declares from the global, and a method declared under the name of a global from a call. This rule is the authority where they differ: the checker follows no alias (`const clock = Date`, `import { randomUUID as id }`), hides a `var` in its block only and a loop variable without braces in the head of the loop only, reads `typeof process.env` in a type as a use, and takes for a call a signature that has neither body, return type nor modifier, or that follows a member no semicolon ends.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ddd-ts-kit/eslint-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.115.0",
|
|
4
4
|
"description": "AST-accurate ESLint rules for DDD and Clean Architecture in TypeScript: layer and context isolation, domain purity, clean code ordering.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ddd",
|
|
@@ -50,13 +50,13 @@
|
|
|
50
50
|
"typescript-eslint": "^8.71.0"
|
|
51
51
|
},
|
|
52
52
|
"dependencies": {
|
|
53
|
-
"@stylistic/eslint-plugin": "^
|
|
53
|
+
"@stylistic/eslint-plugin": "^6.0.1",
|
|
54
54
|
"@typescript-eslint/utils": "^8.72.1"
|
|
55
55
|
},
|
|
56
56
|
"devDependencies": {
|
|
57
57
|
"@eslint/js": "^10.0.1",
|
|
58
58
|
"@typescript-eslint/rule-tester": "^8.72.1",
|
|
59
|
-
"eslint": "^10.
|
|
59
|
+
"eslint": "^10.15.0",
|
|
60
60
|
"typescript-eslint": "^8.72.1"
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"purity-rule.d.ts","sourceRoot":"","sources":["../../src/support/purity-rule.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,qDAAqD;IACrD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,2FAA2F;IAC3F,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;IAC9D,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,aAAa,EAAE,SAAS,MAAM,EAAE,CAAC;IAC1C,kFAAkF;IAClF,QAAQ,CAAC,iBAAiB,EAAE,SAAS,MAAM,EAAE,CAAC;IAC9C,+FAA+F;IAC/F,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,wGAAwG;IACxG,QAAQ,CAAC,YAAY,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC,CAAC;CACpE;AAED,+GAA+G;AAC/G,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,sKAgCtC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"purity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