eslint-cdk-plugin 1.0.2 → 1.0.3

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.
Files changed (58) hide show
  1. package/README.md +29 -2
  2. package/dist/index.cjs +783 -0
  3. package/dist/index.d.ts +51 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.mjs +755 -39
  6. package/package.json +22 -9
  7. package/src/index.ts +69 -0
  8. package/src/rules/no-class-in-interface.ts +56 -0
  9. package/src/rules/no-construct-stack-suffix.ts +86 -0
  10. package/src/rules/no-import-private.ts +60 -0
  11. package/src/rules/no-mutable-props-interface.ts +58 -0
  12. package/src/rules/no-mutable-public-fields.ts +75 -0
  13. package/src/rules/no-parent-name-construct-id-match.ts +312 -0
  14. package/src/rules/no-public-class-fields.ts +148 -0
  15. package/src/rules/no-variable-construct-id.ts +101 -0
  16. package/src/rules/pascal-case-construct-id.ts +95 -0
  17. package/src/rules/require-passing-this.ts +51 -0
  18. package/src/types/symbolFlags.ts +6 -0
  19. package/src/utils/convertString.ts +20 -0
  20. package/src/utils/typeCheck.ts +57 -0
  21. package/dist/index.d.mts +0 -31
  22. package/dist/index.mjs.map +0 -1
  23. package/dist/no-class-in-interface-props.d.mts +0 -2
  24. package/dist/no-class-in-interface-props.mjs +0 -45
  25. package/dist/no-class-in-interface-props.mjs.map +0 -1
  26. package/dist/no-construct-stack-suffix.d.mts +0 -2
  27. package/dist/no-construct-stack-suffix.mjs +0 -64
  28. package/dist/no-construct-stack-suffix.mjs.map +0 -1
  29. package/dist/no-import-private.d.mts +0 -2
  30. package/dist/no-import-private.mjs +0 -37
  31. package/dist/no-import-private.mjs.map +0 -1
  32. package/dist/no-mutable-props-interface.d.mts +0 -2
  33. package/dist/no-mutable-props-interface.mjs +0 -44
  34. package/dist/no-mutable-props-interface.mjs.map +0 -1
  35. package/dist/no-mutable-public-fields.d.mts +0 -2
  36. package/dist/no-mutable-public-fields.mjs +0 -57
  37. package/dist/no-mutable-public-fields.mjs.map +0 -1
  38. package/dist/no-parent-name-construct-id-match.d.mts +0 -2
  39. package/dist/no-parent-name-construct-id-match.mjs +0 -218
  40. package/dist/no-parent-name-construct-id-match.mjs.map +0 -1
  41. package/dist/no-public-class-fields.d.mts +0 -2
  42. package/dist/no-public-class-fields.mjs +0 -105
  43. package/dist/no-public-class-fields.mjs.map +0 -1
  44. package/dist/no-variable-construct-id.d.mts +0 -2
  45. package/dist/no-variable-construct-id.mjs +0 -63
  46. package/dist/no-variable-construct-id.mjs.map +0 -1
  47. package/dist/pascal-case-construct-id.d.mts +0 -2
  48. package/dist/pascal-case-construct-id.mjs +0 -62
  49. package/dist/pascal-case-construct-id.mjs.map +0 -1
  50. package/dist/require-passing-this.d.mts +0 -2
  51. package/dist/require-passing-this.mjs +0 -41
  52. package/dist/require-passing-this.mjs.map +0 -1
  53. package/dist/utils/convertString.d.mts +0 -1
  54. package/dist/utils/convertString.mjs +0 -13
  55. package/dist/utils/convertString.mjs.map +0 -1
  56. package/dist/utils/typeCheck.d.mts +0 -4
  57. package/dist/utils/typeCheck.mjs +0 -19
  58. package/dist/utils/typeCheck.mjs.map +0 -1
package/README.md CHANGED
@@ -29,33 +29,60 @@ pnpm install -D eslint-cdk-plugin
29
29
 
30
30
  ## 🚀 Usage
31
31
 
32
- #### Use recommended config
32
+ Note: This plugin uses typescript type information and must be used in conjunction with [typescript-eslint](https://typescript-eslint.io/getting-started).
33
+
34
+ ### When using recommended config
33
35
 
34
36
  ```js
35
37
  // eslint.config.mjs
36
38
  import eslintCdkPlugin from "eslint-cdk-plugin";
39
+ import tsEslint from "typescript-eslint";
40
+
37
41
  export default [
42
+ ...tsEslint.configs.recommended,
38
43
  {
44
+ files: ["lib/**/*.ts", "bin/*.ts"],
45
+ languageOptions: {
46
+ parserOptions: {
47
+ projectService: true,
48
+ project: "./tsconfig.json",
49
+ },
50
+ },
51
+ // ✅ Add plugins
39
52
  plugins: {
40
53
  cdk: eslintCdkPlugin,
41
54
  },
55
+ // ✅ Add rules (use recommended rules)
42
56
  rules: {
43
57
  ...eslintCdkPlugin.configs.recommended.rules,
58
+ "cdk/no-import-private": "error",
44
59
  },
45
60
  },
46
61
  ];
47
62
  ```
48
63
 
49
- #### Use custom config
64
+ ### When using custom config
50
65
 
51
66
  ```js
52
67
  // eslint.config.mjs
68
+ import tsEslint from "typescript-eslint";
53
69
  import eslintCdkPlugin from "eslint-cdk-plugin";
70
+
54
71
  export default [
72
+ ...tsEslint.configs.recommended,
55
73
  {
74
+ files: ["lib/**/*.ts", "bin/*.ts"],
75
+ languageOptions: {
76
+ parserOptions: {
77
+ projectService: true,
78
+ project: "./tsconfig.json",
79
+ },
80
+ },
81
+ // ✅ Add plugins
56
82
  plugins: {
57
83
  cdk: eslintCdkPlugin,
58
84
  },
85
+ // ✅ Add rules (use custom rules)
59
86
  rules: {
60
87
  "cdk/no-class-in-interface": "error",
61
88
  "cdk/no-construct-stack-suffix": "error",