eslint-cdk-plugin 3.1.0 → 3.2.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 CHANGED
@@ -26,12 +26,18 @@ function _interopNamespaceDefault(e) {
26
26
  var path__namespace = /*#__PURE__*/_interopNamespaceDefault(path);
27
27
 
28
28
  var name = "eslint-cdk-plugin";
29
- var version = "3.1.0";
29
+ var version = "3.2.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 getConstructor = (node) => {
36
+ return node.body.body.find(
37
+ (member) => member.type === utils.AST_NODE_TYPES.MethodDefinition && member.kind === "constructor"
38
+ );
39
+ };
40
+
35
41
  const isConstructOrStackType = (type, ignoredClasses = ["App", "Stage"]) => {
36
42
  if (ignoredClasses.includes(type.symbol?.name ?? "")) return false;
37
43
  return isTargetSuperClassType(
@@ -74,9 +80,7 @@ const constructConstructorProperty = createRule({
74
80
  ClassDeclaration(node) {
75
81
  const type = parserServices.getTypeAtLocation(node);
76
82
  if (!isConstructType(type)) return;
77
- const constructor = node.body.body.find(
78
- (member) => member.type === utils.AST_NODE_TYPES.MethodDefinition && member.kind === "constructor"
79
- );
83
+ const constructor = getConstructor(node);
80
84
  if (!constructor) return;
81
85
  validateConstructorProperty(constructor, context, parserServices);
82
86
  }
@@ -197,9 +201,7 @@ const noConstructInPublicPropertyOfConstruct = createRule({
197
201
  const type = parserServices.getTypeAtLocation(node);
198
202
  if (!isConstructOrStackType(type)) return;
199
203
  validatePublicPropertyOfConstruct(node, context, parserServices);
200
- const constructor = node.body.body.find(
201
- (member) => member.type === utils.AST_NODE_TYPES.MethodDefinition && member.kind === "constructor"
202
- );
204
+ const constructor = getConstructor(node);
203
205
  if (!constructor || constructor.value.type !== utils.AST_NODE_TYPES.FunctionExpression) {
204
206
  return;
205
207
  }
@@ -267,6 +269,12 @@ const toPascalCase = (str) => {
267
269
  }).join("");
268
270
  };
269
271
 
272
+ const getPropertyNames = (properties) => {
273
+ return properties.reduce(
274
+ (acc, prop) => prop.type === utils.AST_NODE_TYPES.Property && prop.key.type === utils.AST_NODE_TYPES.Identifier ? [...acc, prop.key.name] : acc,
275
+ []
276
+ );
277
+ };
270
278
  const getConstructorPropertyNames = (type) => {
271
279
  const declarations = type.symbol?.declarations;
272
280
  if (!declarations?.length) return [];
@@ -788,6 +796,176 @@ const validateConstructId$2 = ({
788
796
  }
789
797
  };
790
798
 
799
+ const propsUsageTrackerFactory = (propsType) => {
800
+ const getPropsPropertyNames = (propsType2) => {
801
+ const typeProperties = propsType2.getProperties();
802
+ if (typeProperties.length) {
803
+ return typeProperties.reduce(
804
+ (acc, prop) => !isInternalProperty(prop.name) ? [...acc, prop.name] : acc,
805
+ []
806
+ );
807
+ }
808
+ const symbol = propsType2.getSymbol();
809
+ if (!symbol?.members) return [];
810
+ return Array.from(symbol.members.keys()).reduce((acc, key) => {
811
+ const name = String(key);
812
+ return !isInternalProperty(name) ? [...acc, name] : acc;
813
+ }, []);
814
+ };
815
+ const isInternalProperty = (propertyName) => {
816
+ return propertyName.startsWith("_") || propertyName === "constructor" || propertyName === "prototype";
817
+ };
818
+ const markAsUsed = (propertyName) => {
819
+ if (propUsages.has(propertyName)) propUsages.set(propertyName, true);
820
+ };
821
+ const propUsages = new Map(
822
+ getPropsPropertyNames(propsType).map((name) => [name, false])
823
+ );
824
+ const getUnusedProperties = () => {
825
+ return Array.from(propUsages.entries()).reduce(
826
+ (acc, [name, used]) => !used ? [...acc, name] : acc,
827
+ []
828
+ );
829
+ };
830
+ const markAsUsedForMemberExpression = (node, propsParamName) => {
831
+ if (node.object.type === utils.AST_NODE_TYPES.Identifier && node.object.name === propsParamName && node.property.type === utils.AST_NODE_TYPES.Identifier) {
832
+ markAsUsed(node.property.name);
833
+ return;
834
+ }
835
+ 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) {
836
+ markAsUsed(node.property.name);
837
+ return;
838
+ }
839
+ };
840
+ const markAsUsedForVariableDeclarator = (node, propsParamName) => {
841
+ if (node.id.type !== utils.AST_NODE_TYPES.ObjectPattern || node.init?.type !== utils.AST_NODE_TYPES.Identifier || node.init.name !== propsParamName) {
842
+ return;
843
+ }
844
+ const propertyNames = getPropertyNames(node.id.properties);
845
+ for (const name of propertyNames) {
846
+ markAsUsed(name);
847
+ }
848
+ };
849
+ const markAsUsedForAssignmentExpression = (node, propsParamName) => {
850
+ 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) {
851
+ return;
852
+ }
853
+ markAsUsed(node.right.property.name);
854
+ };
855
+ const markAsUsedForObjectPattern = (node) => {
856
+ for (const propName of getPropertyNames(node.properties)) {
857
+ markAsUsed(propName);
858
+ }
859
+ };
860
+ if (!propUsages.size) return null;
861
+ return {
862
+ getUnusedProperties,
863
+ markAsUsedForMemberExpression,
864
+ markAsUsedForVariableDeclarator,
865
+ markAsUsedForAssignmentExpression,
866
+ markAsUsedForObjectPattern
867
+ };
868
+ };
869
+
870
+ const noUnusedProps = createRule({
871
+ name: "no-unused-props",
872
+ meta: {
873
+ type: "suggestion",
874
+ docs: {
875
+ description: "Enforces that all properties defined in props type are used within the constructor"
876
+ },
877
+ messages: {
878
+ unusedProp: "Property '{{propName}}' is defined in props but never used"
879
+ },
880
+ schema: []
881
+ },
882
+ defaultOptions: [],
883
+ create(context) {
884
+ const parserServices = utils.ESLintUtils.getParserServices(context);
885
+ return {
886
+ ClassDeclaration(node) {
887
+ const type = parserServices.getTypeAtLocation(node);
888
+ if (!isConstructType(type)) return;
889
+ const constructor = getConstructor(node);
890
+ if (!constructor) return;
891
+ analyzePropsUsage(constructor, context, parserServices);
892
+ }
893
+ };
894
+ }
895
+ });
896
+ const analyzePropsUsage = (constructor, context, parserServices) => {
897
+ const params = constructor.value.params;
898
+ if (params.length < 3) return;
899
+ const propsParam = params[2];
900
+ switch (propsParam.type) {
901
+ case utils.AST_NODE_TYPES.Identifier: {
902
+ const propsType = parserServices.getTypeAtLocation(propsParam);
903
+ const tracker = propsUsageTrackerFactory(propsType);
904
+ if (!tracker || !constructor.value.body) return;
905
+ analyzeConstructorBody(constructor.value.body, propsParam.name, tracker);
906
+ reportUnusedProperties(tracker, propsParam, context);
907
+ return;
908
+ }
909
+ case utils.AST_NODE_TYPES.ObjectPattern: {
910
+ const typeAnnotation = propsParam.typeAnnotation?.typeAnnotation;
911
+ if (!typeAnnotation) return;
912
+ const propsType = parserServices.getTypeAtLocation(typeAnnotation);
913
+ const tracker = propsUsageTrackerFactory(propsType);
914
+ if (!tracker) return;
915
+ tracker.markAsUsedForObjectPattern(propsParam);
916
+ reportUnusedProperties(tracker, propsParam, context);
917
+ return;
918
+ }
919
+ default:
920
+ return;
921
+ }
922
+ };
923
+ const analyzeConstructorBody = (body, propsParamName, tracker) => {
924
+ const visited = /* @__PURE__ */ new Set();
925
+ const visitNode = (node) => {
926
+ if (visited.has(node)) return;
927
+ visited.add(node);
928
+ switch (node.type) {
929
+ case utils.AST_NODE_TYPES.MemberExpression:
930
+ tracker.markAsUsedForMemberExpression(node, propsParamName);
931
+ break;
932
+ case utils.AST_NODE_TYPES.VariableDeclarator:
933
+ tracker.markAsUsedForVariableDeclarator(node, propsParamName);
934
+ break;
935
+ case utils.AST_NODE_TYPES.AssignmentExpression:
936
+ tracker.markAsUsedForAssignmentExpression(node, propsParamName);
937
+ break;
938
+ }
939
+ const children = getChildNodes(node);
940
+ for (const child of children) {
941
+ visitNode(child);
942
+ }
943
+ };
944
+ visitNode(body);
945
+ };
946
+ const reportUnusedProperties = (tracker, propsParam, context) => {
947
+ for (const propName of tracker.getUnusedProperties()) {
948
+ context.report({
949
+ node: propsParam,
950
+ messageId: "unusedProp",
951
+ data: {
952
+ propName
953
+ }
954
+ });
955
+ }
956
+ };
957
+ const getChildNodes = (node) => {
958
+ return Object.entries(node).reduce((acc, [key, value]) => {
959
+ if (["parent", "range", "loc"].includes(key)) return acc;
960
+ if (isESTreeNode(value)) return [...acc, value];
961
+ if (Array.isArray(value)) return [...acc, ...value.filter(isESTreeNode)];
962
+ return acc;
963
+ }, []);
964
+ };
965
+ const isESTreeNode = (value) => {
966
+ return value !== null && typeof value === "object" && "type" in value && typeof value.type === "string";
967
+ };
968
+
791
969
  const noVariableConstructId = createRule({
792
970
  name: "no-variable-construct-id",
793
971
  meta: {
@@ -924,10 +1102,9 @@ const propsNameConvention = createRule({
924
1102
  if (!node.id || !node.superClass) return;
925
1103
  const type = parserServices.getTypeAtLocation(node.superClass);
926
1104
  if (!isConstructType(type)) return;
927
- const constructor = node.body.body.find(
928
- (member) => member.type === utils.AST_NODE_TYPES.MethodDefinition && member.kind === "constructor"
929
- );
930
- const propsParam = constructor?.value.params?.[2];
1105
+ const constructor = getConstructor(node);
1106
+ if (!constructor) return;
1107
+ const propsParam = constructor.value.params?.[2];
931
1108
  if (propsParam?.type !== utils.AST_NODE_TYPES.Identifier) return;
932
1109
  const typeAnnotation = propsParam.typeAnnotation;
933
1110
  if (typeAnnotation?.type !== utils.AST_NODE_TYPES.TSTypeAnnotation) return;
@@ -969,9 +1146,10 @@ const requireJSDoc = createRule({
969
1146
  const parserServices = utils.ESLintUtils.getParserServices(context);
970
1147
  return {
971
1148
  TSPropertySignature(node) {
972
- if (node.key.type !== utils.AST_NODE_TYPES.Identifier || node.parent?.type !== utils.AST_NODE_TYPES.TSInterfaceBody) {
973
- return;
974
- }
1149
+ if (node.key.type !== utils.AST_NODE_TYPES.Identifier) return;
1150
+ const parent = node.parent.parent;
1151
+ if (parent.type !== utils.AST_NODE_TYPES.TSInterfaceDeclaration) return;
1152
+ if (!parent.id.name.endsWith("Props")) return;
975
1153
  const sourceCode = context.sourceCode;
976
1154
  const comments = sourceCode.getCommentsBefore(node);
977
1155
  const hasJSDoc = comments.some(
@@ -1100,14 +1278,11 @@ const requirePropsDefaultDoc = createRule({
1100
1278
  create(context) {
1101
1279
  return {
1102
1280
  TSPropertySignature(node) {
1281
+ if (node.key.type !== utils.AST_NODE_TYPES.Identifier) return;
1103
1282
  if (!node.optional) return;
1104
- const parent = node.parent?.parent;
1105
- if (parent?.type !== utils.AST_NODE_TYPES.TSInterfaceDeclaration) {
1106
- return;
1107
- }
1108
- if (parent.id.type !== utils.AST_NODE_TYPES.Identifier || !parent.id.name.endsWith("Props")) {
1109
- return;
1110
- }
1283
+ const parent = node.parent.parent;
1284
+ if (parent.type !== utils.AST_NODE_TYPES.TSInterfaceDeclaration) return;
1285
+ if (!parent.id.name.endsWith("Props")) return;
1111
1286
  const sourceCode = context.sourceCode;
1112
1287
  const comments = sourceCode.getCommentsBefore(node);
1113
1288
  const hasDefaultDoc = comments.some(
@@ -1118,7 +1293,7 @@ const requirePropsDefaultDoc = createRule({
1118
1293
  node,
1119
1294
  messageId: "missingDefaultDoc",
1120
1295
  data: {
1121
- propertyName: node.key.type === utils.AST_NODE_TYPES.Identifier ? node.key.name : "unknown"
1296
+ propertyName: node.key.name
1122
1297
  }
1123
1298
  });
1124
1299
  }
@@ -1136,6 +1311,7 @@ const rules = {
1136
1311
  "no-mutable-property-of-props-interface": noMutablePropertyOfPropsInterface,
1137
1312
  "no-mutable-public-property-of-construct": noMutablePublicPropertyOfConstruct,
1138
1313
  "no-parent-name-construct-id-match": noParentNameConstructIdMatch,
1314
+ "no-unused-props": noUnusedProps,
1139
1315
  "no-variable-construct-id": noVariableConstructId,
1140
1316
  "pascal-case-construct-id": pascalCaseConstructId,
1141
1317
  "props-name-convention": propsNameConvention,
@@ -1172,6 +1348,8 @@ const recommended = createFlatConfig({
1172
1348
  "error",
1173
1349
  { disallowContainingParentName: false }
1174
1350
  ],
1351
+ // TODO: Enable this rule at v4.0.0
1352
+ // "cdk/no-unused-props": "error",
1175
1353
  "cdk/no-variable-construct-id": "error",
1176
1354
  "cdk/pascal-case-construct-id": "error",
1177
1355
  "cdk/require-passing-this": ["error", { allowNonThisAndDisallowScope: true }]
@@ -1188,6 +1366,7 @@ const strict = createFlatConfig({
1188
1366
  "error",
1189
1367
  { disallowContainingParentName: true }
1190
1368
  ],
1369
+ "cdk/no-unused-props": "error",
1191
1370
  "cdk/no-variable-construct-id": "error",
1192
1371
  "cdk/pascal-case-construct-id": "error",
1193
1372
  "cdk/props-name-convention": "error",
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import tsParser from "@typescript-eslint/parser";
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
- parser: typeof tsParser;
28
- parserOptions: {
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
- parser: typeof tsParser;
67
- parserOptions: {
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: typeof 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;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,2BAA2B,CAAC;AAmBjD,QAAA,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;CAgBV,CAAC;AA0DF,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGZ,CAAC;AAEF,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAE1B,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,OAAO,KAAK,CAAC;IACpB,OAAO,EAAE,OAAO,OAAO,CAAC;CACzB;AAED,QAAA,MAAM,eAAe,EAAE,eAGtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
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"}