@darraghor/eslint-plugin-nestjs-typed 6.0.0-rc.18 → 6.0.0-rc.2
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/dist/configs/base.js +4 -3
- package/dist/configs/index.js +13 -0
- package/dist/configs/noSwagger.js +4 -4
- package/dist/configs/recommended.js +4 -4
- package/dist/index.js +64 -57
- package/dist/rules/allPropertiesAreWhitelisted/allPropertiesAreWhitelisted.js +13 -11
- package/dist/rules/allPropertiesHaveExplicitDefined/allPropertiesHaveExplicitDefined.js +17 -15
- package/dist/rules/apiEnumPropertyBestPractices/apiEnumPropertyBestPractices.js +22 -17
- package/dist/rules/apiEnumPropertyBestPractices/enumTestResultModel.js +6 -2
- package/dist/rules/apiMethodsShouldBeGuarded/apiMethodsShouldBeGuarded.js +16 -12
- package/dist/rules/apiMethodsShouldSpecifyApiOperation/apiMethodsShouldSpecifyApiOperation.js +13 -9
- package/dist/rules/apiMethodsShouldSpecifyApiResponse/apiMethodsShouldSpecifyApiResponse.js +13 -9
- package/dist/rules/apiPropertyMatchesPropertyOptionality/apiPropertyMatchesPropertyOptionality.js +18 -13
- package/dist/rules/apiPropertyReturningArrayShouldSetArray/apiPropertyReturningArrayShouldSetArray.js +24 -17
- package/dist/rules/apiPropertyReturningArrayShouldSetArray/arraySetResultModel.js +5 -2
- package/dist/rules/controllerDecoratedHasApiTags/controllerDecoratedHasApiTags.js +13 -9
- package/dist/rules/index.js +41 -36
- package/dist/rules/injectablesShouldBeProvided/injectableShouldBeProvided.js +18 -13
- package/dist/rules/noDuplicateDecorators/noDuplicateDecorators.js +14 -10
- package/dist/rules/paramDecoratorNameMatchesRouteParam/paramDecoratorNameMatchesRouteParam.js +26 -19
- package/dist/rules/paramDecoratorNameMatchesRouteParam/rule.testData.js +6 -3
- package/dist/rules/providerInjectedShouldMatchFactory/ProviderInjectedShouldMatchFactory.js +18 -12
- package/dist/rules/shouldSpecifyForbidUnknownValues/shouldSpecifyForbidUnknownValuesRule.js +27 -20
- package/dist/rules/sortModuleMetadataArrays/sortModuleMetadataArrays.js +23 -18
- package/dist/rules/validateNestedOfArrayShouldSetEach/arraySetResultModel.js +5 -2
- package/dist/rules/validateNestedOfArrayShouldSetEach/validateNestedOfArrayShouldSetEach.js +21 -14
- package/dist/rules/validateNonPrimitiveNeedsTypeDecorator/validateNonPrimitiveNeedsDecorators.js +33 -29
- package/dist/testing/fixtureSetup.js +10 -4
- package/dist/testing/preRun.js +4 -2
- package/dist/utils/ast.js +7 -4
- package/dist/utils/createRule.js +6 -3
- package/dist/utils/files/customFileEnumeratorWrapper.js +16 -9
- package/dist/utils/files/isFilteredPath.js +4 -2
- package/dist/utils/nestModules/models/NestProvidedInjectablesMap.js +6 -2
- package/dist/utils/nestModules/nestModuleAstParser.js +12 -9
- package/dist/utils/nestModules/nestProvidedInjectableMapper.js +52 -14
- package/dist/utils/nestModules/nestProvidedInjectableMapper.testData.js +12 -9
- package/dist/utils/nestModules/nestProviderAstParser.js +16 -13
- package/dist/utils/typedTokenHelpers.js +64 -25
- package/dist/utils/wellKnownSelectors.js +5 -2
- package/package.json +3 -12
- package/dist/configs/base.d.ts +0 -8
- package/dist/configs/noSwagger.d.ts +0 -7
- package/dist/configs/recommended.d.ts +0 -7
- package/dist/index.d.ts +0 -52
- package/dist/rules/allPropertiesAreWhitelisted/allPropertiesAreWhitelisted.d.ts +0 -2
- package/dist/rules/allPropertiesHaveExplicitDefined/allPropertiesHaveExplicitDefined.d.ts +0 -3
- package/dist/rules/apiEnumPropertyBestPractices/apiEnumPropertyBestPractices.d.ts +0 -6
- package/dist/rules/apiEnumPropertyBestPractices/enumTestResultModel.d.ts +0 -7
- package/dist/rules/apiMethodsShouldBeGuarded/apiMethodsShouldBeGuarded.d.ts +0 -4
- package/dist/rules/apiMethodsShouldSpecifyApiOperation/apiMethodsShouldSpecifyApiOperation.d.ts +0 -4
- package/dist/rules/apiMethodsShouldSpecifyApiResponse/apiMethodsShouldSpecifyApiResponse.d.ts +0 -4
- package/dist/rules/apiPropertyMatchesPropertyOptionality/apiPropertyMatchesPropertyOptionality.d.ts +0 -5
- package/dist/rules/apiPropertyReturningArrayShouldSetArray/apiPropertyReturningArrayShouldSetArray.d.ts +0 -5
- package/dist/rules/apiPropertyReturningArrayShouldSetArray/arraySetResultModel.d.ts +0 -5
- package/dist/rules/controllerDecoratedHasApiTags/controllerDecoratedHasApiTags.d.ts +0 -4
- package/dist/rules/index.d.ts +0 -23
- package/dist/rules/injectablesShouldBeProvided/injectableShouldBeProvided.d.ts +0 -9
- package/dist/rules/noDuplicateDecorators/noDuplicateDecorators.d.ts +0 -9
- package/dist/rules/paramDecoratorNameMatchesRouteParam/paramDecoratorNameMatchesRouteParam.d.ts +0 -21
- package/dist/rules/paramDecoratorNameMatchesRouteParam/rule.testData.d.ts +0 -10
- package/dist/rules/providerInjectedShouldMatchFactory/ProviderInjectedShouldMatchFactory.d.ts +0 -4
- package/dist/rules/shouldSpecifyForbidUnknownValues/shouldSpecifyForbidUnknownValuesRule.d.ts +0 -7
- package/dist/rules/sortModuleMetadataArrays/sortModuleMetadataArrays.d.ts +0 -11
- package/dist/rules/validateNestedOfArrayShouldSetEach/arraySetResultModel.d.ts +0 -5
- package/dist/rules/validateNestedOfArrayShouldSetEach/validateNestedOfArrayShouldSetEach.d.ts +0 -5
- package/dist/rules/validateNonPrimitiveNeedsTypeDecorator/validateNonPrimitiveNeedsDecorators.d.ts +0 -10
- package/dist/testing/fixtureSetup.d.ts +0 -1
- package/dist/testing/preRun.d.ts +0 -1
- package/dist/utils/ast.d.ts +0 -2
- package/dist/utils/createRule.d.ts +0 -2
- package/dist/utils/files/customFileEnumeratorWrapper.d.ts +0 -8
- package/dist/utils/files/isFilteredPath.d.ts +0 -4
- package/dist/utils/nestModules/models/NestProvidedInjectablesMap.d.ts +0 -5
- package/dist/utils/nestModules/nestModuleAstParser.d.ts +0 -7
- package/dist/utils/nestModules/nestProvidedInjectableMapper.d.ts +0 -14
- package/dist/utils/nestModules/nestProvidedInjectableMapper.testData.d.ts +0 -7
- package/dist/utils/nestModules/nestProviderAstParser.d.ts +0 -7
- package/dist/utils/typedTokenHelpers.d.ts +0 -59
- package/dist/utils/wellKnownSelectors.d.ts +0 -1
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { TSESLint, TSESTree } from "@typescript-eslint/utils";
|
|
2
|
-
import { NestProvidedInjectablesMap } from "./models/NestProvidedInjectablesMap.js";
|
|
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;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { NestProvidedInjectablesMap } from "./models/NestProvidedInjectablesMap.js";
|
|
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.js";
|
|
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
|
-
};
|
|
@@ -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\"]";
|