eslint-cdk-plugin 3.4.3 → 3.4.5
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 +29329 -1420
- package/dist/index.d.cts +72 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +72 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +29329 -1396
- package/dist/index.mjs.map +1 -0
- package/package.json +21 -21
- package/src/configs/flat-config.ts +69 -0
- package/src/configs/index.ts +6 -0
- package/src/core/ast-node/finder/child-nodes.ts +25 -0
- package/src/{utils/getConstructor.ts → core/ast-node/finder/constructor.ts} +1 -1
- package/src/core/ast-node/finder/property-name.ts +20 -0
- package/src/core/ast-node/finder/public-property.ts +76 -0
- package/src/core/cdk-construct/type-checker/is-construct-or-stack.ts +21 -0
- package/src/core/cdk-construct/type-checker/is-construct.ts +22 -0
- package/src/{utils → core/cdk-construct/type-checker}/is-resource-with-readonly-interface.ts +8 -7
- package/src/core/cdk-construct/type-checker/is-resource.ts +17 -0
- package/src/core/cdk-construct/type-finder/index.ts +73 -0
- package/src/core/ts-type/checker/is-array.ts +15 -0
- package/src/core/ts-type/checker/is-class.ts +7 -0
- package/src/core/ts-type/checker/is-extends-target-super-class.ts +24 -0
- package/src/core/ts-type/checker/private/get-symbol.ts +5 -0
- package/src/core/ts-type/finder/array-element.ts +20 -0
- package/src/core/ts-type/finder/constructor-property-name.ts +21 -0
- package/src/{utils/getGenericTypeArgument.ts → core/ts-type/finder/generics-type-argument.ts} +5 -5
- package/src/index.ts +6 -108
- package/src/rules/construct-constructor-property.ts +48 -26
- package/src/rules/index.ts +34 -0
- package/src/rules/no-construct-in-interface.ts +5 -51
- package/src/rules/no-construct-in-public-property-of-construct.ts +20 -143
- package/src/rules/no-construct-stack-suffix.ts +5 -5
- package/src/rules/no-mutable-property-of-props-interface.ts +1 -1
- package/src/rules/no-mutable-public-property-of-construct.ts +47 -39
- package/src/rules/no-parent-name-construct-id-match.ts +4 -6
- package/src/rules/no-unused-props/index.ts +161 -0
- package/src/rules/no-unused-props/props-usage-analyzer.ts +314 -0
- package/src/{utils/propsUsageTracker.ts → rules/no-unused-props/props-usage-tracker.ts} +99 -106
- package/src/rules/no-unused-props/visitor/direct-props-usage-visitor.ts +145 -0
- package/src/rules/no-unused-props/visitor/index.ts +5 -0
- package/src/rules/no-unused-props/visitor/instance-variable-usage-visitor.ts +117 -0
- package/src/rules/no-unused-props/visitor/interface/node-visitor.ts +9 -0
- package/src/rules/no-unused-props/visitor/method-call-collector-visitor.ts +60 -0
- package/src/rules/no-unused-props/visitor/props-alias-visitor.ts +81 -0
- package/src/rules/no-unused-props/visitor/traverse-nodes.ts +38 -0
- package/src/rules/no-variable-construct-id.ts +4 -4
- package/src/rules/pascal-case-construct-id.ts +5 -5
- package/src/rules/props-name-convention.ts +4 -4
- package/src/rules/require-jsdoc.ts +2 -2
- package/src/rules/require-passing-this.ts +4 -4
- package/src/rules/require-props-default-doc.ts +1 -1
- package/bin/migration.mjs +0 -100
- package/dist/index.d.ts +0 -47
- package/dist/index.d.ts.map +0 -1
- package/src/constants/tsInternalFlags.ts +0 -18
- package/src/rules/no-unused-props.ts +0 -176
- package/src/utils/getArrayElementType.ts +0 -14
- package/src/utils/getPropertyNames.ts +0 -45
- package/src/utils/typecheck/cdk.ts +0 -71
- package/src/utils/typecheck/ts-node.ts +0 -42
- package/src/utils/typecheck/ts-type.ts +0 -27
- /package/src/{utils/convertString.ts → shared/converter/to-pascal-case.ts} +0 -0
- /package/src/{utils/createRule.ts → shared/create-rule.ts} +0 -0
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as _typescript_eslint_utils_ts_eslint29 from "@typescript-eslint/utils/ts-eslint";
|
|
2
|
+
import { ClassicConfig, FlatConfig } from "@typescript-eslint/utils/ts-eslint";
|
|
3
|
+
import * as eslint0 from "eslint";
|
|
4
|
+
|
|
5
|
+
//#region src/configs/index.d.ts
|
|
6
|
+
declare const configs: {
|
|
7
|
+
recommended: {
|
|
8
|
+
languageOptions: _typescript_eslint_utils_ts_eslint29.FlatConfig.LanguageOptions;
|
|
9
|
+
plugins: _typescript_eslint_utils_ts_eslint29.FlatConfig.Plugins;
|
|
10
|
+
rules: _typescript_eslint_utils_ts_eslint29.FlatConfig.Rules;
|
|
11
|
+
};
|
|
12
|
+
strict: {
|
|
13
|
+
languageOptions: _typescript_eslint_utils_ts_eslint29.FlatConfig.LanguageOptions;
|
|
14
|
+
plugins: _typescript_eslint_utils_ts_eslint29.FlatConfig.Plugins;
|
|
15
|
+
rules: _typescript_eslint_utils_ts_eslint29.FlatConfig.Rules;
|
|
16
|
+
};
|
|
17
|
+
classicRecommended: {
|
|
18
|
+
plugins: ["awscdk"];
|
|
19
|
+
rules: _typescript_eslint_utils_ts_eslint29.ClassicConfig.RulesRecord;
|
|
20
|
+
};
|
|
21
|
+
classicStrict: {
|
|
22
|
+
plugins: ["awscdk"];
|
|
23
|
+
rules: _typescript_eslint_utils_ts_eslint29.ClassicConfig.RulesRecord;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/rules/index.d.ts
|
|
28
|
+
declare const rules: {
|
|
29
|
+
"construct-constructor-property": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidConstructorProperty" | "invalidConstructorType" | "invalidConstructorIdType", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
30
|
+
"migrate-disable-comments": _typescript_eslint_utils_ts_eslint29.RuleModule<"migrateDisableComment", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
31
|
+
"no-construct-in-interface": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidInterfaceProperty", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
32
|
+
"no-construct-in-public-property-of-construct": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidPublicPropertyOfConstruct", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
33
|
+
"no-construct-stack-suffix": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidConstructId", [{
|
|
34
|
+
disallowedSuffixes?: ("Construct" | "Stack")[];
|
|
35
|
+
}], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
36
|
+
"no-import-private": eslint0.Rule.RuleModule;
|
|
37
|
+
"no-mutable-property-of-props-interface": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidPropertyOfPropsInterface", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
38
|
+
"no-mutable-public-property-of-construct": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidPublicPropertyOfConstruct", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
39
|
+
"no-parent-name-construct-id-match": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidConstructId", {
|
|
40
|
+
disallowContainingParentName?: boolean;
|
|
41
|
+
}[], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
42
|
+
"no-unused-props": _typescript_eslint_utils_ts_eslint29.RuleModule<"unusedProp", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
43
|
+
"no-variable-construct-id": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidConstructId", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
44
|
+
"pascal-case-construct-id": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidConstructId", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
45
|
+
"props-name-convention": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidPropsName", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
46
|
+
"require-jsdoc": _typescript_eslint_utils_ts_eslint29.RuleModule<"missingJSDoc", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
47
|
+
"require-passing-this": _typescript_eslint_utils_ts_eslint29.RuleModule<"missingPassingThis", {
|
|
48
|
+
allowNonThisAndDisallowScope?: boolean;
|
|
49
|
+
}[], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
50
|
+
"require-props-default-doc": _typescript_eslint_utils_ts_eslint29.RuleModule<"missingDefaultDoc", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/index.d.ts
|
|
54
|
+
interface EslintCdkPlugin {
|
|
55
|
+
rules: typeof rules;
|
|
56
|
+
configs: Readonly<{
|
|
57
|
+
classicRecommended: {
|
|
58
|
+
plugins: ["awscdk"];
|
|
59
|
+
rules: ClassicConfig.RulesRecord;
|
|
60
|
+
};
|
|
61
|
+
classicStrict: {
|
|
62
|
+
plugins: ["awscdk"];
|
|
63
|
+
rules: ClassicConfig.RulesRecord;
|
|
64
|
+
};
|
|
65
|
+
recommended: FlatConfig.Config;
|
|
66
|
+
strict: FlatConfig.Config;
|
|
67
|
+
}>;
|
|
68
|
+
}
|
|
69
|
+
declare const eslintCdkPlugin: EslintCdkPlugin;
|
|
70
|
+
//#endregion
|
|
71
|
+
export { EslintCdkPlugin, configs, eslintCdkPlugin as default, rules };
|
|
72
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/configs/index.ts","../src/rules/index.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;;;;cAGa;;;;;EAAA,CAAA;;;;;;;;;;;;;ECcA,CAAA;CAkBZ;;;cAlBY;uLAkBZ,oCAAA,CAAA,YAAA;;;;EDhCY,2BAKZ,iDAAA,CAAA,oBAAA,EAAA,CAAA;;;;;;;;;;;;;ECSY,eAkBZ,iDAAA,CAAA,cAAA,EAAA,EAAA,EAAA,OAAA,oDAAA;EAAA,sBAAA,iDAAA,CAAA,oBAAA,EAAA;;;;;;;UCzBgB,eAAA;EFPJ,KAAA,EAAA,OEQG,KFHf;WEIU;;;aAGE,aAAA,CAAc;;;;aAId,aAAA,CAAc;;iBAEV,UAAA,CAAW;YAChB,UAAA,CAAW;;ADLvB;cCSM,eDSL,ECTsB,eDStB"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import * as eslint0 from "eslint";
|
|
2
|
+
import * as _typescript_eslint_utils_ts_eslint29 from "@typescript-eslint/utils/ts-eslint";
|
|
3
|
+
import { ClassicConfig, FlatConfig } from "@typescript-eslint/utils/ts-eslint";
|
|
4
|
+
|
|
5
|
+
//#region src/configs/index.d.ts
|
|
6
|
+
declare const configs: {
|
|
7
|
+
recommended: {
|
|
8
|
+
languageOptions: _typescript_eslint_utils_ts_eslint29.FlatConfig.LanguageOptions;
|
|
9
|
+
plugins: _typescript_eslint_utils_ts_eslint29.FlatConfig.Plugins;
|
|
10
|
+
rules: _typescript_eslint_utils_ts_eslint29.FlatConfig.Rules;
|
|
11
|
+
};
|
|
12
|
+
strict: {
|
|
13
|
+
languageOptions: _typescript_eslint_utils_ts_eslint29.FlatConfig.LanguageOptions;
|
|
14
|
+
plugins: _typescript_eslint_utils_ts_eslint29.FlatConfig.Plugins;
|
|
15
|
+
rules: _typescript_eslint_utils_ts_eslint29.FlatConfig.Rules;
|
|
16
|
+
};
|
|
17
|
+
classicRecommended: {
|
|
18
|
+
plugins: ["awscdk"];
|
|
19
|
+
rules: _typescript_eslint_utils_ts_eslint29.ClassicConfig.RulesRecord;
|
|
20
|
+
};
|
|
21
|
+
classicStrict: {
|
|
22
|
+
plugins: ["awscdk"];
|
|
23
|
+
rules: _typescript_eslint_utils_ts_eslint29.ClassicConfig.RulesRecord;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
//#endregion
|
|
27
|
+
//#region src/rules/index.d.ts
|
|
28
|
+
declare const rules: {
|
|
29
|
+
"construct-constructor-property": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidConstructorProperty" | "invalidConstructorType" | "invalidConstructorIdType", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
30
|
+
"migrate-disable-comments": _typescript_eslint_utils_ts_eslint29.RuleModule<"migrateDisableComment", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
31
|
+
"no-construct-in-interface": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidInterfaceProperty", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
32
|
+
"no-construct-in-public-property-of-construct": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidPublicPropertyOfConstruct", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
33
|
+
"no-construct-stack-suffix": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidConstructId", [{
|
|
34
|
+
disallowedSuffixes?: ("Construct" | "Stack")[];
|
|
35
|
+
}], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
36
|
+
"no-import-private": eslint0.Rule.RuleModule;
|
|
37
|
+
"no-mutable-property-of-props-interface": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidPropertyOfPropsInterface", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
38
|
+
"no-mutable-public-property-of-construct": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidPublicPropertyOfConstruct", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
39
|
+
"no-parent-name-construct-id-match": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidConstructId", {
|
|
40
|
+
disallowContainingParentName?: boolean;
|
|
41
|
+
}[], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
42
|
+
"no-unused-props": _typescript_eslint_utils_ts_eslint29.RuleModule<"unusedProp", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
43
|
+
"no-variable-construct-id": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidConstructId", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
44
|
+
"pascal-case-construct-id": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidConstructId", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
45
|
+
"props-name-convention": _typescript_eslint_utils_ts_eslint29.RuleModule<"invalidPropsName", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
46
|
+
"require-jsdoc": _typescript_eslint_utils_ts_eslint29.RuleModule<"missingJSDoc", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
47
|
+
"require-passing-this": _typescript_eslint_utils_ts_eslint29.RuleModule<"missingPassingThis", {
|
|
48
|
+
allowNonThisAndDisallowScope?: boolean;
|
|
49
|
+
}[], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
50
|
+
"require-props-default-doc": _typescript_eslint_utils_ts_eslint29.RuleModule<"missingDefaultDoc", [], unknown, _typescript_eslint_utils_ts_eslint29.RuleListener>;
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region src/index.d.ts
|
|
54
|
+
interface EslintCdkPlugin {
|
|
55
|
+
rules: typeof rules;
|
|
56
|
+
configs: Readonly<{
|
|
57
|
+
classicRecommended: {
|
|
58
|
+
plugins: ["awscdk"];
|
|
59
|
+
rules: ClassicConfig.RulesRecord;
|
|
60
|
+
};
|
|
61
|
+
classicStrict: {
|
|
62
|
+
plugins: ["awscdk"];
|
|
63
|
+
rules: ClassicConfig.RulesRecord;
|
|
64
|
+
};
|
|
65
|
+
recommended: FlatConfig.Config;
|
|
66
|
+
strict: FlatConfig.Config;
|
|
67
|
+
}>;
|
|
68
|
+
}
|
|
69
|
+
declare const eslintCdkPlugin: EslintCdkPlugin;
|
|
70
|
+
//#endregion
|
|
71
|
+
export { EslintCdkPlugin, configs, eslintCdkPlugin as default, rules };
|
|
72
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/configs/index.ts","../src/rules/index.ts","../src/index.ts"],"sourcesContent":[],"mappings":";;;;;cAGa;;;;;EAAA,CAAA;;;;;;;;;;;;;ECcA,CAAA;CAkBZ;;;cAlBY;uLAkBZ,oCAAA,CAAA,YAAA;;;;EDhCY,2BAKZ,iDAAA,CAAA,oBAAA,EAAA,CAAA;;;;;;;;;;;;;ECSY,eAkBZ,iDAAA,CAAA,cAAA,EAAA,EAAA,EAAA,OAAA,oDAAA;EAAA,sBAAA,iDAAA,CAAA,oBAAA,EAAA;;;;;;;UCzBgB,eAAA;EFPJ,KAAA,EAAA,OEQG,KFHf;WEIU;;;aAGE,aAAA,CAAc;;;;aAId,aAAA,CAAc;;iBAEV,UAAA,CAAW;YAChB,UAAA,CAAW;;ADLvB;cCSM,eDSL,ECTsB,eDStB"}
|