@darraghor/eslint-plugin-nestjs-typed 6.0.0-rc.7 → 6.0.0-rc.8

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 (41) hide show
  1. package/dist/configs/base.d.ts +8 -0
  2. package/dist/configs/index.d.ts +11 -0
  3. package/dist/configs/noSwagger.d.ts +6 -0
  4. package/dist/configs/recommended.d.ts +6 -0
  5. package/dist/index.d.ts +54 -0
  6. package/dist/rules/allPropertiesAreWhitelisted/allPropertiesAreWhitelisted.d.ts +2 -0
  7. package/dist/rules/allPropertiesHaveExplicitDefined/allPropertiesHaveExplicitDefined.d.ts +3 -0
  8. package/dist/rules/apiEnumPropertyBestPractices/apiEnumPropertyBestPractices.d.ts +6 -0
  9. package/dist/rules/apiEnumPropertyBestPractices/enumTestResultModel.d.ts +7 -0
  10. package/dist/rules/apiMethodsShouldBeGuarded/apiMethodsShouldBeGuarded.d.ts +4 -0
  11. package/dist/rules/apiMethodsShouldSpecifyApiOperation/apiMethodsShouldSpecifyApiOperation.d.ts +4 -0
  12. package/dist/rules/apiMethodsShouldSpecifyApiResponse/apiMethodsShouldSpecifyApiResponse.d.ts +4 -0
  13. package/dist/rules/apiPropertyMatchesPropertyOptionality/apiPropertyMatchesPropertyOptionality.d.ts +5 -0
  14. package/dist/rules/apiPropertyReturningArrayShouldSetArray/apiPropertyReturningArrayShouldSetArray.d.ts +5 -0
  15. package/dist/rules/apiPropertyReturningArrayShouldSetArray/arraySetResultModel.d.ts +5 -0
  16. package/dist/rules/controllerDecoratedHasApiTags/controllerDecoratedHasApiTags.d.ts +4 -0
  17. package/dist/rules/index.d.ts +23 -0
  18. package/dist/rules/injectablesShouldBeProvided/injectableShouldBeProvided.d.ts +9 -0
  19. package/dist/rules/noDuplicateDecorators/noDuplicateDecorators.d.ts +9 -0
  20. package/dist/rules/paramDecoratorNameMatchesRouteParam/paramDecoratorNameMatchesRouteParam.d.ts +21 -0
  21. package/dist/rules/paramDecoratorNameMatchesRouteParam/rule.testData.d.ts +10 -0
  22. package/dist/rules/providerInjectedShouldMatchFactory/ProviderInjectedShouldMatchFactory.d.ts +4 -0
  23. package/dist/rules/shouldSpecifyForbidUnknownValues/shouldSpecifyForbidUnknownValuesRule.d.ts +7 -0
  24. package/dist/rules/sortModuleMetadataArrays/sortModuleMetadataArrays.d.ts +11 -0
  25. package/dist/rules/validateNestedOfArrayShouldSetEach/arraySetResultModel.d.ts +5 -0
  26. package/dist/rules/validateNestedOfArrayShouldSetEach/validateNestedOfArrayShouldSetEach.d.ts +5 -0
  27. package/dist/rules/validateNonPrimitiveNeedsTypeDecorator/validateNonPrimitiveNeedsDecorators.d.ts +10 -0
  28. package/dist/testing/fixtureSetup.d.ts +1 -0
  29. package/dist/testing/preRun.d.ts +1 -0
  30. package/dist/utils/ast.d.ts +2 -0
  31. package/dist/utils/createRule.d.ts +2 -0
  32. package/dist/utils/files/customFileEnumeratorWrapper.d.ts +8 -0
  33. package/dist/utils/files/isFilteredPath.d.ts +4 -0
  34. package/dist/utils/nestModules/models/NestProvidedInjectablesMap.d.ts +5 -0
  35. package/dist/utils/nestModules/nestModuleAstParser.d.ts +7 -0
  36. package/dist/utils/nestModules/nestProvidedInjectableMapper.d.ts +14 -0
  37. package/dist/utils/nestModules/nestProvidedInjectableMapper.testData.d.ts +7 -0
  38. package/dist/utils/nestModules/nestProviderAstParser.d.ts +7 -0
  39. package/dist/utils/typedTokenHelpers.d.ts +59 -0
  40. package/dist/utils/wellKnownSelectors.d.ts +1 -0
  41. package/package.json +10 -2
