eslint-cdk-plugin 3.1.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +210 -25
- package/dist/index.d.ts +12 -76
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +210 -25
- package/package.json +1 -1
- package/src/index.ts +17 -2
- package/src/rules/construct-constructor-property.ts +2 -8
- package/src/rules/no-construct-in-public-property-of-construct.ts +2 -5
- package/src/rules/no-construct-stack-suffix.ts +1 -1
- package/src/rules/no-unused-props.ts +176 -0
- package/src/rules/no-variable-construct-id.ts +1 -1
- package/src/rules/pascal-case-construct-id.ts +1 -1
- package/src/rules/props-name-convention.ts +5 -11
- package/src/rules/require-jsdoc.ts +11 -7
- package/src/rules/require-passing-this.ts +1 -1
- package/src/rules/require-props-default-doc.ts +6 -14
- package/src/utils/getConstructor.ts +16 -0
- package/src/utils/{parseType.ts → getPropertyNames.ts} +20 -0
- package/src/utils/propsUsageTracker.ts +188 -0
- package/src/utils/typeCheck.ts +7 -2
package/dist/index.cjs
CHANGED
|
@@ -26,13 +26,19 @@ function _interopNamespaceDefault(e) {
|
|
|
26
26
|
var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
|
|
27
27
|
|
|
28
28
|
var name = "eslint-cdk-plugin";
|
|
29
|
-
var version = "3.
|
|
29
|
+
var version = "3.3.0";
|
|
30
30
|
|
|
31
31
|
const createRule = utils.ESLintUtils.RuleCreator(
|
|
32
32
|
(name) => `https://eslint-cdk-plugin.dev/rules/${name}`
|
|
33
33
|
);
|
|
34
34
|
|
|
35
|
-
const
|
|
35
|
+
const getConstructor = (node) => {
|
|
36
|
+
return node.body.body.find(
|
|
37
|
+
(member) => member.type === utils.AST_NODE_TYPES.MethodDefinition && member.kind === "constructor"
|
|
38
|
+
);
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
const isConstructOrStackType = (type, ignoredClasses = ["App", "Stage", "CfnOutput"]) => {
|
|
36
42
|
if (ignoredClasses.includes(type.symbol?.name ?? "")) return false;
|
|
37
43
|
return isTargetSuperClassType(
|
|
38
44
|
type,
|
|
@@ -40,7 +46,12 @@ const isConstructOrStackType = (type, ignoredClasses = ["App", "Stage"]) => {
|
|
|
40
46
|
isConstructOrStackType
|
|
41
47
|
);
|
|
42
48
|
};
|
|
43
|
-
const isConstructType = (type, ignoredClasses = [
|
|
49
|
+
const isConstructType = (type, ignoredClasses = [
|
|
50
|
+
"App",
|
|
51
|
+
"Stage",
|
|
52
|
+
"CfnOutput",
|
|
53
|
+
"Stack"
|
|
54
|
+
]) => {
|
|
44
55
|
if (ignoredClasses.includes(type.symbol?.name ?? "")) return false;
|
|
45
56
|
return isTargetSuperClassType(type, ["Construct"], isConstructType);
|
|
46
57
|
};
|
|
@@ -74,9 +85,7 @@ const constructConstructorProperty = createRule({
|
|
|
74
85
|
ClassDeclaration(node) {
|
|
75
86
|
const type = parserServices.getTypeAtLocation(node);
|
|
76
87
|
if (!isConstructType(type)) return;
|
|
77
|
-
const constructor = node
|
|
78
|
-
(member) => member.type === utils.AST_NODE_TYPES.MethodDefinition && member.kind === "constructor"
|
|
79
|
-
);
|
|
88
|
+
const constructor = getConstructor(node);
|
|
80
89
|
if (!constructor) return;
|
|
81
90
|
validateConstructorProperty(constructor, context, parserServices);
|
|
82
91
|
}
|
|
@@ -197,9 +206,7 @@ const noConstructInPublicPropertyOfConstruct = createRule({
|
|
|
197
206
|
const type = parserServices.getTypeAtLocation(node);
|
|
198
207
|
if (!isConstructOrStackType(type)) return;
|
|
199
208
|
validatePublicPropertyOfConstruct(node, context, parserServices);
|
|
200
|
-
const constructor = node
|
|
201
|
-
(member) => member.type === utils.AST_NODE_TYPES.MethodDefinition && member.kind === "constructor"
|
|
202
|
-
);
|
|
209
|
+
const constructor = getConstructor(node);
|
|
203
210
|
if (!constructor || constructor.value.type !== utils.AST_NODE_TYPES.FunctionExpression) {
|
|
204
211
|
return;
|
|
205
212
|
}
|
|
@@ -267,6 +274,12 @@ const toPascalCase = (str) => {
|
|
|
267
274
|
}).join("");
|
|
268
275
|
};
|
|
269
276
|
|
|
277
|
+
const getPropertyNames = (properties) => {
|
|
278
|
+
return properties.reduce(
|
|
279
|
+
(acc, prop) => prop.type === utils.AST_NODE_TYPES.Property && prop.key.type === utils.AST_NODE_TYPES.Identifier ? [...acc, prop.key.name] : acc,
|
|
280
|
+
[]
|
|
281
|
+
);
|
|
282
|
+
};
|
|
270
283
|
const getConstructorPropertyNames = (type) => {
|
|
271
284
|
const declarations = type.symbol?.declarations;
|
|
272
285
|
if (!declarations?.length) return [];
|
|
@@ -788,6 +801,176 @@ const validateConstructId$2 = ({
|
|
|
788
801
|
}
|
|
789
802
|
};
|
|
790
803
|
|
|
804
|
+
const propsUsageTrackerFactory = (propsType) => {
|
|
805
|
+
const getPropsPropertyNames = (propsType2) => {
|
|
806
|
+
const typeProperties = propsType2.getProperties();
|
|
807
|
+
if (typeProperties.length) {
|
|
808
|
+
return typeProperties.reduce(
|
|
809
|
+
(acc, prop) => !isInternalProperty(prop.name) ? [...acc, prop.name] : acc,
|
|
810
|
+
[]
|
|
811
|
+
);
|
|
812
|
+
}
|
|
813
|
+
const symbol = propsType2.getSymbol();
|
|
814
|
+
if (!symbol?.members) return [];
|
|
815
|
+
return Array.from(symbol.members.keys()).reduce((acc, key) => {
|
|
816
|
+
const name = String(key);
|
|
817
|
+
return !isInternalProperty(name) ? [...acc, name] : acc;
|
|
818
|
+
}, []);
|
|
819
|
+
};
|
|
820
|
+
const isInternalProperty = (propertyName) => {
|
|
821
|
+
return propertyName.startsWith("_") || propertyName === "constructor" || propertyName === "prototype";
|
|
822
|
+
};
|
|
823
|
+
const markAsUsed = (propertyName) => {
|
|
824
|
+
if (propUsages.has(propertyName)) propUsages.set(propertyName, true);
|
|
825
|
+
};
|
|
826
|
+
const propUsages = new Map(
|
|
827
|
+
getPropsPropertyNames(propsType).map((name) => [name, false])
|
|
828
|
+
);
|
|
829
|
+
const getUnusedProperties = () => {
|
|
830
|
+
return Array.from(propUsages.entries()).reduce(
|
|
831
|
+
(acc, [name, used]) => !used ? [...acc, name] : acc,
|
|
832
|
+
[]
|
|
833
|
+
);
|
|
834
|
+
};
|
|
835
|
+
const markAsUsedForMemberExpression = (node, propsParamName) => {
|
|
836
|
+
if (node.object.type === utils.AST_NODE_TYPES.Identifier && node.object.name === propsParamName && node.property.type === utils.AST_NODE_TYPES.Identifier) {
|
|
837
|
+
markAsUsed(node.property.name);
|
|
838
|
+
return;
|
|
839
|
+
}
|
|
840
|
+
if (node.object.type === utils.AST_NODE_TYPES.MemberExpression && node.object.object.type === utils.AST_NODE_TYPES.ThisExpression && node.object.property.type === utils.AST_NODE_TYPES.Identifier && node.object.property.name === "props" && node.property.type === utils.AST_NODE_TYPES.Identifier) {
|
|
841
|
+
markAsUsed(node.property.name);
|
|
842
|
+
return;
|
|
843
|
+
}
|
|
844
|
+
};
|
|
845
|
+
const markAsUsedForVariableDeclarator = (node, propsParamName) => {
|
|
846
|
+
if (node.id.type !== utils.AST_NODE_TYPES.ObjectPattern || node.init?.type !== utils.AST_NODE_TYPES.Identifier || node.init.name !== propsParamName) {
|
|
847
|
+
return;
|
|
848
|
+
}
|
|
849
|
+
const propertyNames = getPropertyNames(node.id.properties);
|
|
850
|
+
for (const name of propertyNames) {
|
|
851
|
+
markAsUsed(name);
|
|
852
|
+
}
|
|
853
|
+
};
|
|
854
|
+
const markAsUsedForAssignmentExpression = (node, propsParamName) => {
|
|
855
|
+
if (node.right.type !== utils.AST_NODE_TYPES.MemberExpression || node.right.object.type !== utils.AST_NODE_TYPES.Identifier || node.right.object.name !== propsParamName || node.right.property.type !== utils.AST_NODE_TYPES.Identifier) {
|
|
856
|
+
return;
|
|
857
|
+
}
|
|
858
|
+
markAsUsed(node.right.property.name);
|
|
859
|
+
};
|
|
860
|
+
const markAsUsedForObjectPattern = (node) => {
|
|
861
|
+
for (const propName of getPropertyNames(node.properties)) {
|
|
862
|
+
markAsUsed(propName);
|
|
863
|
+
}
|
|
864
|
+
};
|
|
865
|
+
if (!propUsages.size) return null;
|
|
866
|
+
return {
|
|
867
|
+
getUnusedProperties,
|
|
868
|
+
markAsUsedForMemberExpression,
|
|
869
|
+
markAsUsedForVariableDeclarator,
|
|
870
|
+
markAsUsedForAssignmentExpression,
|
|
871
|
+
markAsUsedForObjectPattern
|
|
872
|
+
};
|
|
873
|
+
};
|
|
874
|
+
|
|
875
|
+
const noUnusedProps = createRule({
|
|
876
|
+
name: "no-unused-props",
|
|
877
|
+
meta: {
|
|
878
|
+
type: "suggestion",
|
|
879
|
+
docs: {
|
|
880
|
+
description: "Enforces that all properties defined in props type are used within the constructor"
|
|
881
|
+
},
|
|
882
|
+
messages: {
|
|
883
|
+
unusedProp: "Property '{{propName}}' is defined in props but never used"
|
|
884
|
+
},
|
|
885
|
+
schema: []
|
|
886
|
+
},
|
|
887
|
+
defaultOptions: [],
|
|
888
|
+
create(context) {
|
|
889
|
+
const parserServices = utils.ESLintUtils.getParserServices(context);
|
|
890
|
+
return {
|
|
891
|
+
ClassDeclaration(node) {
|
|
892
|
+
const type = parserServices.getTypeAtLocation(node);
|
|
893
|
+
if (!isConstructType(type)) return;
|
|
894
|
+
const constructor = getConstructor(node);
|
|
895
|
+
if (!constructor) return;
|
|
896
|
+
analyzePropsUsage(constructor, context, parserServices);
|
|
897
|
+
}
|
|
898
|
+
};
|
|
899
|
+
}
|
|
900
|
+
});
|
|
901
|
+
const analyzePropsUsage = (constructor, context, parserServices) => {
|
|
902
|
+
const params = constructor.value.params;
|
|
903
|
+
if (params.length < 3) return;
|
|
904
|
+
const propsParam = params[2];
|
|
905
|
+
switch (propsParam.type) {
|
|
906
|
+
case utils.AST_NODE_TYPES.Identifier: {
|
|
907
|
+
const propsType = parserServices.getTypeAtLocation(propsParam);
|
|
908
|
+
const tracker = propsUsageTrackerFactory(propsType);
|
|
909
|
+
if (!tracker || !constructor.value.body) return;
|
|
910
|
+
analyzeConstructorBody(constructor.value.body, propsParam.name, tracker);
|
|
911
|
+
reportUnusedProperties(tracker, propsParam, context);
|
|
912
|
+
return;
|
|
913
|
+
}
|
|
914
|
+
case utils.AST_NODE_TYPES.ObjectPattern: {
|
|
915
|
+
const typeAnnotation = propsParam.typeAnnotation?.typeAnnotation;
|
|
916
|
+
if (!typeAnnotation) return;
|
|
917
|
+
const propsType = parserServices.getTypeAtLocation(typeAnnotation);
|
|
918
|
+
const tracker = propsUsageTrackerFactory(propsType);
|
|
919
|
+
if (!tracker) return;
|
|
920
|
+
tracker.markAsUsedForObjectPattern(propsParam);
|
|
921
|
+
reportUnusedProperties(tracker, propsParam, context);
|
|
922
|
+
return;
|
|
923
|
+
}
|
|
924
|
+
default:
|
|
925
|
+
return;
|
|
926
|
+
}
|
|
927
|
+
};
|
|
928
|
+
const analyzeConstructorBody = (body, propsParamName, tracker) => {
|
|
929
|
+
const visited = /* @__PURE__ */ new Set();
|
|
930
|
+
const visitNode = (node) => {
|
|
931
|
+
if (visited.has(node)) return;
|
|
932
|
+
visited.add(node);
|
|
933
|
+
switch (node.type) {
|
|
934
|
+
case utils.AST_NODE_TYPES.MemberExpression:
|
|
935
|
+
tracker.markAsUsedForMemberExpression(node, propsParamName);
|
|
936
|
+
break;
|
|
937
|
+
case utils.AST_NODE_TYPES.VariableDeclarator:
|
|
938
|
+
tracker.markAsUsedForVariableDeclarator(node, propsParamName);
|
|
939
|
+
break;
|
|
940
|
+
case utils.AST_NODE_TYPES.AssignmentExpression:
|
|
941
|
+
tracker.markAsUsedForAssignmentExpression(node, propsParamName);
|
|
942
|
+
break;
|
|
943
|
+
}
|
|
944
|
+
const children = getChildNodes(node);
|
|
945
|
+
for (const child of children) {
|
|
946
|
+
visitNode(child);
|
|
947
|
+
}
|
|
948
|
+
};
|
|
949
|
+
visitNode(body);
|
|
950
|
+
};
|
|
951
|
+
const reportUnusedProperties = (tracker, propsParam, context) => {
|
|
952
|
+
for (const propName of tracker.getUnusedProperties()) {
|
|
953
|
+
context.report({
|
|
954
|
+
node: propsParam,
|
|
955
|
+
messageId: "unusedProp",
|
|
956
|
+
data: {
|
|
957
|
+
propName
|
|
958
|
+
}
|
|
959
|
+
});
|
|
960
|
+
}
|
|
961
|
+
};
|
|
962
|
+
const getChildNodes = (node) => {
|
|
963
|
+
return Object.entries(node).reduce((acc, [key, value]) => {
|
|
964
|
+
if (["parent", "range", "loc"].includes(key)) return acc;
|
|
965
|
+
if (isESTreeNode(value)) return [...acc, value];
|
|
966
|
+
if (Array.isArray(value)) return [...acc, ...value.filter(isESTreeNode)];
|
|
967
|
+
return acc;
|
|
968
|
+
}, []);
|
|
969
|
+
};
|
|
970
|
+
const isESTreeNode = (value) => {
|
|
971
|
+
return value !== null && typeof value === "object" && "type" in value && typeof value.type === "string";
|
|
972
|
+
};
|
|
973
|
+
|
|
791
974
|
const noVariableConstructId = createRule({
|
|
792
975
|
name: "no-variable-construct-id",
|
|
793
976
|
meta: {
|
|
@@ -924,10 +1107,9 @@ const propsNameConvention = createRule({
|
|
|
924
1107
|
if (!node.id || !node.superClass) return;
|
|
925
1108
|
const type = parserServices.getTypeAtLocation(node.superClass);
|
|
926
1109
|
if (!isConstructType(type)) return;
|
|
927
|
-
const constructor = node
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
const propsParam = constructor?.value.params?.[2];
|
|
1110
|
+
const constructor = getConstructor(node);
|
|
1111
|
+
if (!constructor) return;
|
|
1112
|
+
const propsParam = constructor.value.params?.[2];
|
|
931
1113
|
if (propsParam?.type !== utils.AST_NODE_TYPES.Identifier) return;
|
|
932
1114
|
const typeAnnotation = propsParam.typeAnnotation;
|
|
933
1115
|
if (typeAnnotation?.type !== utils.AST_NODE_TYPES.TSTypeAnnotation) return;
|
|
@@ -969,9 +1151,10 @@ const requireJSDoc = createRule({
|
|
|
969
1151
|
const parserServices = utils.ESLintUtils.getParserServices(context);
|
|
970
1152
|
return {
|
|
971
1153
|
TSPropertySignature(node) {
|
|
972
|
-
if (node.key.type !== utils.AST_NODE_TYPES.Identifier
|
|
973
|
-
|
|
974
|
-
|
|
1154
|
+
if (node.key.type !== utils.AST_NODE_TYPES.Identifier) return;
|
|
1155
|
+
const parent = node.parent.parent;
|
|
1156
|
+
if (parent.type !== utils.AST_NODE_TYPES.TSInterfaceDeclaration) return;
|
|
1157
|
+
if (!parent.id.name.endsWith("Props")) return;
|
|
975
1158
|
const sourceCode = context.sourceCode;
|
|
976
1159
|
const comments = sourceCode.getCommentsBefore(node);
|
|
977
1160
|
const hasJSDoc = comments.some(
|
|
@@ -996,7 +1179,8 @@ const requireJSDoc = createRule({
|
|
|
996
1179
|
return;
|
|
997
1180
|
}
|
|
998
1181
|
const classType = parserServices.getTypeAtLocation(classDeclaration);
|
|
999
|
-
|
|
1182
|
+
const accessibility = node.accessibility ?? "public";
|
|
1183
|
+
if (!isConstructType(classType) || accessibility !== "public") {
|
|
1000
1184
|
return;
|
|
1001
1185
|
}
|
|
1002
1186
|
const sourceCode = context.sourceCode;
|
|
@@ -1100,14 +1284,11 @@ const requirePropsDefaultDoc = createRule({
|
|
|
1100
1284
|
create(context) {
|
|
1101
1285
|
return {
|
|
1102
1286
|
TSPropertySignature(node) {
|
|
1287
|
+
if (node.key.type !== utils.AST_NODE_TYPES.Identifier) return;
|
|
1103
1288
|
if (!node.optional) return;
|
|
1104
|
-
const parent = node.parent
|
|
1105
|
-
if (parent
|
|
1106
|
-
|
|
1107
|
-
}
|
|
1108
|
-
if (parent.id.type !== utils.AST_NODE_TYPES.Identifier || !parent.id.name.endsWith("Props")) {
|
|
1109
|
-
return;
|
|
1110
|
-
}
|
|
1289
|
+
const parent = node.parent.parent;
|
|
1290
|
+
if (parent.type !== utils.AST_NODE_TYPES.TSInterfaceDeclaration) return;
|
|
1291
|
+
if (!parent.id.name.endsWith("Props")) return;
|
|
1111
1292
|
const sourceCode = context.sourceCode;
|
|
1112
1293
|
const comments = sourceCode.getCommentsBefore(node);
|
|
1113
1294
|
const hasDefaultDoc = comments.some(
|
|
@@ -1118,7 +1299,7 @@ const requirePropsDefaultDoc = createRule({
|
|
|
1118
1299
|
node,
|
|
1119
1300
|
messageId: "missingDefaultDoc",
|
|
1120
1301
|
data: {
|
|
1121
|
-
propertyName: node.key.
|
|
1302
|
+
propertyName: node.key.name
|
|
1122
1303
|
}
|
|
1123
1304
|
});
|
|
1124
1305
|
}
|
|
@@ -1136,6 +1317,7 @@ const rules = {
|
|
|
1136
1317
|
"no-mutable-property-of-props-interface": noMutablePropertyOfPropsInterface,
|
|
1137
1318
|
"no-mutable-public-property-of-construct": noMutablePublicPropertyOfConstruct,
|
|
1138
1319
|
"no-parent-name-construct-id-match": noParentNameConstructIdMatch,
|
|
1320
|
+
"no-unused-props": noUnusedProps,
|
|
1139
1321
|
"no-variable-construct-id": noVariableConstructId,
|
|
1140
1322
|
"pascal-case-construct-id": pascalCaseConstructId,
|
|
1141
1323
|
"props-name-convention": propsNameConvention,
|
|
@@ -1172,6 +1354,8 @@ const recommended = createFlatConfig({
|
|
|
1172
1354
|
"error",
|
|
1173
1355
|
{ disallowContainingParentName: false }
|
|
1174
1356
|
],
|
|
1357
|
+
// TODO: Enable this rule at v4.0.0
|
|
1358
|
+
// "cdk/no-unused-props": "error",
|
|
1175
1359
|
"cdk/no-variable-construct-id": "error",
|
|
1176
1360
|
"cdk/pascal-case-construct-id": "error",
|
|
1177
1361
|
"cdk/require-passing-this": ["error", { allowNonThisAndDisallowScope: true }]
|
|
@@ -1188,6 +1372,7 @@ const strict = createFlatConfig({
|
|
|
1188
1372
|
"error",
|
|
1189
1373
|
{ disallowContainingParentName: true }
|
|
1190
1374
|
],
|
|
1375
|
+
"cdk/no-unused-props": "error",
|
|
1191
1376
|
"cdk/no-variable-construct-id": "error",
|
|
1192
1377
|
"cdk/pascal-case-construct-id": "error",
|
|
1193
1378
|
"cdk/props-name-convention": "error",
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FlatConfig } from "@typescript-eslint/utils/ts-eslint";
|
|
2
2
|
declare const rules: {
|
|
3
3
|
"construct-constructor-property": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidConstructorProperty" | "invalidConstructorType" | "invalidConstructorIdType", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
4
4
|
"no-construct-in-interface": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidInterfaceProperty", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
@@ -12,6 +12,7 @@ declare const rules: {
|
|
|
12
12
|
"no-parent-name-construct-id-match": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidConstructId", [{
|
|
13
13
|
disallowContainingParentName?: boolean;
|
|
14
14
|
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
15
|
+
"no-unused-props": import("@typescript-eslint/utils/ts-eslint").RuleModule<"unusedProp", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
15
16
|
"no-variable-construct-id": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidConstructId", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
16
17
|
"pascal-case-construct-id": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidConstructId", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
17
18
|
"props-name-convention": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidPropsName", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
@@ -23,88 +24,23 @@ declare const rules: {
|
|
|
23
24
|
};
|
|
24
25
|
declare const configs: {
|
|
25
26
|
recommended: {
|
|
26
|
-
languageOptions:
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
projectService: boolean;
|
|
30
|
-
};
|
|
31
|
-
};
|
|
32
|
-
plugins: {
|
|
33
|
-
cdk: {
|
|
34
|
-
meta: {
|
|
35
|
-
name: string;
|
|
36
|
-
version: string;
|
|
37
|
-
};
|
|
38
|
-
rules: {
|
|
39
|
-
"construct-constructor-property": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidConstructorProperty" | "invalidConstructorType" | "invalidConstructorIdType", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
40
|
-
"no-construct-in-interface": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidInterfaceProperty", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
41
|
-
"no-construct-in-public-property-of-construct": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidPublicPropertyOfConstruct", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
42
|
-
"no-construct-stack-suffix": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidConstructId", [{
|
|
43
|
-
disallowedSuffixes: ("Construct" | "Stack")[];
|
|
44
|
-
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
45
|
-
"no-import-private": import("eslint").Rule.RuleModule;
|
|
46
|
-
"no-mutable-property-of-props-interface": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidPropertyOfPropsInterface", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
47
|
-
"no-mutable-public-property-of-construct": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidPublicPropertyOfConstruct", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
48
|
-
"no-parent-name-construct-id-match": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidConstructId", [{
|
|
49
|
-
disallowContainingParentName?: boolean;
|
|
50
|
-
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
51
|
-
"no-variable-construct-id": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidConstructId", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
52
|
-
"pascal-case-construct-id": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidConstructId", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
53
|
-
"props-name-convention": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidPropsName", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
54
|
-
"require-jsdoc": import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingJSDoc", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
55
|
-
"require-passing-this": import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingPassingThis", [{
|
|
56
|
-
allowNonThisAndDisallowScope?: boolean;
|
|
57
|
-
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
58
|
-
"require-props-default-doc": import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingDefaultDoc", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
59
|
-
};
|
|
60
|
-
};
|
|
61
|
-
};
|
|
62
|
-
rules: Record<string, unknown>;
|
|
27
|
+
languageOptions: FlatConfig.LanguageOptions;
|
|
28
|
+
plugins: FlatConfig.Plugins;
|
|
29
|
+
rules: FlatConfig.Rules;
|
|
63
30
|
};
|
|
64
31
|
strict: {
|
|
65
|
-
languageOptions:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
projectService: boolean;
|
|
69
|
-
};
|
|
70
|
-
};
|
|
71
|
-
plugins: {
|
|
72
|
-
cdk: {
|
|
73
|
-
meta: {
|
|
74
|
-
name: string;
|
|
75
|
-
version: string;
|
|
76
|
-
};
|
|
77
|
-
rules: {
|
|
78
|
-
"construct-constructor-property": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidConstructorProperty" | "invalidConstructorType" | "invalidConstructorIdType", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
79
|
-
"no-construct-in-interface": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidInterfaceProperty", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
80
|
-
"no-construct-in-public-property-of-construct": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidPublicPropertyOfConstruct", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
81
|
-
"no-construct-stack-suffix": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidConstructId", [{
|
|
82
|
-
disallowedSuffixes: ("Construct" | "Stack")[];
|
|
83
|
-
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
84
|
-
"no-import-private": import("eslint").Rule.RuleModule;
|
|
85
|
-
"no-mutable-property-of-props-interface": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidPropertyOfPropsInterface", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
86
|
-
"no-mutable-public-property-of-construct": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidPublicPropertyOfConstruct", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
87
|
-
"no-parent-name-construct-id-match": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidConstructId", [{
|
|
88
|
-
disallowContainingParentName?: boolean;
|
|
89
|
-
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
90
|
-
"no-variable-construct-id": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidConstructId", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
91
|
-
"pascal-case-construct-id": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidConstructId", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
92
|
-
"props-name-convention": import("@typescript-eslint/utils/ts-eslint").RuleModule<"invalidPropsName", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
93
|
-
"require-jsdoc": import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingJSDoc", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
94
|
-
"require-passing-this": import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingPassingThis", [{
|
|
95
|
-
allowNonThisAndDisallowScope?: boolean;
|
|
96
|
-
}], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
97
|
-
"require-props-default-doc": import("@typescript-eslint/utils/ts-eslint").RuleModule<"missingDefaultDoc", [], unknown, import("@typescript-eslint/utils/ts-eslint").RuleListener>;
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
rules: Record<string, unknown>;
|
|
32
|
+
languageOptions: FlatConfig.LanguageOptions;
|
|
33
|
+
plugins: FlatConfig.Plugins;
|
|
34
|
+
rules: FlatConfig.Rules;
|
|
102
35
|
};
|
|
103
36
|
};
|
|
104
37
|
export { configs, rules };
|
|
105
38
|
export interface EslintCdkPlugin {
|
|
106
39
|
rules: typeof rules;
|
|
107
|
-
configs:
|
|
40
|
+
configs: Readonly<{
|
|
41
|
+
recommended: FlatConfig.Config;
|
|
42
|
+
strict: FlatConfig.Config;
|
|
43
|
+
}>;
|
|
108
44
|
}
|
|
109
45
|
declare const eslintCdkPlugin: EslintCdkPlugin;
|
|
110
46
|
export default eslintCdkPlugin;
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AAoBhE,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;CAiBV,CAAC;AAmEF,QAAA,MAAM,OAAO;;yBAzDM,UAAU,CAAC,eAAe;iBAClC,UAAU,CAAC,OAAO;eACpB,UAAU,CAAC,KAAK;;;yBAFN,UAAU,CAAC,eAAe;iBAClC,UAAU,CAAC,OAAO;eACpB,UAAU,CAAC,KAAK;;CA0DxB,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAE1B,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,OAAO,EAAE,QAAQ,CAAC;QAChB,WAAW,EAAE,UAAU,CAAC,MAAM,CAAC;QAC/B,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC;KAC3B,CAAC,CAAC;CACJ;AAED,QAAA,MAAM,eAAe,EAAE,eAGtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|