eslint-plugin-awscdk 4.3.0 → 4.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-awscdk",
3
- "version": "4.3.0",
3
+ "version": "4.3.2",
4
4
  "description": "eslint plugin for AWS CDK projects",
5
5
  "keywords": [
6
6
  "aws",
@@ -44,39 +44,28 @@
44
44
  "access": "public"
45
45
  },
46
46
  "scripts": {
47
- "build": "tsdown",
48
- "test": "vitest --run",
49
- "test:integration": "sh scripts/integration-test.sh",
50
- "lint": "eslint --fix",
51
- "fmt": "oxfmt",
52
- "fmt:check": "oxfmt --check",
53
- "check": "tsgo --noEmit",
54
- "pack": "pnpm run build && npm pack",
55
- "docs": "pnpm run --filter=@eslint-plugin-awscdk/docs",
56
- "example:flat-config": "pnpm run --filter=@eslint-plugin-awscdk/example-flat-config",
57
- "example:classic-config": "pnpm run --filter=@eslint-plugin-awscdk/example-classic-config",
58
- "example:oxlint": "pnpm run --filter=@eslint-plugin-awscdk/example-oxlint"
47
+ "pack": "vp pack",
48
+ "check": "vp check",
49
+ "test": "vp test --run",
50
+ "docs": "vp run -F @eslint-plugin-awscdk/docs"
59
51
  },
60
52
  "devDependencies": {
61
53
  "@eslint/js": "^10.0.1",
62
54
  "@secretlint/secretlint-rule-preset-recommend": "^11.2.5",
63
55
  "@types/node": "^24.10.13",
64
- "@typescript-eslint/parser": "^8.46.2",
65
- "@typescript-eslint/rule-tester": "^8.46.2",
66
- "@typescript-eslint/utils": "^8.46.2",
67
- "@typescript/native-preview": "^7.0.0-dev.20250601",
56
+ "@typescript-eslint/parser": "^8.58.0",
57
+ "@typescript-eslint/rule-tester": "^8.58.0",
58
+ "@typescript-eslint/utils": "^8.58.0",
59
+ "@voidzero-dev/vite-plus-core": "^0.1.11",
68
60
  "eslint": "^10.0.0",
69
- "eslint-plugin-import": "^2.32.0",
70
- "oxfmt": "^0.36.0",
71
61
  "secretlint": "^11.2.5",
72
- "tsdown": "^0.21.0",
73
62
  "typescript": "^5.9.3",
74
- "typescript-eslint": "^8.56.0",
75
- "vitest": "^4.0.6"
63
+ "typescript-eslint": "^8.58.0",
64
+ "vite-plus": "^0.1.11"
76
65
  },
77
66
  "peerDependencies": {
78
67
  "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
79
- "typescript": ">=4.8.4 <6.0.0"
68
+ "typescript": ">=4.8.4 <6.1.0"
80
69
  },
