@ddd-ts-kit/eslint-plugin 0.16.1 → 0.18.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 +7 -6
- package/README.md +5 -4
- package/dist/project/config.d.ts +8 -0
- package/dist/project/config.d.ts.map +1 -1
- package/dist/project/parse-config.d.ts.map +1 -1
- package/dist/project/parse-config.js +13 -0
- package/dist/project/parse-config.js.map +1 -1
- package/dist/rules/declarations-role-declared.d.ts +2 -2
- package/dist/rules/declarations-role-declared.d.ts.map +1 -1
- package/dist/rules/declarations-role-declared.js +4 -68
- package/dist/rules/declarations-role-declared.js.map +1 -1
- package/dist/rules/naming-business-name.d.ts +6 -0
- package/dist/rules/naming-business-name.d.ts.map +1 -0
- package/dist/rules/naming-business-name.js +175 -0
- package/dist/rules/naming-business-name.js.map +1 -0
- package/dist/rules/rules.d.ts.map +1 -1
- package/dist/rules/rules.js +2 -0
- package/dist/rules/rules.js.map +1 -1
- package/dist/support/business-names/binding-advice.d.ts +4 -0
- package/dist/support/business-names/binding-advice.d.ts.map +1 -0
- package/dist/support/business-names/binding-advice.js +12 -0
- package/dist/support/business-names/binding-advice.js.map +1 -0
- package/dist/support/business-names/binding-kind.d.ts +3 -0
- package/dist/support/business-names/binding-kind.d.ts.map +1 -0
- package/dist/support/business-names/binding-kind.js +2 -0
- package/dist/support/business-names/binding-kind.js.map +1 -0
- package/dist/support/business-names/built-class.d.ts +9 -0
- package/dist/support/business-names/built-class.d.ts.map +1 -0
- package/dist/support/business-names/built-class.js +37 -0
- package/dist/support/business-names/built-class.js.map +1 -0
- package/dist/support/business-names/called-member.d.ts +8 -0
- package/dist/support/business-names/called-member.d.ts.map +1 -0
- package/dist/support/business-names/called-member.js +10 -0
- package/dist/support/business-names/called-member.js.map +1 -0
- package/dist/support/business-names/camel.d.ts +3 -0
- package/dist/support/business-names/camel.d.ts.map +1 -0
- package/dist/support/business-names/camel.js +5 -0
- package/dist/support/business-names/camel.js.map +1 -0
- package/dist/support/business-names/collection-element.d.ts +4 -0
- package/dist/support/business-names/collection-element.d.ts.map +1 -0
- package/dist/support/business-names/collection-element.js +12 -0
- package/dist/support/business-names/collection-element.js.map +1 -0
- package/dist/support/business-names/conventional-model-name.d.ts +9 -0
- package/dist/support/business-names/conventional-model-name.d.ts.map +1 -0
- package/dist/support/business-names/conventional-model-name.js +22 -0
- package/dist/support/business-names/conventional-model-name.js.map +1 -0
- package/dist/support/business-names/generic-words.d.ts +6 -0
- package/dist/support/business-names/generic-words.d.ts.map +1 -0
- package/dist/support/business-names/generic-words.js +25 -0
- package/dist/support/business-names/generic-words.js.map +1 -0
- package/dist/support/business-names/is-name-free.d.ts +10 -0
- package/dist/support/business-names/is-name-free.d.ts.map +1 -0
- package/dist/support/business-names/is-name-free.js +26 -0
- package/dist/support/business-names/is-name-free.js.map +1 -0
- package/dist/support/business-names/judges-names.d.ts +7 -0
- package/dist/support/business-names/judges-names.d.ts.map +1 -0
- package/dist/support/business-names/judges-names.js +14 -0
- package/dist/support/business-names/judges-names.js.map +1 -0
- package/dist/support/business-names/pattern-identifiers.d.ts +4 -0
- package/dist/support/business-names/pattern-identifiers.d.ts.map +1 -0
- package/dist/support/business-names/pattern-identifiers.js +21 -0
- package/dist/support/business-names/pattern-identifiers.js.map +1 -0
- package/dist/support/business-names/plural.d.ts +3 -0
- package/dist/support/business-names/plural.d.ts.map +1 -0
- package/dist/support/business-names/plural.js +8 -0
- package/dist/support/business-names/plural.js.map +1 -0
- package/dist/support/business-names/proposed-name.d.ts +6 -0
- package/dist/support/business-names/proposed-name.d.ts.map +1 -0
- package/dist/support/business-names/proposed-name.js +2 -0
- package/dist/support/business-names/proposed-name.js.map +1 -0
- package/dist/support/business-names/rename-fix.d.ts +8 -0
- package/dist/support/business-names/rename-fix.d.ts.map +1 -0
- package/dist/support/business-names/rename-fix.js +26 -0
- package/dist/support/business-names/rename-fix.js.map +1 -0
- package/dist/support/business-names/repository-concept.d.ts +4 -0
- package/dist/support/business-names/repository-concept.d.ts.map +1 -0
- package/dist/support/business-names/repository-concept.js +10 -0
- package/dist/support/business-names/repository-concept.js.map +1 -0
- package/dist/support/business-names/singular.d.ts +3 -0
- package/dist/support/business-names/singular.d.ts.map +1 -0
- package/dist/support/business-names/singular.js +11 -0
- package/dist/support/business-names/singular.js.map +1 -0
- package/dist/support/business-names/typed-names.d.ts +13 -0
- package/dist/support/business-names/typed-names.d.ts.map +1 -0
- package/dist/support/business-names/typed-names.js +53 -0
- package/dist/support/business-names/typed-names.js.map +1 -0
- package/dist/support/business-names/words-of.d.ts +9 -0
- package/dist/support/business-names/words-of.d.ts.map +1 -0
- package/dist/support/business-names/words-of.js +8 -0
- package/dist/support/business-names/words-of.js.map +1 -0
- package/dist/support/declarations/written-names.d.ts +1 -1
- package/dist/support/declarations/written-names.d.ts.map +1 -1
- package/dist/support/declarations/written-names.js +1 -2
- package/dist/support/declarations/written-names.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/rules/authz-declared.fr.md +2 -2
- package/docs/rules/authz-declared.md +1 -1
- package/docs/rules/context-extractable.fr.md +9 -5
- package/docs/rules/context-extractable.md +8 -4
- package/docs/rules/declarations-role-declared.fr.md +3 -11
- package/docs/rules/declarations-role-declared.md +2 -10
- package/docs/rules/domain-events-dispatched-on-save.fr.md +3 -3
- package/docs/rules/domain-events-dispatched-on-save.md +2 -2
- package/docs/rules/domain-events-transactional-before-commit.fr.md +24 -10
- package/docs/rules/domain-events-transactional-before-commit.md +23 -9
- package/docs/rules/events-consumer-idempotent.fr.md +9 -5
- package/docs/rules/events-consumer-idempotent.md +8 -4
- package/docs/rules/events-name-format.fr.md +2 -2
- package/docs/rules/events-name-format.md +1 -1
- package/docs/rules/layer-application-inward.fr.md +9 -3
- package/docs/rules/layer-application-inward.md +8 -2
- package/docs/rules/naming-business-name.fr.md +82 -0
- package/docs/rules/naming-business-name.md +81 -0
- package/docs/rules/ports-implements-never-extends.fr.md +9 -5
- package/docs/rules/ports-implements-never-extends.md +8 -4
- package/docs/rules/ports-no-concrete-dependency.fr.md +15 -5
- package/docs/rules/ports-no-concrete-dependency.md +14 -4
- package/docs/rules/ports-value-import.fr.md +5 -5
- package/docs/rules/ports-value-import.md +4 -4
- package/docs/rules/scheduling-job-name.fr.md +7 -3
- package/docs/rules/scheduling-job-name.md +6 -2
- package/docs/rules/scheduling-job-triggers-use-case.fr.md +8 -3
- package/docs/rules/scheduling-job-triggers-use-case.md +7 -2
- package/package.json +13 -9
package/dist/rules/rules.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rules.js","sourceRoot":"","sources":["../../src/rules/rules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAgB,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAC9F,OAAO,EAAE,uBAAuB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACrD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC3E,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,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ChB,gBAAgB;IAChB,2BAA2B;IAC3B,+BAA+B;IAC/B,0BAA0B;IAC1B,6BAA6B;CAC9B,CAAC;AAEF,+HAA+H;AAC/H,MAAM,CAAC,MAAM,KAAK,GAAsC,MAAM,CAAC,WAAW,CACxE,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAC7C,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { BindingKind } from './binding-kind.js';
|
|
2
|
+
/** What the message asks for: the name the code already gives to the concept, or how to find one. */
|
|
3
|
+
export declare function bindingAdvice(kind: BindingKind, suggestion: string | undefined): string;
|
|
4
|
+
//# sourceMappingURL=binding-advice.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding-advice.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/binding-advice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAErD,qGAAqG;AACrG,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAUvF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** What the message asks for: the name the code already gives to the concept, or how to find one. */
|
|
2
|
+
export function bindingAdvice(kind, suggestion) {
|
|
3
|
+
if (kind === 'loop variable') {
|
|
4
|
+
return suggestion === undefined
|
|
5
|
+
? 'Name it after one element of the collection, in the singular (`for (const reminder of dueReminders)`).'
|
|
6
|
+
: `Name it after one element of the collection, in the singular: \`${suggestion}\`.`;
|
|
7
|
+
}
|
|
8
|
+
return suggestion === undefined
|
|
9
|
+
? 'Name it after the concept it holds, a term of the glossary of the context (CONTEXT.md).'
|
|
10
|
+
: `Name it \`${suggestion}\`, the name the code already gives to what it holds.`;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=binding-advice.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding-advice.js","sourceRoot":"","sources":["../../../src/support/business-names/binding-advice.ts"],"names":[],"mappings":"AAEA,qGAAqG;AACrG,MAAM,UAAU,aAAa,CAAC,IAAiB,EAAE,UAA8B;IAC7E,IAAI,IAAI,KAAK,eAAe,EAAE,CAAC;QAC7B,OAAO,UAAU,KAAK,SAAS;YAC7B,CAAC,CAAC,wGAAwG;YAC1G,CAAC,CAAC,mEAAmE,UAAU,KAAK,CAAC;IACzF,CAAC;IAED,OAAO,UAAU,KAAK,SAAS;QAC7B,CAAC,CAAC,yFAAyF;QAC3F,CAAC,CAAC,aAAa,UAAU,uDAAuD,CAAC;AACrF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding-kind.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/binding-kind.ts"],"names":[],"mappings":"AAAA,uFAAuF;AACvF,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,eAAe,GAAG,sBAAsB,GAAG,WAAW,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding-kind.js","sourceRoot":"","sources":["../../../src/support/business-names/binding-kind.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TSESLint, type TSESTree } from '@typescript-eslint/utils';
|
|
2
|
+
import type { LintedFile } from '../../project/linted-file.js';
|
|
3
|
+
/**
|
|
4
|
+
* The class of the project an initializer builds, `X.create(..)` or `new X(..)`: a class of the
|
|
5
|
+
* file, or one imported from the project. A class of a package or of the language (`new Map()`)
|
|
6
|
+
* says nothing of the business.
|
|
7
|
+
*/
|
|
8
|
+
export declare function builtClass(sourceCode: Readonly<TSESLint.SourceCode>, file: LintedFile, init: TSESTree.Expression): string | undefined;
|
|
9
|
+
//# sourceMappingURL=built-class.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"built-class.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/built-class.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4B,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAC7F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAI/D;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,UAAU,EAAE,QAAQ,CAAC,QAAQ,CAAC,UAAU,CAAC,EACzC,IAAI,EAAE,UAAU,EAChB,IAAI,EAAE,QAAQ,CAAC,UAAU,GACxB,MAAM,GAAG,SAAS,CAmBpB"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { ASTUtils, AST_NODE_TYPES, TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
const PASCAL = /^[A-Z][A-Za-z\d]*$/;
|
|
3
|
+
/**
|
|
4
|
+
* The class of the project an initializer builds, `X.create(..)` or `new X(..)`: a class of the
|
|
5
|
+
* file, or one imported from the project. A class of a package or of the language (`new Map()`)
|
|
6
|
+
* says nothing of the business.
|
|
7
|
+
*/
|
|
8
|
+
export function builtClass(sourceCode, file, init) {
|
|
9
|
+
const callee = builtCallee(init);
|
|
10
|
+
if (callee === undefined || !PASCAL.test(callee.name)) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
const definition = ASTUtils.findVariable(sourceCode.getScope(callee), callee.name)?.defs[0];
|
|
14
|
+
if (definition?.type === TSESLint.Scope.DefinitionType.ClassName) {
|
|
15
|
+
return callee.name;
|
|
16
|
+
}
|
|
17
|
+
const imported = definition?.type === TSESLint.Scope.DefinitionType.ImportBinding &&
|
|
18
|
+
definition.parent.type === AST_NODE_TYPES.ImportDeclaration &&
|
|
19
|
+
isProjectSpecifier(file, definition.parent.source.value);
|
|
20
|
+
return imported ? callee.name : undefined;
|
|
21
|
+
}
|
|
22
|
+
function builtCallee(init) {
|
|
23
|
+
const value = init.type === AST_NODE_TYPES.AwaitExpression ? init.argument : init;
|
|
24
|
+
if (value.type === AST_NODE_TYPES.NewExpression) {
|
|
25
|
+
return value.callee.type === AST_NODE_TYPES.Identifier ? value.callee : undefined;
|
|
26
|
+
}
|
|
27
|
+
if (value.type !== AST_NODE_TYPES.CallExpression || value.callee.type !== AST_NODE_TYPES.MemberExpression) {
|
|
28
|
+
return undefined;
|
|
29
|
+
}
|
|
30
|
+
const { object, property } = value.callee;
|
|
31
|
+
const creates = !value.callee.computed && property.type === AST_NODE_TYPES.Identifier && property.name === 'create';
|
|
32
|
+
return creates && object.type === AST_NODE_TYPES.Identifier ? object : undefined;
|
|
33
|
+
}
|
|
34
|
+
function isProjectSpecifier(file, specifier) {
|
|
35
|
+
return specifier.startsWith('.') || specifier.startsWith(file.config.importAlias);
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=built-class.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"built-class.js","sourceRoot":"","sources":["../../../src/support/business-names/built-class.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,QAAQ,EAAiB,MAAM,0BAA0B,CAAC;AAG7F,MAAM,MAAM,GAAG,oBAAoB,CAAC;AAEpC;;;;GAIG;AACH,MAAM,UAAU,UAAU,CACxB,UAAyC,EACzC,IAAgB,EAChB,IAAyB;IAEzB,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IAEjC,IAAI,MAAM,KAAK,SAAS,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;QACtD,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,UAAU,GAAG,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAE5F,IAAI,UAAU,EAAE,IAAI,KAAK,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,IAAI,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;AACnF,CAAC;AAED,SAAS,kBAAkB,CAAC,IAAgB,EAAE,SAAiB;IAC7D,OAAO,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;AACpF,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type TSESTree } from '@typescript-eslint/utils';
|
|
2
|
+
/** The object and the method of `object.method(..)`, awaited or not. */
|
|
3
|
+
export interface CalledMember {
|
|
4
|
+
readonly object: TSESTree.Expression;
|
|
5
|
+
readonly method: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function calledMember(init: TSESTree.Expression): CalledMember | undefined;
|
|
8
|
+
//# sourceMappingURL=called-member.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"called-member.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/called-member.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzE,wEAAwE;AACxE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,UAAU,GAAG,YAAY,GAAG,SAAS,CAUhF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
export function calledMember(init) {
|
|
3
|
+
const value = init.type === AST_NODE_TYPES.AwaitExpression ? init.argument : init;
|
|
4
|
+
if (value.type !== AST_NODE_TYPES.CallExpression || value.callee.type !== AST_NODE_TYPES.MemberExpression) {
|
|
5
|
+
return undefined;
|
|
6
|
+
}
|
|
7
|
+
const { object, property, computed } = value.callee;
|
|
8
|
+
return computed || property.type !== AST_NODE_TYPES.Identifier ? undefined : { object, method: property.name };
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=called-member.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"called-member.js","sourceRoot":"","sources":["../../../src/support/business-names/called-member.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AAQzE,MAAM,UAAU,YAAY,CAAC,IAAyB;IACpD,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,KAAK,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC;IAElF,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,CAAC,cAAc,IAAI,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,gBAAgB,EAAE,CAAC;QAC1G,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC;IAEpD,OAAO,QAAQ,IAAI,QAAQ,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,EAAE,CAAC;AACjH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camel.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/camel.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,wBAAgB,KAAK,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAE5C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"camel.js","sourceRoot":"","sources":["../../../src/support/business-names/camel.ts"],"names":[],"mappings":"AAAA,2FAA2F;AAC3F,MAAM,UAAU,KAAK,CAAC,MAAc;IAClC,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAC1D,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type TSESTree } from '@typescript-eslint/utils';
|
|
2
|
+
/** The singular of the last word of a collection named after a concept: `reminder` for `dueReminders` or `this.reminders`. */
|
|
3
|
+
export declare function collectionElement(collection: TSESTree.Expression): string | undefined;
|
|
4
|
+
//# sourceMappingURL=collection-element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-element.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/collection-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzE,8HAA8H;AAC9H,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,QAAQ,CAAC,UAAU,GAAG,MAAM,GAAG,SAAS,CAQrF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
import { splitWords } from '../words/split-words.js';
|
|
3
|
+
import { singular } from './singular.js';
|
|
4
|
+
/** The singular of the last word of a collection named after a concept: `reminder` for `dueReminders` or `this.reminders`. */
|
|
5
|
+
export function collectionElement(collection) {
|
|
6
|
+
const named = collection.type === AST_NODE_TYPES.MemberExpression ? collection.property : collection;
|
|
7
|
+
if (named.type !== AST_NODE_TYPES.Identifier) {
|
|
8
|
+
return undefined;
|
|
9
|
+
}
|
|
10
|
+
return singular(splitWords(named.name).at(-1) ?? '');
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=collection-element.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"collection-element.js","sourceRoot":"","sources":["../../../src/support/business-names/collection-element.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AACzE,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,8HAA8H;AAC9H,MAAM,UAAU,iBAAiB,CAAC,UAA+B;IAC/D,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,KAAK,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAU,CAAC;IAErG,IAAI,KAAK,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU,EAAE,CAAC;QAC7C,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,OAAO,QAAQ,CAAC,UAAU,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CalledMember } from './called-member.js';
|
|
2
|
+
import type { ProposedName } from './proposed-name.js';
|
|
3
|
+
/**
|
|
4
|
+
* Without type information, what a call on a repository answers by the convention of its names:
|
|
5
|
+
* the concept of `appointmentRepository`, one of it for a read of one element, several for a
|
|
6
|
+
* read that names what it selects. Undefined when the names say neither.
|
|
7
|
+
*/
|
|
8
|
+
export declare function conventionalModelName(call: CalledMember, several: boolean): ProposedName | undefined;
|
|
9
|
+
//# sourceMappingURL=conventional-model-name.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conventional-model-name.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/conventional-model-name.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AASvD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,YAAY,GAAG,SAAS,CAYpG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { repositoryConcept } from './repository-concept.js';
|
|
2
|
+
/** A read of one element: `findById`, `get`, `load`, `findOne`, `requireById`. */
|
|
3
|
+
const ONE = /^(?:find|get|load|require)(?:One)?(?:ById)?$/;
|
|
4
|
+
/** A read of several elements by the name of its method: `findDue`, `findAll`, `getByPractice`. */
|
|
5
|
+
const MANY = /^(?:find|get|load)[A-Z]/;
|
|
6
|
+
const OF_ONE = /(?:ById|One)$/;
|
|
7
|
+
/**
|
|
8
|
+
* Without type information, what a call on a repository answers by the convention of its names:
|
|
9
|
+
* the concept of `appointmentRepository`, one of it for a read of one element, several for a
|
|
10
|
+
* read that names what it selects. Undefined when the names say neither.
|
|
11
|
+
*/
|
|
12
|
+
export function conventionalModelName(call, several) {
|
|
13
|
+
const concept = repositoryConcept(call.object);
|
|
14
|
+
if (concept === undefined) {
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
if (!several) {
|
|
18
|
+
return ONE.test(call.method) ? { element: concept, many: false } : undefined;
|
|
19
|
+
}
|
|
20
|
+
return MANY.test(call.method) && !OF_ONE.test(call.method) ? { element: concept, many: true } : undefined;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=conventional-model-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conventional-model-name.js","sourceRoot":"","sources":["../../../src/support/business-names/conventional-model-name.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,kFAAkF;AAClF,MAAM,GAAG,GAAG,8CAA8C,CAAC;AAC3D,mGAAmG;AACnG,MAAM,IAAI,GAAG,yBAAyB,CAAC;AACvC,MAAM,MAAM,GAAG,eAAe,CAAC;AAE/B;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAkB,EAAE,OAAgB;IACxE,MAAM,OAAO,GAAG,iBAAiB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAE/C,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/E,CAAC;IAED,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC;AAC5G,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Words that say a value is there without saying which concept it is. `naming/business-name`
|
|
3
|
+
* reports a binding named by one of them where the model speaks; the same list as the checker.
|
|
4
|
+
*/
|
|
5
|
+
export declare const GENERIC_WORDS: readonly string[];
|
|
6
|
+
//# sourceMappingURL=generic-words.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generic-words.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/generic-words.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,MAAM,EAmB1C,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Words that say a value is there without saying which concept it is. `naming/business-name`
|
|
3
|
+
* reports a binding named by one of them where the model speaks; the same list as the checker.
|
|
4
|
+
*/
|
|
5
|
+
export const GENERIC_WORDS = [
|
|
6
|
+
'target',
|
|
7
|
+
'targets',
|
|
8
|
+
'data',
|
|
9
|
+
'item',
|
|
10
|
+
'items',
|
|
11
|
+
'obj',
|
|
12
|
+
'object',
|
|
13
|
+
'thing',
|
|
14
|
+
'things',
|
|
15
|
+
'stuff',
|
|
16
|
+
'info',
|
|
17
|
+
'element',
|
|
18
|
+
'el',
|
|
19
|
+
'tmp',
|
|
20
|
+
'temp',
|
|
21
|
+
'foo',
|
|
22
|
+
'bar',
|
|
23
|
+
'baz',
|
|
24
|
+
];
|
|
25
|
+
//# sourceMappingURL=generic-words.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generic-words.js","sourceRoot":"","sources":["../../../src/support/business-names/generic-words.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,aAAa,GAAsB;IAC9C,QAAQ;IACR,SAAS;IACT,MAAM;IACN,MAAM;IACN,OAAO;IACP,KAAK;IACL,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,OAAO;IACP,MAAM;IACN,SAAS;IACT,IAAI;IACJ,KAAK;IACL,MAAM;IACN,KAAK;IACL,KAAK;IACL,KAAK;CACN,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
type Variable = TSESLint.Scope.Variable;
|
|
3
|
+
/**
|
|
4
|
+
* Whether `variable` can be renamed `name` without changing what any name of the code means:
|
|
5
|
+
* no other variable of that name in its scope, none between a use and its declaration, and no
|
|
6
|
+
* use of that name inside its scope that reaches another variable or a global.
|
|
7
|
+
*/
|
|
8
|
+
export declare function isNameFree(variable: Variable, name: string): boolean;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=is-name-free.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-name-free.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/is-name-free.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGzD,KAAK,QAAQ,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC;AAExC;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,QAAQ,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAUpE"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether `variable` can be renamed `name` without changing what any name of the code means:
|
|
3
|
+
* no other variable of that name in its scope, none between a use and its declaration, and no
|
|
4
|
+
* use of that name inside its scope that reaches another variable or a global.
|
|
5
|
+
*/
|
|
6
|
+
export function isNameFree(variable, name) {
|
|
7
|
+
const { scope } = variable;
|
|
8
|
+
if (scope.set.has(name)) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
const shadowed = variable.references.some((reference) => declaresBetween(reference.from, scope, name));
|
|
12
|
+
return !shadowed && !usedInside(scope, name);
|
|
13
|
+
}
|
|
14
|
+
function declaresBetween(from, declaring, name) {
|
|
15
|
+
for (let current = from; current !== null && current !== declaring; current = current.upper) {
|
|
16
|
+
if (current.set.has(name)) {
|
|
17
|
+
return true;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
function usedInside(scope, name) {
|
|
23
|
+
return (scope.references.some((reference) => reference.identifier.name === name) ||
|
|
24
|
+
scope.childScopes.some((child) => usedInside(child, name)));
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=is-name-free.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-name-free.js","sourceRoot":"","sources":["../../../src/support/business-names/is-name-free.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,QAAkB,EAAE,IAAY;IACzD,MAAM,EAAE,KAAK,EAAE,GAAG,QAAQ,CAAC;IAE3B,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;QACxB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,QAAQ,GAAG,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;IAEvG,OAAO,CAAC,QAAQ,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;AAC/C,CAAC;AAED,SAAS,eAAe,CAAC,IAAW,EAAE,SAAgB,EAAE,IAAY;IAClE,KAAK,IAAI,OAAO,GAAiB,IAAI,EAAE,OAAO,KAAK,IAAI,IAAI,OAAO,KAAK,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;QAC1G,IAAI,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YAC1B,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,UAAU,CAAC,KAAY,EAAE,IAAY;IAC5C,OAAO,CACL,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,IAAI,KAAK,IAAI,CAAC;QACxE,KAAK,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAC3D,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { LintedFile } from '../../project/linted-file.js';
|
|
2
|
+
/**
|
|
3
|
+
* Where the language of the model lives: `domain/` and `application/` of a context, and the
|
|
4
|
+
* shared kernel outside its `presentation/`. Specs are not judged. Same table as the checker.
|
|
5
|
+
*/
|
|
6
|
+
export declare function judgesNames(file: LintedFile): boolean;
|
|
7
|
+
//# sourceMappingURL=judges-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"judges-names.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/judges-names.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAE/D;;;GAGG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAYrD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the language of the model lives: `domain/` and `application/` of a context, and the
|
|
3
|
+
* shared kernel outside its `presentation/`. Specs are not judged. Same table as the checker.
|
|
4
|
+
*/
|
|
5
|
+
export function judgesNames(file) {
|
|
6
|
+
if (file.isTest) {
|
|
7
|
+
return false;
|
|
8
|
+
}
|
|
9
|
+
if (file.location.area === 'context') {
|
|
10
|
+
return file.location.layer === 'domain' || file.location.layer === 'application';
|
|
11
|
+
}
|
|
12
|
+
return (file.location.area === 'shared-kernel' && !file.path.startsWith(`${file.config.sharedKernelDir}/presentation/`));
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=judges-names.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"judges-names.js","sourceRoot":"","sources":["../../../src/support/business-names/judges-names.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,IAAgB;IAC1C,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAChB,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC,QAAQ,CAAC,KAAK,KAAK,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,KAAK,KAAK,aAAa,CAAC;IACnF,CAAC;IAED,OAAO,CACL,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,eAAe,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,gBAAgB,CAAC,CAChH,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type TSESTree } from '@typescript-eslint/utils';
|
|
2
|
+
/** The names a binding target declares: itself, or every name of a destructuring at any depth, defaults and rests included. */
|
|
3
|
+
export declare function patternIdentifiers(target: TSESTree.Node): TSESTree.Identifier[];
|
|
4
|
+
//# sourceMappingURL=pattern-identifiers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern-identifiers.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/pattern-identifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAEzE,+HAA+H;AAC/H,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,QAAQ,CAAC,IAAI,GAAG,QAAQ,CAAC,UAAU,EAAE,CAmB/E"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
/** The names a binding target declares: itself, or every name of a destructuring at any depth, defaults and rests included. */
|
|
3
|
+
export function patternIdentifiers(target) {
|
|
4
|
+
switch (target.type) {
|
|
5
|
+
case AST_NODE_TYPES.Identifier:
|
|
6
|
+
return [target];
|
|
7
|
+
case AST_NODE_TYPES.AssignmentPattern:
|
|
8
|
+
return patternIdentifiers(target.left);
|
|
9
|
+
case AST_NODE_TYPES.RestElement:
|
|
10
|
+
return patternIdentifiers(target.argument);
|
|
11
|
+
case AST_NODE_TYPES.ArrayPattern:
|
|
12
|
+
return target.elements.flatMap((element) => (element === null ? [] : patternIdentifiers(element)));
|
|
13
|
+
case AST_NODE_TYPES.ObjectPattern:
|
|
14
|
+
return target.properties.flatMap((property) => patternIdentifiers(property.type === AST_NODE_TYPES.Property ? property.value : property));
|
|
15
|
+
case AST_NODE_TYPES.TSParameterProperty:
|
|
16
|
+
return patternIdentifiers(target.parameter);
|
|
17
|
+
default:
|
|
18
|
+
return [];
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=pattern-identifiers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern-identifiers.js","sourceRoot":"","sources":["../../../src/support/business-names/pattern-identifiers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AAEzE,+HAA+H;AAC/H,MAAM,UAAU,kBAAkB,CAAC,MAAqB;IACtD,QAAQ,MAAM,CAAC,IAAI,EAAE,CAAC;QACpB,KAAK,cAAc,CAAC,UAAU;YAC5B,OAAO,CAAC,MAAM,CAAC,CAAC;QAClB,KAAK,cAAc,CAAC,iBAAiB;YACnC,OAAO,kBAAkB,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QACzC,KAAK,cAAc,CAAC,WAAW;YAC7B,OAAO,kBAAkB,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QAC7C,KAAK,cAAc,CAAC,YAAY;YAC9B,OAAO,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,OAAO,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,kBAAkB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;QACrG,KAAK,cAAc,CAAC,aAAa;YAC/B,OAAO,MAAM,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC,QAAQ,EAAE,EAAE,CAC5C,kBAAkB,CAAC,QAAQ,CAAC,IAAI,KAAK,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,CAC1F,CAAC;QACJ,KAAK,cAAc,CAAC,mBAAmB;YACrC,OAAO,kBAAkB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAC9C;YACE,OAAO,EAAE,CAAC;IACd,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plural.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/plural.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,wBAAgB,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAM3C"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** The plural of an English word, as the generator writes it. */
|
|
2
|
+
export function plural(word) {
|
|
3
|
+
if (/[^aeiou]y$/.test(word)) {
|
|
4
|
+
return `${word.slice(0, -1)}ies`;
|
|
5
|
+
}
|
|
6
|
+
return /(?:s|x|z|ch|sh)$/.test(word) ? `${word}es` : `${word}s`;
|
|
7
|
+
}
|
|
8
|
+
//# sourceMappingURL=plural.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plural.js","sourceRoot":"","sources":["../../../src/support/business-names/plural.ts"],"names":[],"mappings":"AAAA,iEAAiE;AACjE,MAAM,UAAU,MAAM,CAAC,IAAY;IACjC,IAAI,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;IACnC,CAAC;IAED,OAAO,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,CAAC;AAClE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proposed-name.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/proposed-name.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proposed-name.js","sourceRoot":"","sources":["../../../src/support/business-names/proposed-name.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type TSESLint } from '@typescript-eslint/utils';
|
|
2
|
+
/**
|
|
3
|
+
* Renames a variable where it is declared and wherever it is used, its type annotation kept. A
|
|
4
|
+
* shorthand property keeps its key (`{ target }` becomes `{ target: appointment }`). Undefined
|
|
5
|
+
* for an exported variable, whose name other files read.
|
|
6
|
+
*/
|
|
7
|
+
export declare function renameFix(variable: TSESLint.Scope.Variable, name: string): TSESLint.ReportFixFunction | undefined;
|
|
8
|
+
//# sourceMappingURL=rename-fix.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rename-fix.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/rename-fix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAiB,MAAM,0BAA0B,CAAC;AAExF;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,MAAM,GAAG,QAAQ,CAAC,iBAAiB,GAAG,SAAS,CAYjH"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
/**
|
|
3
|
+
* Renames a variable where it is declared and wherever it is used, its type annotation kept. A
|
|
4
|
+
* shorthand property keeps its key (`{ target }` becomes `{ target: appointment }`). Undefined
|
|
5
|
+
* for an exported variable, whose name other files read.
|
|
6
|
+
*/
|
|
7
|
+
export function renameFix(variable, name) {
|
|
8
|
+
const uses = variable.references.map((reference) => reference.identifier);
|
|
9
|
+
if (uses.some((identifier) => identifier.parent.type === AST_NODE_TYPES.ExportSpecifier) || isExported(variable)) {
|
|
10
|
+
return undefined;
|
|
11
|
+
}
|
|
12
|
+
const identifiers = [...variable.identifiers, ...uses].filter((identifier, index, all) => all.findIndex((other) => other.range[0] === identifier.range[0]) === index);
|
|
13
|
+
return (fixer) => identifiers.map((identifier) => renamed(fixer, identifier, name));
|
|
14
|
+
}
|
|
15
|
+
function renamed(fixer, identifier, name) {
|
|
16
|
+
const { parent } = identifier;
|
|
17
|
+
const own = identifier.name;
|
|
18
|
+
if (parent.type === AST_NODE_TYPES.Property && parent.shorthand && parent.value === identifier) {
|
|
19
|
+
return fixer.replaceText(parent, `${own}: ${name}`);
|
|
20
|
+
}
|
|
21
|
+
return fixer.replaceTextRange([identifier.range[0], identifier.range[0] + own.length], name);
|
|
22
|
+
}
|
|
23
|
+
function isExported(variable) {
|
|
24
|
+
return variable.defs.some((definition) => definition.parent?.parent.type === AST_NODE_TYPES.ExportNamedDeclaration);
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=rename-fix.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rename-fix.js","sourceRoot":"","sources":["../../../src/support/business-names/rename-fix.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAgC,MAAM,0BAA0B,CAAC;AAExF;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,QAAiC,EAAE,IAAY;IACvE,MAAM,IAAI,GAAG,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC;IAE1E,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,eAAe,CAAC,IAAI,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;QACjH,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,WAAW,GAAG,CAAC,GAAG,QAAQ,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,CAAC,MAAM,CAC3D,CAAC,UAAU,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,KAAK,CACvG,CAAC;IAEF,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,OAAO,CAAC,KAAK,EAAE,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC;AACtF,CAAC;AAED,SAAS,OAAO,CACd,KAAyB,EACzB,UAAwD,EACxD,IAAY;IAEZ,MAAM,EAAE,MAAM,EAAE,GAAG,UAAU,CAAC;IAC9B,MAAM,GAAG,GAAG,UAAU,CAAC,IAAI,CAAC;IAE5B,IAAI,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,QAAQ,IAAI,MAAM,CAAC,SAAS,IAAI,MAAM,CAAC,KAAK,KAAK,UAAU,EAAE,CAAC;QAC/F,OAAO,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,GAAG,GAAG,KAAK,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;IAED,OAAO,KAAK,CAAC,gBAAgB,CAAC,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,CAAC,CAAC;AAC/F,CAAC;AAED,SAAS,UAAU,CAAC,QAAiC;IACnD,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,sBAAsB,CAAC,CAAC;AACtH,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { type TSESTree } from '@typescript-eslint/utils';
|
|
2
|
+
/** `appointment` for `this.appointmentRepository` or `appointmentRepository`: a repository named by the convention of the kit. */
|
|
3
|
+
export declare function repositoryConcept(object: TSESTree.Expression): string | undefined;
|
|
4
|
+
//# sourceMappingURL=repository-concept.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository-concept.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/repository-concept.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAIzE,kIAAkI;AAClI,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,QAAQ,CAAC,UAAU,GAAG,MAAM,GAAG,SAAS,CAOjF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AST_NODE_TYPES } from '@typescript-eslint/utils';
|
|
2
|
+
const REPOSITORY = /^([a-z][\w$]*)Repository$/;
|
|
3
|
+
/** `appointment` for `this.appointmentRepository` or `appointmentRepository`: a repository named by the convention of the kit. */
|
|
4
|
+
export function repositoryConcept(object) {
|
|
5
|
+
const holder = object.type === AST_NODE_TYPES.MemberExpression && object.object.type === AST_NODE_TYPES.ThisExpression
|
|
6
|
+
? object.property
|
|
7
|
+
: object;
|
|
8
|
+
return holder.type === AST_NODE_TYPES.Identifier ? REPOSITORY.exec(holder.name)?.[1] : undefined;
|
|
9
|
+
}
|
|
10
|
+
//# sourceMappingURL=repository-concept.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"repository-concept.js","sourceRoot":"","sources":["../../../src/support/business-names/repository-concept.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAiB,MAAM,0BAA0B,CAAC;AAEzE,MAAM,UAAU,GAAG,2BAA2B,CAAC;AAE/C,kIAAkI;AAClI,MAAM,UAAU,iBAAiB,CAAC,MAA2B;IAC3D,MAAM,MAAM,GACV,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,gBAAgB,IAAI,MAAM,CAAC,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,cAAc;QACrG,CAAC,CAAC,MAAM,CAAC,QAAQ;QACjB,CAAC,CAAC,MAAM,CAAC;IAEb,OAAO,MAAM,CAAC,IAAI,KAAK,cAAc,CAAC,UAAU,CAAC,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACnG,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singular.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/singular.ts"],"names":[],"mappings":"AAAA,6HAA6H;AAC7H,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAUzD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** The singular of a plural English word (`reminders`, `deliveries`, `boxes`), or undefined when it does not read as one. */
|
|
2
|
+
export function singular(word) {
|
|
3
|
+
if (/[^aeiou]ies$/.test(word)) {
|
|
4
|
+
return `${word.slice(0, -3)}y`;
|
|
5
|
+
}
|
|
6
|
+
if (/(?:ss|x|z|ch|sh)es$/.test(word)) {
|
|
7
|
+
return word.slice(0, -2);
|
|
8
|
+
}
|
|
9
|
+
return /[^su]s$/.test(word) ? word.slice(0, -1) : undefined;
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=singular.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"singular.js","sourceRoot":"","sources":["../../../src/support/business-names/singular.ts"],"names":[],"mappings":"AAAA,6HAA6H;AAC7H,MAAM,UAAU,QAAQ,CAAC,IAAY;IACnC,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAC9B,OAAO,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;IACjC,CAAC;IAED,IAAI,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACrC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC3B,CAAC;IAED,OAAO,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC9D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type TSESLint, type TSESTree } from '@typescript-eslint/utils';
|
|
2
|
+
import type { LintedFile } from '../../project/linted-file.js';
|
|
3
|
+
import type { ProposedName } from './proposed-name.js';
|
|
4
|
+
/** What the type checker tells of the project: which concept of the model an expression holds, and whether it is a repository. */
|
|
5
|
+
export interface TypedNames {
|
|
6
|
+
/** An aggregate, an entity or a value object of the project, or a list of them, once awaited and without `undefined`. */
|
|
7
|
+
modelOf(node: TSESTree.Node): ProposedName | undefined;
|
|
8
|
+
/** An instance of a repository port of `domain/repositories/`. */
|
|
9
|
+
isRepository(node: TSESTree.Node): boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Undefined when the parser was given no program: the rule then reads the names of the code. */
|
|
12
|
+
export declare function typedNames(context: Readonly<TSESLint.RuleContext<string, readonly unknown[]>>, file: LintedFile): TypedNames | undefined;
|
|
13
|
+
//# sourceMappingURL=typed-names.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"typed-names.d.ts","sourceRoot":"","sources":["../../../src/support/business-names/typed-names.ts"],"names":[],"mappings":"AACA,OAAO,EAAe,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACrF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAI/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAEvD,kIAAkI;AAClI,MAAM,WAAW,UAAU;IACzB,yHAAyH;IACzH,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,YAAY,GAAG,SAAS,CAAC;IACvD,kEAAkE;IAClE,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,GAAG,OAAO,CAAC;CAC5C;AAUD,iGAAiG;AACjG,wBAAgB,UAAU,CACxB,OAAO,EAAE,QAAQ,CAAC,QAAQ,CAAC,WAAW,CAAC,MAAM,EAAE,SAAS,OAAO,EAAE,CAAC,CAAC,EACnE,IAAI,EAAE,UAAU,GACf,UAAU,GAAG,SAAS,CAsCxB"}
|