@darraghor/eslint-plugin-nestjs-typed 3.22.6 → 4.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. package/README.md +46 -35
  2. package/dist/fixtures/example.controller.js +3 -4
  3. package/dist/fixtures/example.module.js +3 -4
  4. package/dist/fixtures/file.js +2 -1
  5. package/dist/fixtures/providerArray.module.js +3 -4
  6. package/dist/rules/allPropertiesAreWhitelisted/allPropertiesAreWhitelisted.js +3 -5
  7. package/dist/rules/allPropertiesHaveExplicitDefined/allPropertiesHaveExplicitDefined.js +6 -8
  8. package/dist/rules/apiEnumPropertyBestPractices/apiEnumPropertyBestPractices.js +1 -2
  9. package/dist/rules/apiMethodsShouldBeGuarded/apiMethodsShouldBeGuarded.js +3 -3
  10. package/dist/rules/apiMethodsShouldSpecifyApiOperation/apiMethodsShouldSpecifyApiOperation.js +1 -2
  11. package/dist/rules/apiMethodsShouldSpecifyApiResponse/apiMethodsShouldSpecifyApiResponse.js +1 -2
  12. package/dist/rules/apiPropertyMatchesPropertyOptionality/apiPropertyMatchesPropertyOptionality.js +1 -2
  13. package/dist/rules/apiPropertyReturningArrayShouldSetArray/apiPropertyReturningArrayShouldSetArray.js +5 -6
  14. package/dist/rules/controllerDecoratedHasApiTags/controllerDecoratedHasApiTags.js +1 -2
  15. package/dist/rules/injectablesShouldBeProvided/injectableShouldBeProvided.js +18 -11
  16. package/dist/rules/paramDecoratorNameMatchesRouteParam/paramDecoratorNameMatchesRouteParam.js +25 -26
  17. package/dist/rules/providerInjectedShouldMatchFactory/ProviderInjectedShouldMatchFactory.js +7 -7
  18. package/dist/rules/shouldSpecifyForbidUnknownValues/shouldSpecifyForbidUnknownValuesRule.js +16 -15
  19. package/dist/rules/sortModuleMetadataArrays/sortModuleMetadataArrays.js +20 -12
  20. package/dist/rules/validateNestedOfArrayShouldSetEach/validateNestedOfArrayShouldSetEach.js +5 -7
  21. package/dist/rules/validateNonPrimitiveNeedsTypeDecorator/validateNonPrimitiveNeedsDecorators.js +15 -10
  22. package/dist/utils/files/fileEnumerationWrapper.js +1 -1
  23. package/dist/utils/files/isFilteredPath.js +2 -2
  24. package/dist/utils/nestModules/nestModuleAstParser.js +6 -12
  25. package/dist/utils/nestModules/nestProvidedInjectableMapper.js +6 -2
  26. package/dist/utils/nestModules/nestProviderAstParser.js +3 -5
  27. package/dist/utils/typedTokenHelpers.js +16 -21
  28. package/package.json +20 -21
  29. package/dist/configs/index.d.ts +0 -44
  30. package/dist/configs/noSwagger.d.ts +0 -15
  31. package/dist/configs/recommended.d.ts +0 -28
  32. package/dist/fixtures/Controller.stub.d.ts +0 -1
  33. package/dist/fixtures/Injectable.stub.d.ts +0 -1
  34. package/dist/fixtures/Module.stub.d.ts +0 -1
  35. package/dist/fixtures/NonFactoryDecorator.stub.d.ts +0 -1
  36. package/dist/fixtures/example.controller.d.ts +0 -2
  37. package/dist/fixtures/example.customprovider.d.ts +0 -5
  38. package/dist/fixtures/example.module.d.ts +0 -2
  39. package/dist/fixtures/example.providedClass.provider.d.ts +0 -3
  40. package/dist/fixtures/example.provider.d.ts +0 -3
  41. package/dist/fixtures/file.d.ts +0 -0
  42. package/dist/fixtures/providerArray.module.d.ts +0 -2
  43. package/dist/index.d.ts +0 -103
  44. package/dist/rules/allPropertiesAreWhitelisted/allPropertiesAreWhitelisted.d.ts +0 -5
  45. package/dist/rules/allPropertiesHaveExplicitDefined/allPropertiesHaveExplicitDefined.d.ts +0 -5
  46. package/dist/rules/apiEnumPropertyBestPractices/apiEnumPropertyBestPractices.d.ts +0 -8
  47. package/dist/rules/apiEnumPropertyBestPractices/enumTestResultModel.d.ts +0 -7
  48. package/dist/rules/apiMethodsShouldBeGuarded/apiMethodsShouldBeGuarded.d.ts +0 -6
  49. package/dist/rules/apiMethodsShouldSpecifyApiOperation/apiMethodsShouldSpecifyApiOperation.d.ts +0 -6
  50. package/dist/rules/apiMethodsShouldSpecifyApiResponse/apiMethodsShouldSpecifyApiResponse.d.ts +0 -6
  51. package/dist/rules/apiPropertyMatchesPropertyOptionality/apiPropertyMatchesPropertyOptionality.d.ts +0 -7
  52. package/dist/rules/apiPropertyReturningArrayShouldSetArray/apiPropertyReturningArrayShouldSetArray.d.ts +0 -7
  53. package/dist/rules/apiPropertyReturningArrayShouldSetArray/arraySetResultModel.d.ts +0 -5
  54. package/dist/rules/controllerDecoratedHasApiTags/controllerDecoratedHasApiTags.d.ts +0 -6
  55. package/dist/rules/index.d.ts +0 -58
  56. package/dist/rules/injectablesShouldBeProvided/injectableShouldBeProvided.d.ts +0 -12
  57. package/dist/rules/paramDecoratorNameMatchesRouteParam/paramDecoratorNameMatchesRouteParam.d.ts +0 -23
  58. package/dist/rules/paramDecoratorNameMatchesRouteParam/rule.testData.d.ts +0 -10
  59. package/dist/rules/providerInjectedShouldMatchFactory/ProviderInjectedShouldMatchFactory.d.ts +0 -6
  60. package/dist/rules/shouldSpecifyForbidUnknownValues/shouldSpecifyForbidUnknownValuesRule.d.ts +0 -10
  61. package/dist/rules/sortModuleMetadataArrays/sortModuleMetadataArrays.d.ts +0 -10
  62. package/dist/rules/validateNestedOfArrayShouldSetEach/arraySetResultModel.d.ts +0 -5
  63. package/dist/rules/validateNestedOfArrayShouldSetEach/validateNestedOfArrayShouldSetEach.d.ts +0 -7
  64. package/dist/rules/validateNonPrimitiveNeedsTypeDecorator/validateNonPrimitiveNeedsDecorators.d.ts +0 -12
  65. package/dist/testing/fixtureSetup.d.ts +0 -1
  66. package/dist/testing/preRun.d.ts +0 -1
  67. package/dist/utils/ast.d.ts +0 -2
  68. package/dist/utils/createRule.d.ts +0 -2
  69. package/dist/utils/files/fileEnumerationWrapper.d.ts +0 -6
  70. package/dist/utils/files/isFilteredPath.d.ts +0 -4
  71. package/dist/utils/nestModules/models/NestProvidedInjectablesMap.d.ts +0 -5
  72. package/dist/utils/nestModules/nestModuleAstParser.d.ts +0 -7
  73. package/dist/utils/nestModules/nestProvidedInjectableMapper.d.ts +0 -12
  74. package/dist/utils/nestModules/nestProvidedInjectableMapper.testData.d.ts +0 -7
  75. package/dist/utils/nestModules/nestProviderAstParser.d.ts +0 -7
  76. package/dist/utils/typedTokenHelpers.d.ts +0 -59
  77. package/dist/utils/wellKnownSelectors.d.ts +0 -1