81
70
  "engines": {
82
71
  "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -1,18 +1,18 @@
1
1
  import { ClassicConfig } from "@typescript-eslint/utils/ts-eslint";
2
2
 
3
- const createClassicConfig = (
4
- rules: ClassicConfig.RulesRecord,
5
- ): {
3
+ type ClassicRulesConfig = {
6
4
  plugins: ["awscdk"];
7
5
  rules: ClassicConfig.RulesRecord;
8
- } => {
6
+ };
7
+
8
+ const createClassicConfig = (rules: ClassicConfig.RulesRecord): ClassicRulesConfig => {
9
9
  return {
10
10
  plugins: ["awscdk"],
11
11
  rules,
12
12
  };
13
13
  };
14
14
 
15
- export const recommended = createClassicConfig({
15
+ export const recommended: ClassicRulesConfig = createClassicConfig({
16
16
  "awscdk/construct-constructor-property": "error",
17
17
  "awscdk/migrate-disable-comments": "error",
18
18
  "awscdk/no-construct-in-interface": "error",
@@ -28,7 +28,7 @@ export const recommended = createClassicConfig({
28
28
  "awscdk/require-passing-this": ["error", { allowNonThisAndDisallowScope: true }],
29
29
  });
30
30
 
31
- export const strict = createClassicConfig({
31
+ export const strict: ClassicRulesConfig = createClassicConfig({
32
32
  "awscdk/construct-constructor-property": "error",
33
33
  "awscdk/migrate-disable-comments": "error",
34
34
  "awscdk/no-construct-in-interface": "error",
@@ -30,7 +30,7 @@ const createFlatConfig = (rules: _FlatConfig.Rules): FlatConfig => {
30
30
  };
31
31
  };
32
32
 
33
- export const recommended = createFlatConfig({
33
+ export const recommended: FlatConfig = createFlatConfig({
34
34
  "awscdk/construct-constructor-property": "error",
35
35
  "awscdk/migrate-disable-comments": "error",
36
36
  "awscdk/no-construct-in-interface": "error",
@@ -46,7 +46,7 @@ export const recommended = createFlatConfig({
46
46
  "awscdk/require-passing-this": ["error", { allowNonThisAndDisallowScope: true }],
47
47
  });
48
48
 
49
- export const strict = createFlatConfig({
49
+ export const strict: FlatConfig = createFlatConfig({
50
50
  "awscdk/construct-constructor-property": "error",
51
51
  "awscdk/migrate-disable-comments": "error",
52
52
  "awscdk/no-construct-in-interface": "error",
@@ -1,7 +1,12 @@
1
1
  import { recommended as classicRecommended, strict as classicStrict } from "./classic-config";
2
2
  import { recommended, strict } from "./flat-config";
3
3
 
4
- export const configs = {
4
+ export const configs: Readonly<{
5
+ recommended: typeof recommended;
6
+ strict: typeof strict;
7
+ classicRecommended: typeof classicRecommended;
8
+ classicStrict: typeof classicStrict;
9
+ }> = {
5
10
  recommended,
6
11
  strict,
7
12
  classicRecommended,
@@ -7,7 +7,6 @@ import {
7
7
  } from "typescript";
8
8
 
9
9
  import { isClassType } from "../../ts-type/checker/is-class";
10
-
11
10
  import { isResourceType } from "./is-resource";
12
11
 
13
12
  /**
@@ -1,3 +1,6 @@
1
+ import type { TSESLint } from "@typescript-eslint/utils";
2
+ import type { Rule } from "eslint";
3
+
1
4
  import { constructConstructorProperty } from "./construct-constructor-property";
2
5
  import { migrateDisableComments } from "./migrate-disable-comments";
3
6
  import { noConstructInInterface } from "./no-construct-in-interface";
@@ -17,7 +20,9 @@ import { requireJSDoc } from "./require-jsdoc";
17
20
  import { requirePassingThis } from "./require-passing-this";
18
21
  import { requirePropsDefaultDoc } from "./require-props-default-doc";
19
22
 
20
- export const rules = {
23
+ type RuleModule = TSESLint.RuleModule<string, readonly unknown[]> | Rule.RuleModule;
24
+
25
+ export const rules: Record<string, RuleModule> = {
21
26
  "construct-constructor-property": constructConstructorProperty,
22
27
  "migrate-disable-comments": migrateDisableComments,
23
28
  "no-construct-in-interface": noConstructInInterface,
@@ -1,6 +1,5 @@
1
- import * as path from "path";
2
-
3
1
  import { Rule } from "eslint";
2
+ import * as path from "path";
4
3
 
5
4
  /**
6
5
  * Disallow importing modules from private directories at different levels of the hierarchy.
@@ -10,7 +10,6 @@ import { Type } from "typescript";
10
10
  import { findConstructor } from "../../core/ast-node/finder/constructor";
11
11
  import { isConstructType } from "../../core/cdk-construct/type-checker/is-construct";
12
12
  import { createRule } from "../../shared/create-rule";
13
-
14
13
  import { PropsUsageAnalyzer } from "./props-usage-analyzer";
15
14
  import { IPropsUsageTracker, PropsUsageTracker } from "./props-usage-tracker";
16
15
 
@@ -14,7 +14,11 @@ export interface IPropsUsageAnalyzer {
14
14
  }
15
15
 
16
16
  export class PropsUsageAnalyzer implements IPropsUsageAnalyzer {
17
- constructor(private readonly tracker: IPropsUsageTracker) {}
17
+ private readonly tracker: IPropsUsageTracker;
18
+
19
+ constructor(tracker: IPropsUsageTracker) {
20
+ this.tracker = tracker;
21
+ }
18
22
 
19
23
  analyze(constructor: TSESTree.MethodDefinition, propsParam: TSESTree.Identifier): void {
20
24
  const constructorBody = constructor.value.body;
@@ -1,7 +1,6 @@
1
1
  import { AST_NODE_TYPES, TSESTree } from "@typescript-eslint/utils";
2
2
 
3
3
  import { IPropsUsageTracker } from "../props-usage-tracker";
4
-
5
4
  import { INodeVisitor } from "./interface/node-visitor";
6
5
 
7
6
  /**
@@ -1,7 +1,6 @@
1
1
  import { AST_NODE_TYPES, TSESTree } from "@typescript-eslint/utils";
2
2
 
3
3
  import { IPropsUsageTracker } from "../props-usage-tracker";
4
-
5
4
  import { INodeVisitor } from "./interface/node-visitor";
6
5
 
7
6
  /**
@@ -26,8 +26,11 @@ type MethodCallInfo = {
26
26
  */
27
27
  export class MethodCallCollectorVisitor implements INodeVisitor {
28
28
  private readonly _result: MethodCallInfo[] = [];
29
+ private readonly propsParamName: string;
29
30
 
30
- constructor(private readonly propsParamName: string) {}
31
+ constructor(propsParamName: string) {
32
+ this.propsParamName = propsParamName;
33
+ }
31
34
 
32
35
  visitCallExpression(node: TSESTree.CallExpression): void {
33
36
  // NOTE: Check for this.methodName(...) pattern
@@ -1,7 +1,6 @@
1
1
  import { AST_NODE_TYPES, TSESTree } from "@typescript-eslint/utils";
2
2
 
3
3
  import { IPropsUsageTracker } from "../props-usage-tracker";
4
-
5
4
  import { INodeVisitor } from "./interface/node-visitor";
6
5
 
7
6
  /**
@@ -1,7 +1,6 @@
1
1
  import { AST_NODE_TYPES, TSESTree } from "@typescript-eslint/utils";
2
2
 
3
3
  import { findChildNodes } from "../../../core/ast-node/finder/child-nodes";
4
-
5
4
  import { INodeVisitor } from "./interface/node-visitor";
6
5
 
7
6
  export const traverseNodes = (node: TSESTree.Node, visitor: INodeVisitor): void => {