@@ -0,0 +1,8 @@
1
+ declare const _default: {
2
+ parser: string;
3
+ parserOptions: {
4
+ sourceType: "module";
5
+ };
6
+ plugins: string[];
7
+ };
8
+ export = _default;
@@ -0,0 +1,11 @@
1
+ declare const allConfigs: {
2
+ recommended: {
3
+ extends: string[];
4
+ rules: Partial<import("eslint").Linter.RulesRecord>;
5
+ };
6
+ "no-swagger": {
7
+ extends: string[];
8
+ rules: Partial<import("eslint").Linter.RulesRecord>;
9
+ };
10
+ };
11
+ export default allConfigs;
@@ -0,0 +1,6 @@
1
+ import { Linter } from "eslint";
2
+ declare const _default: {
3
+ extends: string[];
4
+ rules: Partial<Linter.RulesRecord>;
5
+ };
6
+ export = _default;
@@ -0,0 +1,6 @@
1
+ import { Linter } from "eslint";
2
+ declare const _default: {
3
+ extends: string[];
4
+ rules: Partial<Linter.RulesRecord>;
5
+ };
6
+ export = _default;
@@ -0,0 +1,54 @@
1
+ import type { FlatConfig } from "@typescript-eslint/utils/ts-eslint";
2
+ import { TSESLint } from "@typescript-eslint/utils";
3
+ export declare const parser: TSESLint.FlatConfig.Parser;
4
+ export declare const plugin: TSESLint.FlatConfig.Plugin;
5
+ declare const classicPlugin: {
6
+ configs: {
7
+ recommended: {
8
+ extends: string[];
9
+ rules: Partial<import("eslint").Linter.RulesRecord>;
10
+ };
11
+ "no-swagger": {
12
+ extends: string[];
13
+ rules: Partial<import("eslint").Linter.RulesRecord>;
14
+ };
15
+ };
16
+ rules: {
17
+ "all-properties-have-explicit-defined": TSESLint.RuleModule<"missing-is-defined-decorator" | "missing-is-optional-decorator" | "conflicting-defined-decorators-defined-optional" | "conflicting-defined-decorators-defined-validate-if" | "conflicting-defined-decorators-optional-validate-if" | "conflicting-defined-decorators-all", [], unknown, TSESLint.RuleListener>;
18
+ "api-property-matches-property-optionality": TSESLint.RuleModule<"shouldUseOptionalDecorator" | "shouldUseRequiredDecorator", [], unknown, TSESLint.RuleListener>;
19
+ "injectable-should-be-provided": TSESLint.RuleModule<"injectableInModule" | "controllersInModule", [{
20
+ src: string[];
21
+ filterFromPaths: string[];
22
+ }], unknown, TSESLint.RuleListener>;
23
+ "no-duplicate-decorators": TSESLint.RuleModule<"noDuplicateDecorators", import("./rules/noDuplicateDecorators/noDuplicateDecorators").NoDuplicateDecoratorsOptions, unknown, TSESLint.RuleListener>;
24
+ "provided-injected-should-match-factory-parameters": TSESLint.RuleModule<"mainMessage", [], unknown, TSESLint.RuleListener>;
25
+ "controllers-should-supply-api-tags": TSESLint.RuleModule<"shouldUseApiTagDecorator", [], unknown, TSESLint.RuleListener>;
26
+ "api-method-should-specify-api-response": TSESLint.RuleModule<"shouldSpecifyApiResponse", [], unknown, TSESLint.RuleListener>;
27
+ "api-method-should-specify-api-operation": TSESLint.RuleModule<"shouldSpecifyApiOperation", [], unknown, TSESLint.RuleListener>;
28
+ "api-enum-property-best-practices": TSESLint.RuleModule<"needsEnumNameAdded" | "needsTypeRemoved" | "enumNameShouldMatchType", [], unknown, TSESLint.RuleListener>;
29
+ "api-property-returning-array-should-set-array": TSESLint.RuleModule<"shouldSetArrayPropertyTrue" | "shouldSetArrayPropertyFalse", [], unknown, TSESLint.RuleListener>;
30
+ "should-specify-forbid-unknown-values": TSESLint.RuleModule<"shouldSpecifyForbidUnknownValues", [], unknown, TSESLint.RuleListener>;
31
+ "param-decorator-name-matches-route-param": TSESLint.RuleModule<"paramIdentifierDoesntNeedColon" | "paramIdentifierShouldMatch", [], unknown, TSESLint.RuleListener>;
32
+ "validated-non-primitive-property-needs-type-decorator": TSESLint.RuleModule<"shouldUseTypeDecorator" | "autofixWithTypeDecorator", import("./rules/validateNonPrimitiveNeedsTypeDecorator/validateNonPrimitiveNeedsDecorators").ValidateNonPrimitivePropertyTypeDecoratorOptions, unknown, TSESLint.RuleListener>;
33
+ "validate-nested-of-array-should-set-each": TSESLint.RuleModule<"shouldSetEachPropertyTrue" | "shouldSetEachPropertyFalse", [], unknown, TSESLint.RuleListener>;
34
+ "all-properties-are-whitelisted": TSESLint.RuleModule<"missing-property-decorator", [], unknown, TSESLint.RuleListener>;
35
+ "api-methods-should-be-guarded": TSESLint.RuleModule<"apiMethodsShouldBeGuarded", [], unknown, TSESLint.RuleListener>;
36
+ "sort-module-metadata-arrays": TSESLint.RuleModule<"moduleMetadataArraysAreSorted", import("./rules/sortModuleMetadataArrays/sortModuleMetadataArrays").RuleOptions, unknown, TSESLint.RuleListener>;
37
+ };
38
+ meta: {
39
+ name: string;
40
+ version: string;
41
+ };
42
+ };
43
+ export declare function flatBaseConfig(plugin: FlatConfig.Plugin, parser: FlatConfig.Parser): FlatConfig.Config;
44
+ export declare function flatRecommendedConfig(plugin: FlatConfig.Plugin, parser: FlatConfig.Parser): FlatConfig.ConfigArray;
45
+ export declare function flatNoSwaggerConfig(): FlatConfig.ConfigArray;
46
+ export { classicPlugin };
47
+ export type ConfigArray = TSESLint.FlatConfig.ConfigArray;
48
+ declare const _default: {
49
+ configs: {
50
+ flatRecommended: ConfigArray;
51
+ flatNoSwagger: ConfigArray;
52
+ };
53
+ };
54
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"missing-property-decorator", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
2
+ export default rule;
@@ -0,0 +1,3 @@
1
+ import { ESLintUtils } from "@typescript-eslint/utils";
2
+ declare const rule: ESLintUtils.RuleModule<"missing-is-defined-decorator" | "missing-is-optional-decorator" | "conflicting-defined-decorators-defined-optional" | "conflicting-defined-decorators-defined-validate-if" | "conflicting-defined-decorators-optional-validate-if" | "conflicting-defined-decorators-all", [], unknown, ESLintUtils.RuleListener>;
3
+ export default rule;
@@ -0,0 +1,6 @@
1
+ import { ESLintUtils, TSESTree } 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: ESLintUtils.RuleModule<"needsEnumNameAdded" | "needsTypeRemoved" | "enumNameShouldMatchType", [], unknown, ESLintUtils.RuleListener>;
6
+ export default rule;
@@ -0,0 +1,7 @@
1
+ export declare class EnumTestResultModel {
2
+ constructor(init: EnumTestResultModel);
3
+ needsEnumAdded: boolean;
4
+ needsTypeRemoved: boolean;
5
+ needsEnumNameAdded: boolean;
6
+ needsEnumNameToMatchEnumType: boolean;
7
+ }
@@ -0,0 +1,4 @@
1
+ import { TSESTree } from "@typescript-eslint/utils";
2
+ export declare const apiMethodsShouldBeGuarded: (node: TSESTree.MethodDefinition) => boolean;
3
+ declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"apiMethodsShouldBeGuarded", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
4
+ export default rule;
@@ -0,0 +1,4 @@
1
+ import { TSESTree } from "@typescript-eslint/utils";
2
+ export declare const shouldUseApiResponseDecorator: (node: TSESTree.MethodDefinition) => boolean;
3
+ declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldSpecifyApiOperation", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
4
+ export default rule;
@@ -0,0 +1,4 @@
1
+ import { TSESTree } from "@typescript-eslint/utils";
2
+ export declare const shouldUseApiResponseDecorator: (node: TSESTree.MethodDefinition) => boolean;
3
+ declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldSpecifyApiResponse", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
4
+ export default rule;
@@ -0,0 +1,5 @@
1
+ import { TSESTree } 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: import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldUseOptionalDecorator" | "shouldUseRequiredDecorator", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
5
+ export default rule;
@@ -0,0 +1,5 @@
1
+ import { TSESTree } from "@typescript-eslint/utils";
2
+ import ArraySetResultModel from "./arraySetResultModel";
3
+ export declare const shouldSetArrayProperty: (node: TSESTree.PropertyDefinition) => ArraySetResultModel;
4
+ declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldSetArrayPropertyTrue" | "shouldSetArrayPropertyFalse", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
5
+ export default rule;
@@ -0,0 +1,5 @@
1
+ export default class ArraySetResultModel {
2
+ isArrayShouldBeSetTrue: boolean;
3
+ isArrayShouldBeSetFalse: boolean;
4
+ constructor(isArrayShouldBeSetTrue: boolean, isArrayShouldBeSetFalse: boolean);
5
+ }
@@ -0,0 +1,4 @@
1
+ import { TSESTree } from "@typescript-eslint/utils";
2
+ export declare const shouldUseApiTagDecorator: (node: TSESTree.ClassDeclaration) => boolean;
3
+ declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldUseApiTagDecorator", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
4
+ export default rule;
@@ -0,0 +1,23 @@
1
+ declare const allRules: {
2
+ "all-properties-have-explicit-defined": import("@typescript-eslint/utils/ts-eslint").RuleModule<"missing-is-defined-decorator" | "missing-is-optional-decorator" | "conflicting-defined-decorators-defined-optional" | "conflicting-defined-decorators-defined-validate-if" | "conflicting-defined-decorators-optional-validate-if" | "conflicting-defined-decorators-all", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
3
+ "api-property-matches-property-optionality": import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldUseOptionalDecorator" | "shouldUseRequiredDecorator", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
4
+ "injectable-should-be-provided": import("@typescript-eslint/utils/ts-eslint").RuleModule<"injectableInModule" | "controllersInModule", [{
5
+ src: string[];
6
+ filterFromPaths: string[];
7
+ }], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
8
+ "no-duplicate-decorators": import("@typescript-eslint/utils/ts-eslint").RuleModule<"noDuplicateDecorators", import("./noDuplicateDecorators/noDuplicateDecorators").NoDuplicateDecoratorsOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
9
+ "provided-injected-should-match-factory-parameters": import("@typescript-eslint/utils/ts-eslint").RuleModule<"mainMessage", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
10
+ "controllers-should-supply-api-tags": import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldUseApiTagDecorator", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
11
+ "api-method-should-specify-api-response": import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldSpecifyApiResponse", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
12
+ "api-method-should-specify-api-operation": import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldSpecifyApiOperation", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
13
+ "api-enum-property-best-practices": import("@typescript-eslint/utils/ts-eslint").RuleModule<"needsEnumNameAdded" | "needsTypeRemoved" | "enumNameShouldMatchType", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
14
+ "api-property-returning-array-should-set-array": import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldSetArrayPropertyTrue" | "shouldSetArrayPropertyFalse", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
15
+ "should-specify-forbid-unknown-values": import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldSpecifyForbidUnknownValues", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
16
+ "param-decorator-name-matches-route-param": import("@typescript-eslint/utils/ts-eslint").RuleModule<"paramIdentifierDoesntNeedColon" | "paramIdentifierShouldMatch", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
17
+ "validated-non-primitive-property-needs-type-decorator": import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldUseTypeDecorator" | "autofixWithTypeDecorator", import("./validateNonPrimitiveNeedsTypeDecorator/validateNonPrimitiveNeedsDecorators").ValidateNonPrimitivePropertyTypeDecoratorOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
18
+ "validate-nested-of-array-should-set-each": import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldSetEachPropertyTrue" | "shouldSetEachPropertyFalse", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
19
+ "all-properties-are-whitelisted": import("@typescript-eslint/utils/ts-eslint").RuleModule<"missing-property-decorator", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
20
+ "api-methods-should-be-guarded": import("@typescript-eslint/utils/ts-eslint").RuleModule<"apiMethodsShouldBeGuarded", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
21
+ "sort-module-metadata-arrays": import("@typescript-eslint/utils/ts-eslint").RuleModule<"moduleMetadataArraysAreSorted", import("./sortModuleMetadataArrays/sortModuleMetadataArrays").RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
22
+ };
23
+ export default allRules;
@@ -0,0 +1,9 @@
1
+ import { TSESLint } from "@typescript-eslint/utils";
2
+ type Options = [
3
+ {
4
+ src: string[];
5
+ filterFromPaths: string[];
6
+ }
7
+ ];
8
+ declare const rule: TSESLint.RuleModule<"injectableInModule" | "controllersInModule", Options, unknown, TSESLint.RuleListener>;
9
+ export default rule;
@@ -0,0 +1,9 @@
1
+ export type NoDuplicateDecoratorsOptions = [
2
+ {
3
+ customList: string[];
4
+ }
5
+ ];
6
+ export declare const shouldTrigger: () => boolean;
7
+ export declare const standardDecoratorsToValidate: string[];
8
+ declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"noDuplicateDecorators", NoDuplicateDecoratorsOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
9
+ export default rule;
@@ -0,0 +1,21 @@
1
+ import { TSESTree } from "@typescript-eslint/utils";
2
+ interface 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: import("@typescript-eslint/utils/ts-eslint").RuleModule<"paramIdentifierDoesntNeedColon" | "paramIdentifierShouldMatch", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
21
+ export default rule;
@@ -0,0 +1,10 @@
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
+ }[];
@@ -0,0 +1,4 @@
1
+ import { TSESTree } from "@typescript-eslint/utils";
2
+ export declare const hasMismatchedInjected: (node: TSESTree.VariableDeclarator) => boolean;
3
+ declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"mainMessage", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
4
+ export default rule;
@@ -0,0 +1,7 @@
1
+ import { TSESTree } 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 shouldTriggerForVariableDeclaratorExpression: (node: TSESTree.VariableDeclarator) => boolean;
6
+ declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldSpecifyForbidUnknownValues", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
7
+ export default rule;
@@ -0,0 +1,11 @@
1
+ import { TSESTree } from "@typescript-eslint/utils";
2
+ export type RuleOptions = [
3
+ {
4
+ locale?: string;
5
+ }
6
+ ];
7
+ export type ValidModuleNodeTypes = TSESTree.Identifier | TSESTree.CallExpression;
8
+ export declare const isValidModuleMetaPropertyType: (node: TSESTree.Expression | TSESTree.SpreadElement | null) => node is ValidModuleNodeTypes;
9
+ export declare const getRelevantNodeName: (node: TSESTree.Node) => string;
10
+ declare const _default: import("@typescript-eslint/utils/ts-eslint").RuleModule<"moduleMetadataArraysAreSorted", RuleOptions, unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
11
+ export default _default;
@@ -0,0 +1,5 @@
1
+ export default class ArraySetResultModel {
2
+ isArrayShouldBeSetTrue: boolean;
3
+ isArrayShouldBeSetFalse: boolean;
4
+ constructor(isArrayShouldBeSetTrue: boolean, isArrayShouldBeSetFalse: boolean);
5
+ }
@@ -0,0 +1,5 @@
1
+ import { TSESTree } from "@typescript-eslint/utils";
2
+ import ArraySetResultModel from "./arraySetResultModel";
3
+ export declare const shouldSetArrayProperty: (node: TSESTree.PropertyDefinition) => ArraySetResultModel;
4
+ declare const rule: import("@typescript-eslint/utils/ts-eslint").RuleModule<"shouldSetEachPropertyTrue" | "shouldSetEachPropertyFalse", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
5
+ export default rule;
@@ -0,0 +1,10 @@
1
+ import { ESLintUtils } from "@typescript-eslint/utils";
2
+ export type ValidateNonPrimitivePropertyTypeDecoratorOptions = [
3
+ {
4
+ additionalTypeDecorators: string[];
5
+ additionalCustomValidatorDecorators: string[];
6
+ }
7
+ ];
8
+ export declare const shouldTrigger: () => boolean;
9
+ declare const rule: ESLintUtils.RuleModule<"shouldUseTypeDecorator" | "autofixWithTypeDecorator", ValidateNonPrimitivePropertyTypeDecoratorOptions, unknown, ESLintUtils.RuleListener>;
10
+ export default rule;
@@ -0,0 +1 @@
1
+ export declare function getFixturesRootDirectory(): string;
@@ -0,0 +1 @@
1
+ import "reflect-metadata";
@@ -0,0 +1,2 @@
1
+ import { TSESTree } from "@typescript-eslint/types";
2
+ export declare function getPropertiesDefinitions(classDeclaration: TSESTree.ClassDeclaration): TSESTree.PropertyDefinition[];
@@ -0,0 +1,2 @@
1
+ import { ESLintUtils } from "@typescript-eslint/utils";
2
+ export declare const createRule: <Options extends readonly unknown[], MessageIds extends string>({ meta, name, ...rule }: Readonly<ESLintUtils.RuleWithMetaAndName<Options, MessageIds, unknown>>) => ESLintUtils.RuleModule<MessageIds, Options, unknown, ESLintUtils.RuleListener>;
@@ -0,0 +1,8 @@
1
+ interface FilePath {
2
+ ignored: boolean;
3
+ filename: string;
4
+ }
5
+ export declare class FileEnumerator {
6
+ static enumerateFiles(sourceGlobs: string[], extensions: string[], filterFromPaths: string[]): FilePath[];
7
+ }
8
+ export default FileEnumerator;
@@ -0,0 +1,4 @@
1
+ declare class IsFilteredPath {
2
+ static test: (path: string | undefined, filteredStrings: string[] | undefined) => boolean;
3
+ }
4
+ export default IsFilteredPath;
@@ -0,0 +1,5 @@
1
+ export declare class NestProvidedInjectablesMap {
2
+ controllers: Set<string>;
3
+ providers: Set<string>;
4
+ constructor(controllers: Set<string>, providers: Set<string>);
5
+ }
@@ -0,0 +1,7 @@
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): [string, NestProvidedInjectablesMap] | null;
6
+ mapModuleDecoratorOptionProperty(moduleDecorator: TSESTree.Decorator, propertyName: string): Set<string>;
7
+ };
@@ -0,0 +1,14 @@
1
+ import { TSESLint, TSESTree } from "@typescript-eslint/utils";
2
+ import { NestProvidedInjectablesMap } from "./models/NestProvidedInjectablesMap";
3
+ declare const NestProvidedInjectableMapper: {
4
+ detectDirectoryToScanForFiles(sourceGlob: string | string[] | undefined, currentWorkingDirectory: string): string[];
5
+ parseFileList(files: {
6
+ ignored: boolean;
7
+ filename: string;
8
+ }[], context: Readonly<TSESLint.RuleContext<never, any>>): Map<string, NestProvidedInjectablesMap>;
9
+ notEmpty<TValue>(value: TValue | null): value is TValue;
10
+ readFileContents(path: string): string;
11
+ isNestInjectableThatIsNeverProvided(node: TSESTree.ClassDeclaration): boolean;
12
+ mapAllProvidedInjectables(ast: TSESTree.Program, path: string): [string, NestProvidedInjectablesMap] | null;
13
+ };
14
+ export default NestProvidedInjectableMapper;
@@ -0,0 +1,7 @@
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
+ }[];
@@ -0,0 +1,7 @@
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): [string, NestProvidedInjectablesMap] | null;
5
+ findProvideProperty(providerDeclaration: TSESTree.VariableDeclarator | undefined, propertyName: string): TSESTree.Property | null;
6
+ findNestProviderVariableDeclaration(ast: TSESTree.Program): TSESTree.VariableDeclarator | undefined;
7
+ };
@@ -0,0 +1,59 @@
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
+ };
@@ -0,0 +1 @@
1
+ export declare const MODULE_CLASS_DECORATOR = "ClassDeclaration > Decorator[expression.callee.name=\"Module\"]";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@darraghor/eslint-plugin-nestjs-typed",
3
- "version": "6.0.0-rc.7",
3
+ "version": "6.0.0-rc.8",
4
4
  "description": "Eslint rules for nestjs projects",
5
5
  "scripts": {
6
6
  "clean": "rm -Rf ./dist/",
@@ -47,7 +47,15 @@
47
47
  "url": "https://darraghoriordan.com"
48
48
  },
49
49
  "main": "dist/index.js",
50
- "types": "index.d.ts",
50
+ "type": "commonjs",
51
+ "exports": {
52
+ ".": {
53
+ "types": "./dist/index.d.ts",
54
+ "default": "./dist/index.js"
55
+ },
56
+ "./package.json": "./package.json"
57
+ },
58
+ "types": "./dist/index.d.ts",
51
59
  "dependencies": {
52
60
  "@typescript-eslint/scope-manager": "^8.21.0",
53
61
  "@typescript-eslint/utils": "^8.21.0",