package/dist/index.d.ts DELETED
@@ -1,103 +0,0 @@
1
- declare const configuration: {
2
- rules: {
3
- "all-properties-have-explicit-defined": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"missing-is-defined-decorator" | "missing-is-optional-decorator" | "conflicting-defined-decorators", never[], {
4
- ClassDeclaration(node: import("@typescript-eslint/types/dist/generated/ast-spec").ClassDeclaration): void;
5
- }>;
6
- "api-property-matches-property-optionality": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"shouldUseOptionalDecorator" | "shouldUseRequiredDecorator", never[], {
7
- PropertyDefinition(node: import("@typescript-eslint/types/dist/generated/ast-spec").PropertyDefinition): void;
8
- }>;
9
- "injectable-should-be-provided": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"injectableInModule" | "controllersInModule", [{
10
- src: string[];
11
- filterFromPaths: string[];
12
- }], {
13
- ClassDeclaration(node: import("@typescript-eslint/types/dist/generated/ast-spec").ClassDeclaration): void;
14
- "Program:exit"(): void;
15
- }>;
16
- "provided-injected-should-match-factory-parameters": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"mainMessage", never[], {
17
- VariableDeclarator(node: import("@typescript-eslint/types/dist/generated/ast-spec").VariableDeclarator): void;
18
- }>;
19
- "controllers-should-supply-api-tags": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"shouldUseApiTagDecorator", never[], {
20
- ClassDeclaration(node: import("@typescript-eslint/types/dist/generated/ast-spec").ClassDeclaration): void;
21
- }>;
22
- "api-method-should-specify-api-response": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"shouldSpecifyApiResponse", never[], {
23
- MethodDefinition(node: import("@typescript-eslint/types/dist/generated/ast-spec").MethodDefinition): void;
24
- }>;
25
- "api-method-should-specify-api-operation": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"shouldSpecifyApiOperation", never[], {
26
- MethodDefinition(node: import("@typescript-eslint/types/dist/generated/ast-spec").MethodDefinition): void;
27
- }>;
28
- "api-enum-property-best-practices": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"needsEnumNameAdded" | "needsTypeRemoved" | "enumNameShouldMatchType", never[], {
29
- PropertyDefinition(node: import("@typescript-eslint/types/dist/generated/ast-spec").Node): void;
30
- }>;
31
- "api-property-returning-array-should-set-array": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"shouldSetArrayPropertyTrue" | "shouldSetArrayPropertyFalse", never[], {
32
- PropertyDefinition: (node: import("@typescript-eslint/types/dist/generated/ast-spec").Node) => void;
33
- }>;
34
- "should-specify-forbid-unknown-values": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"shouldSpecifyForbidUnknownValues", never[], {
35
- NewExpression(node: import("@typescript-eslint/types/dist/generated/ast-spec").Node): void;
36
- VariableDeclarator(node: import("@typescript-eslint/types/dist/generated/ast-spec").Node): void;
37
- }>;
38
- "param-decorator-name-matches-route-param": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"paramIdentifierDoesntNeedColon" | "paramIdentifierShouldMatch", never[], {
39
- Decorator(node: import("@typescript-eslint/types/dist/generated/ast-spec").Decorator): void;
40
- }>;
41
- "validated-non-primitive-property-needs-type-decorator": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"autofixWithTypeDecorator" | "shouldUseTypeDecorator", import("./rules/validateNonPrimitiveNeedsTypeDecorator/validateNonPrimitiveNeedsDecorators").ValidateNonPrimitivePropertyTypeDecoratorOptions, {
42
- PropertyDefinition(node: import("@typescript-eslint/types/dist/generated/ast-spec").PropertyDefinition): void;
43
- }>;
44
- "validate-nested-of-array-should-set-each": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"shouldSetEachPropertyTrue" | "shouldSetEachPropertyFalse", never[], {
45
- PropertyDefinition: (node: import("@typescript-eslint/types/dist/generated/ast-spec").Node) => void;
46
- }>;
47
- "all-properties-are-whitelisted": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"missing-property-decorator", never[], {
48
- ClassDeclaration(node: import("@typescript-eslint/types/dist/generated/ast-spec").ClassDeclaration): void;
49
- }>;
50
- "api-methods-should-be-guarded": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"apiMethodsShouldBeGuarded", never[], {
51
- MethodDefinition(node: import("@typescript-eslint/types/dist/generated/ast-spec").MethodDefinition): void;
52
- }>;
53
- "sort-module-metadata-arrays": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"moduleMetadataArraysAreSorted", {
54
- locale: string;
55
- }[], {
56
- [x: string]: ({ elements, }: import("@typescript-eslint/types/dist/generated/ast-spec").ArrayExpression) => void;
57
- }>;
58
- };
59
- configs: {
60
- recommended: {
61
- parser: string;
62
- parserOptions: {
63
- sourceType: string;
64
- };
65
- rules: {
66
- "@darraghor/nestjs-typed/provided-injected-should-match-factory-parameters": string;
67
- "@darraghor/nestjs-typed/injectable-should-be-provided": (string | {
68
- src: string[];
69
- filterFromPaths: string[];
70
- })[];
71
- "@darraghor/nestjs-typed/api-property-matches-property-optionality": string;
72
- "@darraghor/nestjs-typed/api-method-should-specify-api-response": string;
73
- "@darraghor/nestjs-typed/controllers-should-supply-api-tags": string;
74
- "@darraghor/nestjs-typed/api-enum-property-best-practices": string;
75
- "@darraghor/nestjs-typed/api-property-returning-array-should-set-array": string;
76
- "@darraghor/nestjs-typed/should-specify-forbid-unknown-values": string;
77
- "@darraghor/nestjs-typed/param-decorator-name-matches-route-param": string;
78
- "@darraghor/nestjs-typed/validated-non-primitive-property-needs-type-decorator": string;
79
- "@darraghor/nestjs-typed/validate-nested-of-array-should-set-each": string;
80
- "@darraghor/nestjs-typed/all-properties-are-whitelisted": string;
81
- "@darraghor/nestjs-typed/all-properties-have-explicit-defined": string;
82
- "@darraghor/nestjs-typed/api-methods-should-be-guarded": string;
83
- "@darraghor/nestjs-typed/api-method-should-specify-api-operation": string;
84
- "@darraghor/nestjs-typed/sort-module-metadata-arrays": string;
85
- };
86
- };
87
- "no-swagger": {
88
- parser: string;
89
- parserOptions: {
90
- sourceType: string;
91
- };
92
- rules: {
93
- "@darraghor/nestjs-typed/api-property-matches-property-optionality": string;
94
- "@darraghor/nestjs-typed/api-method-should-specify-api-response": string;
95
- "@darraghor/nestjs-typed/api-method-should-specify-api-operation": string;
96
- "@darraghor/nestjs-typed/controllers-should-supply-api-tags": string;
97
- "@darraghor/nestjs-typed/api-enum-property-best-practices": string;
98
- "@darraghor/nestjs-typed/api-property-returning-array-should-set-array": string;
99
- };
100
- };
101
- };
102
- };
103
- export = configuration;
@@ -1,5 +0,0 @@
1
- import { TSESLint, TSESTree } from "@typescript-eslint/utils";
2
- declare const rule: TSESLint.RuleModule<"missing-property-decorator", never[], {
3
- ClassDeclaration(node: TSESTree.ClassDeclaration): void;
4
- }>;
5
- export default rule;
@@ -1,5 +0,0 @@
1
- import { TSESTree } from "@typescript-eslint/utils";
2
- declare const rule: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"missing-is-defined-decorator" | "missing-is-optional-decorator" | "conflicting-defined-decorators", never[], {
3
- ClassDeclaration(node: TSESTree.ClassDeclaration): void;
4
- }>;
5
- export default rule;
@@ -1,8 +0,0 @@
1
- import { TSESTree, TSESLint } from "@typescript-eslint/utils";
2
- import { EnumTestResultModel } from "./enumTestResultModel";
3
- export declare const hasEnumSpecifiedCorrectly: (node: TSESTree.Node, isEnumType: boolean) => EnumTestResultModel;
4
- export declare const needsEnumNameMatchingEnumType: (enumNameProperty: TSESTree.Property, enumProperty: TSESTree.Property) => boolean;
5
- declare const rule: TSESLint.RuleModule<"needsEnumNameAdded" | "needsTypeRemoved" | "enumNameShouldMatchType", never[], {
6
- PropertyDefinition(node: TSESTree.Node): void;
7
- }>;
8
- export default rule;
@@ -1,7 +0,0 @@
1
- export declare class EnumTestResultModel {
2
- constructor(init: EnumTestResultModel);
3
- needsEnumAdded: boolean;
4
- needsTypeRemoved: boolean;
5
- needsEnumNameAdded: boolean;
6
- needsEnumNameToMatchEnumType: boolean;
7
- }
@@ -1,6 +0,0 @@
1
- import { TSESTree, TSESLint } from "@typescript-eslint/utils";
2
- export declare const apiMethodsShouldBeGuarded: (node: TSESTree.MethodDefinition) => boolean;
3
- declare const rule: TSESLint.RuleModule<"apiMethodsShouldBeGuarded", never[], {
4
- MethodDefinition(node: TSESTree.MethodDefinition): void;
5
- }>;
6
- export default rule;
@@ -1,6 +0,0 @@
1
- import { TSESTree, TSESLint } from "@typescript-eslint/utils";
2
- export declare const shouldUseApiResponseDecorator: (node: TSESTree.MethodDefinition) => boolean;
3
- declare const rule: TSESLint.RuleModule<"shouldSpecifyApiOperation", never[], {
4
- MethodDefinition(node: TSESTree.MethodDefinition): void;
5
- }>;
6
- export default rule;
@@ -1,6 +0,0 @@
1
- import { TSESTree, TSESLint } from "@typescript-eslint/utils";
2
- export declare const shouldUseApiResponseDecorator: (node: TSESTree.MethodDefinition) => boolean;
3
- declare const rule: TSESLint.RuleModule<"shouldSpecifyApiResponse", never[], {
4
- MethodDefinition(node: TSESTree.MethodDefinition): void;
5
- }>;
6
- export default rule;
@@ -1,7 +0,0 @@
1
- import { TSESTree, TSESLint } from "@typescript-eslint/utils";
2
- export declare const shouldUseRequiredDecorator: (node: TSESTree.PropertyDefinition) => boolean;
3
- export declare const shouldUseOptionalDecorator: (node: TSESTree.PropertyDefinition) => boolean;
4
- declare const rule: TSESLint.RuleModule<"shouldUseOptionalDecorator" | "shouldUseRequiredDecorator", never[], {
5
- PropertyDefinition(node: TSESTree.PropertyDefinition): void;
6
- }>;
7
- export default rule;
@@ -1,7 +0,0 @@
1
- import { TSESTree, TSESLint } from "@typescript-eslint/utils";
2
- import ArraySetResultModel from "./arraySetResultModel";
3
- export declare const shouldSetArrayProperty: (node: TSESTree.PropertyDefinition) => ArraySetResultModel;
4
- declare const rule: TSESLint.RuleModule<"shouldSetArrayPropertyTrue" | "shouldSetArrayPropertyFalse", never[], {
5
- PropertyDefinition: (node: TSESTree.Node) => void;
6
- }>;
7
- export default rule;
@@ -1,5 +0,0 @@
1
- export default class ArraySetResultModel {
2
- isArrayShouldBeSetTrue: boolean;
3
- isArrayShouldBeSetFalse: boolean;
4
- constructor(isArrayShouldBeSetTrue: boolean, isArrayShouldBeSetFalse: boolean);
5
- }
@@ -1,6 +0,0 @@
1
- import { TSESTree, TSESLint } from "@typescript-eslint/utils";
2
- export declare const shouldUseApiTagDecorator: (node: TSESTree.ClassDeclaration) => boolean;
3
- declare const rule: TSESLint.RuleModule<"shouldUseApiTagDecorator", never[], {
4
- ClassDeclaration(node: TSESTree.ClassDeclaration): void;
5
- }>;
6
- export default rule;
@@ -1,58 +0,0 @@
1
- declare const allRules: {
2
- "all-properties-have-explicit-defined": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"missing-is-defined-decorator" | "missing-is-optional-decorator" | "conflicting-defined-decorators", never[], {
3
- ClassDeclaration(node: import("@typescript-eslint/types/dist/generated/ast-spec").ClassDeclaration): void;
4
- }>;
5
- "api-property-matches-property-optionality": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"shouldUseOptionalDecorator" | "shouldUseRequiredDecorator", never[], {
6
- PropertyDefinition(node: import("@typescript-eslint/types/dist/generated/ast-spec").PropertyDefinition): void;
7
- }>;
8
- "injectable-should-be-provided": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"injectableInModule" | "controllersInModule", [{
9
- src: string[];
10
- filterFromPaths: string[];
11
- }], {
12
- ClassDeclaration(node: import("@typescript-eslint/types/dist/generated/ast-spec").ClassDeclaration): void;
13
- "Program:exit"(): void;
14
- }>;
15
- "provided-injected-should-match-factory-parameters": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"mainMessage", never[], {
16
- VariableDeclarator(node: import("@typescript-eslint/types/dist/generated/ast-spec").VariableDeclarator): void;
17
- }>;
18
- "controllers-should-supply-api-tags": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"shouldUseApiTagDecorator", never[], {
19
- ClassDeclaration(node: import("@typescript-eslint/types/dist/generated/ast-spec").ClassDeclaration): void;
20
- }>;
21
- "api-method-should-specify-api-response": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"shouldSpecifyApiResponse", never[], {
22
- MethodDefinition(node: import("@typescript-eslint/types/dist/generated/ast-spec").MethodDefinition): void;
23
- }>;
24
- "api-method-should-specify-api-operation": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"shouldSpecifyApiOperation", never[], {
25
- MethodDefinition(node: import("@typescript-eslint/types/dist/generated/ast-spec").MethodDefinition): void;
26
- }>;
27
- "api-enum-property-best-practices": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"needsEnumNameAdded" | "needsTypeRemoved" | "enumNameShouldMatchType", never[], {
28
- PropertyDefinition(node: import("@typescript-eslint/types/dist/generated/ast-spec").Node): void;
29
- }>;
30
- "api-property-returning-array-should-set-array": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"shouldSetArrayPropertyTrue" | "shouldSetArrayPropertyFalse", never[], {
31
- PropertyDefinition: (node: import("@typescript-eslint/types/dist/generated/ast-spec").Node) => void;
32
- }>;
33
- "should-specify-forbid-unknown-values": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"shouldSpecifyForbidUnknownValues", never[], {
34
- NewExpression(node: import("@typescript-eslint/types/dist/generated/ast-spec").Node): void;
35
- VariableDeclarator(node: import("@typescript-eslint/types/dist/generated/ast-spec").Node): void;
36
- }>;
37
- "param-decorator-name-matches-route-param": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"paramIdentifierDoesntNeedColon" | "paramIdentifierShouldMatch", never[], {
38
- Decorator(node: import("@typescript-eslint/types/dist/generated/ast-spec").Decorator): void;
39
- }>;
40
- "validated-non-primitive-property-needs-type-decorator": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"autofixWithTypeDecorator" | "shouldUseTypeDecorator", import("./validateNonPrimitiveNeedsTypeDecorator/validateNonPrimitiveNeedsDecorators").ValidateNonPrimitivePropertyTypeDecoratorOptions, {
41
- PropertyDefinition(node: import("@typescript-eslint/types/dist/generated/ast-spec").PropertyDefinition): void;
42
- }>;
43
- "validate-nested-of-array-should-set-each": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"shouldSetEachPropertyTrue" | "shouldSetEachPropertyFalse", never[], {
44
- PropertyDefinition: (node: import("@typescript-eslint/types/dist/generated/ast-spec").Node) => void;
45
- }>;
46
- "all-properties-are-whitelisted": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"missing-property-decorator", never[], {
47
- ClassDeclaration(node: import("@typescript-eslint/types/dist/generated/ast-spec").ClassDeclaration): void;
48
- }>;
49
- "api-methods-should-be-guarded": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"apiMethodsShouldBeGuarded", never[], {
50
- MethodDefinition(node: import("@typescript-eslint/types/dist/generated/ast-spec").MethodDefinition): void;
51
- }>;
52
- "sort-module-metadata-arrays": import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"moduleMetadataArraysAreSorted", {
53
- locale: string;
54
- }[], {
55
- [x: string]: ({ elements, }: import("@typescript-eslint/types/dist/generated/ast-spec").ArrayExpression) => void;
56
- }>;
57
- };
58
- export default allRules;
@@ -1,12 +0,0 @@
1
- import { TSESTree, TSESLint } from "@typescript-eslint/utils";
2
- declare type Options = [
3
- {
4
- src: string[];
5
- filterFromPaths: string[];
6
- }
7
- ];
8
- declare const rule: TSESLint.RuleModule<"injectableInModule" | "controllersInModule", Options, {
9
- ClassDeclaration(node: TSESTree.ClassDeclaration): void;
10
- "Program:exit"(): void;
11
- }>;
12
- export default rule;
@@ -1,23 +0,0 @@
1
- import { TSESTree, TSESLint } from "@typescript-eslint/utils";
2
- declare type ResultModel = {
3
- hasColonInName: boolean;
4
- paramNameNotMatchedInPath: boolean;
5
- };
6
- export declare const parsePathParts: (decorator: TSESTree.Decorator) => string[];
7
- /**
8
- * nestjs allows for paths with _+?()*
9
- * this rule doesn't support parsing those so we'll just pass
10
- */
11
- export declare const hasPathPartsAnyRegexParams: (pathPartsToCheck: string[]) => boolean;
12
- /**
13
- * Checks if there is a matching path part for the paramName
14
- * @param paramName
15
- * @param pathPartsToCheck
16
- * @returns
17
- */
18
- export declare const isParameterNameIncludedInAPathPart: (paramName: string, pathPartsToCheck: string[]) => boolean;
19
- export declare const shouldTrigger: (decorator: TSESTree.Decorator) => ResultModel;
20
- declare const rule: TSESLint.RuleModule<"paramIdentifierDoesntNeedColon" | "paramIdentifierShouldMatch", never[], {
21
- Decorator(node: TSESTree.Decorator): void;
22
- }>;
23
- export default rule;
@@ -1,10 +0,0 @@
1
- export declare const pathPartTestCases: {
2
- moduleCode: string;
3
- paths: string[];
4
- message: string;
5
- }[];
6
- export declare const responseParsingTestCases: {
7
- pathToCheck: string;
8
- paths: string[];
9
- shouldResult: boolean;
10
- }[];
@@ -1,6 +0,0 @@
1
- import { TSESTree, TSESLint } from "@typescript-eslint/utils";
2
- export declare const hasMismatchedInjected: (node: TSESTree.VariableDeclarator) => boolean;
3
- declare const rule: TSESLint.RuleModule<"mainMessage", never[], {
4
- VariableDeclarator(node: TSESTree.VariableDeclarator): void;
5
- }>;
6
- export default rule;
@@ -1,10 +0,0 @@
1
- import { TSESTree, TSESLint } from "@typescript-eslint/utils";
2
- export declare const isValidationPipeNewExpression: (node: TSESTree.Node) => boolean;
3
- export declare const checkObjectExpression: (os: TSESTree.ObjectExpression) => boolean;
4
- export declare const shouldTriggerNewExpressionHasProperty: (node: TSESTree.Node) => boolean;
5
- export declare const shouldTriggerForVariableDecleratorExpression: (node: TSESTree.Node) => boolean;
6
- declare const rule: TSESLint.RuleModule<"shouldSpecifyForbidUnknownValues", never[], {
7
- NewExpression(node: TSESTree.Node): void;
8
- VariableDeclarator(node: TSESTree.Node): void;
9
- }>;
10
- export default rule;
@@ -1,10 +0,0 @@
1
- import { TSESTree } from "@typescript-eslint/utils";
2
- export declare type ValidModuleNodeTypes = TSESTree.Identifier | TSESTree.CallExpression;
3
- export declare const isValidModuleMetaPropertyType: (node: TSESTree.Expression | TSESTree.SpreadElement | null) => node is ValidModuleNodeTypes;
4
- export declare const getRelevantNodeName: (node: TSESTree.Node) => string;
5
- declare const _default: import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<"moduleMetadataArraysAreSorted", {
6
- locale: string;
7
- }[], {
8
- [x: string]: ({ elements, }: TSESTree.ArrayExpression) => void;
9
- }>;
10
- export default _default;
@@ -1,5 +0,0 @@
1
- export default class ArraySetResultModel {
2
- isArrayShouldBeSetTrue: boolean;
3
- isArrayShouldBeSetFalse: boolean;
4
- constructor(isArrayShouldBeSetTrue: boolean, isArrayShouldBeSetFalse: boolean);
5
- }
@@ -1,7 +0,0 @@
1
- import { TSESTree, TSESLint } from "@typescript-eslint/utils";
2
- import ArraySetResultModel from "./arraySetResultModel";
3
- export declare const shouldSetArrayProperty: (node: TSESTree.PropertyDefinition) => ArraySetResultModel;
4
- declare const rule: TSESLint.RuleModule<"shouldSetEachPropertyTrue" | "shouldSetEachPropertyFalse", never[], {
5
- PropertyDefinition: (node: TSESTree.Node) => void;
6
- }>;
7
- export default rule;
@@ -1,12 +0,0 @@
1
- import { TSESTree, TSESLint } from "@typescript-eslint/utils";
2
- export declare type ValidateNonPrimitivePropertyTypeDecoratorOptions = [
3
- {
4
- additionalTypeDecorators: string[];
5
- additionalCustomValidatorDecorators?: string[];
6
- }
7
- ];
8
- export declare const shouldTrigger: () => boolean;
9
- declare const rule: TSESLint.RuleModule<"autofixWithTypeDecorator" | "shouldUseTypeDecorator", ValidateNonPrimitivePropertyTypeDecoratorOptions, {
10
- PropertyDefinition(node: TSESTree.PropertyDefinition): void;
11
- }>;
12
- export default rule;
@@ -1 +0,0 @@
1
- export declare function getFixturesRootDirectory(): string;
@@ -1 +0,0 @@
1
- import "reflect-metadata";
@@ -1,2 +0,0 @@
1
- import { TSESTree } from "@typescript-eslint/types";
2
- export declare function getPropertiesDefinitions(classDeclaration: TSESTree.ClassDeclaration): TSESTree.PropertyDefinition[];
@@ -1,2 +0,0 @@
1
- import { ESLintUtils } from "@typescript-eslint/utils";
2
- export declare const createRule: <TOptions extends readonly unknown[], TMessageIds extends string, TRuleListener extends import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener = import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleListener>({ name, meta, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<TOptions, TMessageIds, TRuleListener>>) => import("@typescript-eslint/utils/dist/ts-eslint/Rule").RuleModule<TMessageIds, TOptions, TRuleListener>;
@@ -1,6 +0,0 @@
1
- import { EslintFile, FilePath } from "eslint/use-at-your-own-risk";
2
- declare class FileEnumeratorWrapper {
3
- static enumerateFiles: (sourceGlobs: string[], extensions: string[], filterFromPaths: string[]) => Array<FilePath>;
4
- static mapEnumeratedFiles: (paths: Array<EslintFile>, filterFromPaths: string[]) => Array<FilePath>;
5
- }
6
- export default FileEnumeratorWrapper;
@@ -1,4 +0,0 @@
1
- declare class IsFilteredPath {
2
- static test: (path: string | undefined, filteredStrings: string[] | undefined) => boolean;
3
- }
4
- export default IsFilteredPath;
@@ -1,5 +0,0 @@
1
- export declare class NestProvidedInjectablesMap {
2
- controllers: Set<string>;
3
- providers: Set<string>;
4
- constructor(controllers: Set<string>, providers: Set<string>);
5
- }
@@ -1,7 +0,0 @@
1
- import { TSESTree } from "@typescript-eslint/utils";
2
- import { NestProvidedInjectablesMap } from "./models/NestProvidedInjectablesMap";
3
- export declare const nestModuleAstParser: {
4
- findNestModuleClass(ast: TSESTree.Program): TSESTree.ClassDeclaration | null;
5
- mapNestModuleDecorator(n: TSESTree.ClassDeclaration, path: string): Array<string | NestProvidedInjectablesMap> | null;
6
- mapModuleDecoratorOptionProperty(moduleDecorator: TSESTree.Decorator, propertyName: string): Set<string>;
7
- };
@@ -1,12 +0,0 @@
1
- import { TSESLint, TSESTree } from "@typescript-eslint/utils";
2
- import { FilePath } from "eslint/use-at-your-own-risk";
3
- import { NestProvidedInjectablesMap } from "./models/NestProvidedInjectablesMap";
4
- declare const NestProvidedInjectableMapper: {
5
- detectDirectoryToScanForFiles(sourceGlob: string | string[] | undefined, currentWorkingDirectory: string): string[];
6
- parseFileList(files: Array<FilePath>, context: Readonly<TSESLint.RuleContext<never, any>>): Map<string, NestProvidedInjectablesMap>;
7
- notEmpty<TValue>(value: TValue | null): value is TValue;
8
- readFileContents(path: string): string;
9
- isNestInjectableThatIsNeverProvided(node: TSESTree.ClassDeclaration): boolean;
10
- mapAllProvidedInjectables(ast: TSESTree.Program, path: string): Array<string | NestProvidedInjectablesMap> | null;
11
- };
12
- export default NestProvidedInjectableMapper;
@@ -1,7 +0,0 @@
1
- import { NestProvidedInjectablesMap } from "./models/NestProvidedInjectablesMap";
2
- export declare const fakeFilePath = "fake/path.ts";
3
- export declare const fakeContext: any;
4
- export declare const moduleMappingTestData: {
5
- moduleCode: string;
6
- expectedMapping: (string | NestProvidedInjectablesMap)[];
7
- }[];
@@ -1,7 +0,0 @@
1
- import { TSESTree } from "@typescript-eslint/utils";
2
- import { NestProvidedInjectablesMap } from "./models/NestProvidedInjectablesMap";
3
- export declare const nestProviderAstParser: {
4
- mapNestProviderObject(n: TSESTree.Property, path: string): Array<string | NestProvidedInjectablesMap> | null;
5
- findProvideProperty(providerDeclaration: TSESTree.VariableDeclarator | undefined, propertyName: string): TSESTree.Property | null;
6
- findNestProviderVariableDeclaration(ast: TSESTree.Program): TSESTree.VariableDeclarator | undefined;
7
- };
@@ -1,59 +0,0 @@
1
- import { TSESLint, TSESTree } from "@typescript-eslint/utils";
2
- import { ParserServices } from "@typescript-eslint/parser";
3
- import ts from "typescript";
4
- export declare const typedTokenHelpers: {
5
- decoratorsThatCouldMeanTheDevIsValidatingAnArray: string[];
6
- isTypeArrayTypeOrUnionOfArrayTypes(node: TSESTree.Node, parserService: ParserServices, checker: ts.TypeChecker): boolean;
7
- getNodeType(node: TSESTree.Node, parserService: ParserServices, checker: ts.TypeChecker): ts.Type;
8
- expressionNodeIsArrayType(node: TSESTree.Expression, parserService: ParserServices, checker: ts.TypeChecker): boolean;
9
- getPropertyValueEqualsExpected(firstArgument: TSESTree.ObjectExpression, propertyName: string, expectedValue: string | number | bigint | boolean | RegExp | null): boolean;
10
- getConstrainedTypeAtLocation(checker: ts.TypeChecker, node: ts.Node): ts.Type;
11
- nodeHasDecoratorsNamed(n: TSESTree.ClassDeclaration | TSESTree.PropertyDefinition | TSESTree.MethodDefinition, decoratorNames: string[]): boolean;
12
- getDecoratorsNamed(n: TSESTree.ClassDeclaration | TSESTree.PropertyDefinition | TSESTree.MethodDefinition, decoratorNames: string[]): TSESTree.Decorator[];
13
- parseStringToAst(code: string, path: string, context: Readonly<TSESLint.RuleContext<never, never[]>>): TSESTree.Program;
14
- isEnumType(type: ts.Type): boolean;
15
- isOptionalPropertyValue(node: TSESTree.PropertyDefinition): boolean;
16
- /**
17
- * Checks if an import is an import of the given decorator name
18
- * @param imp
19
- * @param decoratorName
20
- */
21
- importIsDecorator(imp: TSESTree.ImportDeclaration, decoratorName: string): boolean;
22
- /**
23
- * Checks if decorator is in imports of a node
24
- * @param imports
25
- * @param decorator
26
- */
27
- decoratorIsImportedFromClassValidator(imports: TSESTree.ImportDeclaration[], decorator: TSESTree.Decorator): boolean;
28
- /**
29
- * Checks whether a decorator is a class validator decorator
30
- * @param program The root program node
31
- * @param decorator The decorator node
32
- */
33
- decoratorIsClassValidatorDecorator(program: TSESTree.Program | null, decorator: TSESTree.Decorator): boolean;
34
- /**
35
- * Gets the root program of a node
36
- * @param node
37
- */
38
- getRootProgram(node: TSESTree.BaseNode): TSESTree.Program | null;
39
- /**
40
- * Gets all the decorators actually imported from class-validator lib or decorators that were included in the additionalCustomValidatorDecorators options
41
- * @param node PropertyDefinition node
42
- */
43
- getValidationDecorators(node: TSESTree.PropertyDefinition, additionalCustomValidatorDecorators?: string[]): TSESTree.Decorator[];
44
- /**
45
- * Checks if the decorator is the IsEnum decorator
46
- * @param decorator
47
- */
48
- decoratorIsIsEnum(decorator: TSESTree.Decorator): boolean;
49
- /** Checks if the decorator is the IsObject decorator
50
- * @param decorator
51
- */
52
- decoratorIsIsObject(decorator: TSESTree.Decorator): boolean;
53
- /**
54
- * Gets the name of a decorator
55
- * Returns null if no name is found
56
- * @param decorator
57
- */
58
- getDecoratorName(decorator: TSESTree.Decorator): string | null;
59
- };
@@ -1 +0,0 @@
1
- export declare const MODULE_CLASS_DECORATOR = "ClassDeclaration > Decorator[expression.callee.name=\"Module\"]";