@darraghor/eslint-plugin-nestjs-typed 6.0.0-rc.1 → 6.0.0-rc.10
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.d.ts +8 -0
- package/dist/configs/base.js +1 -1
- package/dist/configs/index.d.ts +11 -0
- package/dist/configs/noSwagger.d.ts +6 -0
- package/dist/configs/noSwagger.js +14 -11
- package/dist/configs/recommended.d.ts +6 -0
- package/dist/configs/recommended.js +30 -28
- package/dist/index.d.ts +52 -0
- package/dist/index.js +91 -5
- package/dist/rules/allPropertiesAreWhitelisted/allPropertiesAreWhitelisted.d.ts +2 -0
- package/dist/rules/allPropertiesHaveExplicitDefined/allPropertiesHaveExplicitDefined.d.ts +3 -0
- package/dist/rules/apiEnumPropertyBestPractices/apiEnumPropertyBestPractices.d.ts +6 -0
- package/dist/rules/apiEnumPropertyBestPractices/enumTestResultModel.d.ts +7 -0
- package/dist/rules/apiMethodsShouldBeGuarded/apiMethodsShouldBeGuarded.d.ts +4 -0
- package/dist/rules/apiMethodsShouldSpecifyApiOperation/apiMethodsShouldSpecifyApiOperation.d.ts +4 -0
- package/dist/rules/apiMethodsShouldSpecifyApiResponse/apiMethodsShouldSpecifyApiResponse.d.ts +4 -0
- package/dist/rules/apiPropertyMatchesPropertyOptionality/apiPropertyMatchesPropertyOptionality.d.ts +5 -0
- package/dist/rules/apiPropertyReturningArrayShouldSetArray/apiPropertyReturningArrayShouldSetArray.d.ts +5 -0
- package/dist/rules/apiPropertyReturningArrayShouldSetArray/arraySetResultModel.d.ts +5 -0
- package/dist/rules/controllerDecoratedHasApiTags/controllerDecoratedHasApiTags.d.ts +4 -0
- package/dist/rules/index.d.ts +23 -0
- package/dist/rules/injectablesShouldBeProvided/injectableShouldBeProvided.d.ts +9 -0
- package/dist/rules/noDuplicateDecorators/noDuplicateDecorators.d.ts +9 -0
- package/dist/rules/paramDecoratorNameMatchesRouteParam/paramDecoratorNameMatchesRouteParam.d.ts +21 -0
- package/dist/rules/paramDecoratorNameMatchesRouteParam/rule.testData.d.ts +10 -0
- package/dist/rules/providerInjectedShouldMatchFactory/ProviderInjectedShouldMatchFactory.d.ts +4 -0
- package/dist/rules/shouldSpecifyForbidUnknownValues/shouldSpecifyForbidUnknownValuesRule.d.ts +7 -0
- package/dist/rules/sortModuleMetadataArrays/sortModuleMetadataArrays.d.ts +11 -0
- package/dist/rules/validateNestedOfArrayShouldSetEach/arraySetResultModel.d.ts +5 -0
- package/dist/rules/validateNestedOfArrayShouldSetEach/validateNestedOfArrayShouldSetEach.d.ts +5 -0
- package/dist/rules/validateNonPrimitiveNeedsTypeDecorator/validateNonPrimitiveNeedsDecorators.d.ts +10 -0
- package/dist/testing/fixtureSetup.d.ts +1 -0
- package/dist/testing/preRun.d.ts +1 -0
- package/dist/utils/ast.d.ts +2 -0
- package/dist/utils/createRule.d.ts +2 -0
- package/dist/utils/files/customFileEnumeratorWrapper.d.ts +8 -0
- package/dist/utils/files/isFilteredPath.d.ts +4 -0
- package/dist/utils/nestModules/models/NestProvidedInjectablesMap.d.ts +5 -0
- package/dist/utils/nestModules/nestModuleAstParser.d.ts +7 -0
- package/dist/utils/nestModules/nestProvidedInjectableMapper.d.ts +14 -0
- package/dist/utils/nestModules/nestProvidedInjectableMapper.testData.d.ts +7 -0
- package/dist/utils/nestModules/nestProviderAstParser.d.ts +7 -0
- package/dist/utils/typedTokenHelpers.d.ts +59 -0
- package/dist/utils/wellKnownSelectors.d.ts +1 -0
- package/package.json +10 -2
package/dist/configs/base.js
CHANGED
|
@@ -4,4 +4,4 @@ module.exports = {
|
|
|
4
4
|
parserOptions: { sourceType: "module" },
|
|
5
5
|
plugins: ["@typescript-eslint"],
|
|
6
6
|
};
|
|
7
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
7
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmFzZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb25maWdzL2Jhc2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUVBLGlCQUFTO0lBQ0wsTUFBTSxFQUFFLDJCQUEyQjtJQUNuQyxhQUFhLEVBQUUsRUFBQyxVQUFVLEVBQUUsUUFBUSxFQUFDO0lBQ3JDLE9BQU8sRUFBRSxDQUFDLG9CQUFvQixDQUFDO0NBQ0gsQ0FBQyJ9
|
|
@@ -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;
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
},
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
// Should turn off swagger rules for folks not using swagger typings
|
|
4
|
+
const rules = {
|
|
5
|
+
"@darraghor/nestjs-typed/api-property-matches-property-optionality": "off",
|
|
6
|
+
"@darraghor/nestjs-typed/api-method-should-specify-api-response": "off",
|
|
7
|
+
"@darraghor/nestjs-typed/api-method-should-specify-api-operation": "off",
|
|
8
|
+
"@darraghor/nestjs-typed/controllers-should-supply-api-tags": "off",
|
|
9
|
+
"@darraghor/nestjs-typed/api-enum-property-best-practices": "off",
|
|
10
|
+
"@darraghor/nestjs-typed/api-property-returning-array-should-set-array": "off",
|
|
12
11
|
};
|
|
13
|
-
|
|
12
|
+
exports.default = {
|
|
13
|
+
extends: ["./configs/base"],
|
|
14
|
+
rules,
|
|
15
|
+
};
|
|
16
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibm9Td2FnZ2VyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbmZpZ3Mvbm9Td2FnZ2VyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBRUEsb0VBQW9FO0FBQ3BFLE1BQU0sS0FBSyxHQUFnQztJQUN2QyxtRUFBbUUsRUFBRSxLQUFLO0lBQzFFLGdFQUFnRSxFQUFFLEtBQUs7SUFDdkUsaUVBQWlFLEVBQUUsS0FBSztJQUN4RSw0REFBNEQsRUFBRSxLQUFLO0lBQ25FLDBEQUEwRCxFQUFFLEtBQUs7SUFDakUsdUVBQXVFLEVBQ25FLEtBQUs7Q0FDWixDQUFDO0FBRUYsa0JBQWU7SUFDWCxPQUFPLEVBQUUsQ0FBQyxnQkFBZ0IsQ0FBQztJQUMzQixLQUFLO0NBQ1IsQ0FBQyJ9
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"@darraghor/nestjs-typed/no-duplicate-decorators": "error",
|
|
28
|
-
},
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const rules = {
|
|
4
|
+
"@darraghor/nestjs-typed/provided-injected-should-match-factory-parameters": "error",
|
|
5
|
+
"@darraghor/nestjs-typed/injectable-should-be-provided": [
|
|
6
|
+
"error",
|
|
7
|
+
{
|
|
8
|
+
src: ["src/**/*.ts"],
|
|
9
|
+
filterFromPaths: ["node_modules", ".test.", ".spec."],
|
|
10
|
+
},
|
|
11
|
+
],
|
|
12
|
+
"@darraghor/nestjs-typed/api-property-matches-property-optionality": "error",
|
|
13
|
+
"@darraghor/nestjs-typed/api-method-should-specify-api-response": "error",
|
|
14
|
+
"@darraghor/nestjs-typed/controllers-should-supply-api-tags": "error",
|
|
15
|
+
"@darraghor/nestjs-typed/api-enum-property-best-practices": "error",
|
|
16
|
+
"@darraghor/nestjs-typed/api-property-returning-array-should-set-array": "error",
|
|
17
|
+
"@darraghor/nestjs-typed/should-specify-forbid-unknown-values": "error",
|
|
18
|
+
"@darraghor/nestjs-typed/param-decorator-name-matches-route-param": "error",
|
|
19
|
+
"@darraghor/nestjs-typed/validated-non-primitive-property-needs-type-decorator": "error",
|
|
20
|
+
"@darraghor/nestjs-typed/validate-nested-of-array-should-set-each": "error",
|
|
21
|
+
"@darraghor/nestjs-typed/all-properties-are-whitelisted": "error",
|
|
22
|
+
"@darraghor/nestjs-typed/all-properties-have-explicit-defined": "error",
|
|
23
|
+
"@darraghor/nestjs-typed/api-methods-should-be-guarded": "off",
|
|
24
|
+
"@darraghor/nestjs-typed/api-method-should-specify-api-operation": "off",
|
|
25
|
+
"@darraghor/nestjs-typed/sort-module-metadata-arrays": "off",
|
|
26
|
+
"@darraghor/nestjs-typed/no-duplicate-decorators": "error",
|
|
29
27
|
};
|
|
30
|
-
|
|
28
|
+
exports.default = {
|
|
29
|
+
extends: ["./configs/base"],
|
|
30
|
+
rules,
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVjb21tZW5kZWQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29uZmlncy9yZWNvbW1lbmRlZC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOztBQUVBLE1BQU0sS0FBSyxHQUFnQztJQUN2QywyRUFBMkUsRUFDdkUsT0FBTztJQUNYLHVEQUF1RCxFQUFFO1FBQ3JELE9BQU87UUFDUDtZQUNJLEdBQUcsRUFBRSxDQUFDLGFBQWEsQ0FBQztZQUNwQixlQUFlLEVBQUUsQ0FBQyxjQUFjLEVBQUUsUUFBUSxFQUFFLFFBQVEsQ0FBQztTQUN4RDtLQUNKO0lBQ0QsbUVBQW1FLEVBQy9ELE9BQU87SUFDWCxnRUFBZ0UsRUFBRSxPQUFPO0lBQ3pFLDREQUE0RCxFQUFFLE9BQU87SUFDckUsMERBQTBELEVBQUUsT0FBTztJQUNuRSx1RUFBdUUsRUFDbkUsT0FBTztJQUNYLDhEQUE4RCxFQUFFLE9BQU87SUFDdkUsa0VBQWtFLEVBQUUsT0FBTztJQUMzRSwrRUFBK0UsRUFDM0UsT0FBTztJQUNYLGtFQUFrRSxFQUFFLE9BQU87SUFDM0Usd0RBQXdELEVBQUUsT0FBTztJQUNqRSw4REFBOEQsRUFBRSxPQUFPO0lBQ3ZFLHVEQUF1RCxFQUFFLEtBQUs7SUFDOUQsaUVBQWlFLEVBQUUsS0FBSztJQUN4RSxxREFBcUQsRUFBRSxLQUFLO0lBQzVELGlEQUFpRCxFQUFFLE9BQU87Q0FDN0QsQ0FBQztBQUNGLGtCQUFlO0lBQ1gsT0FBTyxFQUFFLENBQUMsZ0JBQWdCLENBQUM7SUFDM0IsS0FBSztDQUNSLENBQUMifQ==
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
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 { classicPlugin };
|
|
44
|
+
export type ConfigArray = TSESLint.FlatConfig.ConfigArray;
|
|
45
|
+
declare const _default: {
|
|
46
|
+
plugin: FlatConfig.Plugin;
|
|
47
|
+
configs: {
|
|
48
|
+
flatRecommended: ConfigArray;
|
|
49
|
+
flatNoSwagger: ConfigArray;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export default _default;
|
package/dist/index.js
CHANGED
|
@@ -1,12 +1,98 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
5
|
-
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.classicPlugin = exports.plugin = exports.parser = void 0;
|
|
6
40
|
const configs_1 = __importDefault(require("./configs"));
|
|
7
|
-
const
|
|
41
|
+
const rules_1 = __importDefault(require("./rules"));
|
|
42
|
+
const parserBase = __importStar(require("@typescript-eslint/parser"));
|
|
43
|
+
const eslint_plugin_1 = __importDefault(require("@typescript-eslint/eslint-plugin"));
|
|
44
|
+
// Most of this is copied and simplified from https://github.com/typescript-eslint/typescript-eslint/blob/v8.22.0/packages/typescript-eslint/src/configs/recommended.ts
|
|
45
|
+
// note - cannot migrate this to an import statement because it will make TSC copy the package.json to the dist folder
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
47
|
+
const { name, version } = require("../package.json");
|
|
48
|
+
const meta = {
|
|
49
|
+
name,
|
|
50
|
+
version,
|
|
51
|
+
};
|
|
52
|
+
exports.parser = {
|
|
53
|
+
meta: parserBase.meta,
|
|
54
|
+
parseForESLint: parserBase.parseForESLint,
|
|
55
|
+
};
|
|
56
|
+
exports.plugin = eslint_plugin_1.default;
|
|
57
|
+
const classicPlugin = {
|
|
58
|
+
configs: {
|
|
59
|
+
recommended: configs_1.default.recommended,
|
|
60
|
+
"no-swagger": configs_1.default["no-swagger"],
|
|
61
|
+
},
|
|
8
62
|
rules: rules_1.default,
|
|
9
|
-
|
|
63
|
+
meta,
|
|
64
|
+
};
|
|
65
|
+
exports.classicPlugin = classicPlugin;
|
|
66
|
+
const flatBaseConfig = (plugin, parser) => {
|
|
67
|
+
const baseConfig = {
|
|
68
|
+
name: "@darraghor/nestjs-typed/base",
|
|
69
|
+
languageOptions: {
|
|
70
|
+
parser,
|
|
71
|
+
sourceType: "module",
|
|
72
|
+
},
|
|
73
|
+
plugins: {
|
|
74
|
+
"@darraghor/nestjs-typed": plugin,
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
return baseConfig;
|
|
78
|
+
};
|
|
79
|
+
// export the flat configs
|
|
80
|
+
exports.default = {
|
|
81
|
+
plugin: exports.plugin,
|
|
82
|
+
configs: {
|
|
83
|
+
flatRecommended: [
|
|
84
|
+
flatBaseConfig(exports.plugin, exports.parser),
|
|
85
|
+
{
|
|
86
|
+
name: "@darraghor/nestjs-typed/recommended",
|
|
87
|
+
rules: configs_1.default.recommended.rules,
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
flatNoSwagger: [
|
|
91
|
+
{
|
|
92
|
+
name: "@darraghor/nestjs-typed/no-swagger",
|
|
93
|
+
rules: configs_1.default["no-swagger"].rules,
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
},
|
|
10
97
|
};
|
|
11
|
-
|
|
12
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLG9EQUE0QjtBQUM1Qix3REFBZ0M7QUFFaEMsTUFBTSxhQUFhLEdBQUc7SUFDbEIsS0FBSyxFQUFMLGVBQUs7SUFDTCxPQUFPLEVBQVAsaUJBQU87Q0FDVixDQUFDO0FBRUYsaUJBQVMsYUFBYSxDQUFDIn0=
|
|
98
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0FBQ0Esd0RBQWdDO0FBQ2hDLG9EQUE0QjtBQUU1QixzRUFBd0Q7QUFDeEQscUZBQTBEO0FBRTFELHVLQUF1SztBQUV2SyxzSEFBc0g7QUFDdEgsaUVBQWlFO0FBQ2pFLE1BQU0sRUFBQyxJQUFJLEVBQUUsT0FBTyxFQUFDLEdBQUcsT0FBTyxDQUFDLGlCQUFpQixDQUdoRCxDQUFDO0FBQ0YsTUFBTSxJQUFJLEdBQUc7SUFDVCxJQUFJO0lBQ0osT0FBTztDQUNWLENBQUM7QUFDVyxRQUFBLE1BQU0sR0FBK0I7SUFDOUMsSUFBSSxFQUFFLFVBQVUsQ0FBQyxJQUFJO0lBQ3JCLGNBQWMsRUFBRSxVQUFVLENBQUMsY0FBYztDQUM1QyxDQUFDO0FBRVcsUUFBQSxNQUFNLEdBQStCLHVCQUdqRCxDQUFDO0FBQ0YsTUFBTSxhQUFhLEdBQUc7SUFDbEIsT0FBTyxFQUFFO1FBQ0wsV0FBVyxFQUFFLGlCQUFPLENBQUMsV0FBVztRQUNoQyxZQUFZLEVBQUUsaUJBQU8sQ0FBQyxZQUFZLENBQUM7S0FDdEM7SUFDRCxLQUFLLEVBQUwsZUFBSztJQUNMLElBQUk7Q0FDaUIsQ0FBQztBQW9CbEIsc0NBQWE7QUFsQnJCLE1BQU0sY0FBYyxHQUFHLENBQ25CLE1BQXlCLEVBQ3pCLE1BQXlCLEVBQ1IsRUFBRTtJQUNuQixNQUFNLFVBQVUsR0FBc0I7UUFDbEMsSUFBSSxFQUFFLDhCQUE4QjtRQUNwQyxlQUFlLEVBQUU7WUFDYixNQUFNO1lBQ04sVUFBVSxFQUFFLFFBQVE7U0FDdkI7UUFDRCxPQUFPLEVBQUU7WUFDTCx5QkFBeUIsRUFBRSxNQUFNO1NBQ3BDO0tBQ0osQ0FBQztJQUNGLE9BQU8sVUFBVSxDQUFDO0FBQ3RCLENBQUMsQ0FBQztBQUtGLDBCQUEwQjtBQUMxQixrQkFBZTtJQUNYLE1BQU0sRUFBTixjQUFNO0lBQ04sT0FBTyxFQUFFO1FBQ0wsZUFBZSxFQUFFO1lBQ2IsY0FBYyxDQUFDLGNBQU0sRUFBRSxjQUFNLENBQUM7WUFDOUI7Z0JBQ0ksSUFBSSxFQUFFLHFDQUFxQztnQkFDM0MsS0FBSyxFQUFFLGlCQUFPLENBQUMsV0FBVyxDQUFDLEtBQUs7YUFDbkM7U0FDSjtRQUNELGFBQWEsRUFBRTtZQUNYO2dCQUNJLElBQUksRUFBRSxvQ0FBb0M7Z0JBQzFDLEtBQUssRUFBRSxpQkFBTyxDQUFDLFlBQVksQ0FBQyxDQUFDLEtBQUs7YUFDckM7U0FDSjtLQUlKO0NBQ0osQ0FBQyJ9
|
|
@@ -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,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;
|
package/dist/rules/apiMethodsShouldSpecifyApiOperation/apiMethodsShouldSpecifyApiOperation.d.ts
ADDED
|
@@ -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;
|
package/dist/rules/apiPropertyMatchesPropertyOptionality/apiPropertyMatchesPropertyOptionality.d.ts
ADDED
|
@@ -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,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;
|
package/dist/rules/paramDecoratorNameMatchesRouteParam/paramDecoratorNameMatchesRouteParam.d.ts
ADDED
|
@@ -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,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
|
+
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;
|
package/dist/rules/validateNonPrimitiveNeedsTypeDecorator/validateNonPrimitiveNeedsDecorators.d.ts
ADDED
|
@@ -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 { 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,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.
|
|
3
|
+
"version": "6.0.0-rc.10",
|
|
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
|
-
"
|
|
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",
|