eslint-cdk-plugin 3.0.2 → 3.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.
- package/dist/index.cjs +105 -91
- package/dist/index.mjs +105 -91
- package/package.json +3 -2
- package/src/rules/construct-constructor-property.ts +34 -36
- package/src/rules/no-construct-in-interface.ts +3 -2
- package/src/rules/no-construct-in-public-property-of-construct.ts +45 -45
- package/src/rules/no-construct-stack-suffix.ts +3 -2
- package/src/rules/no-import-private.ts +1 -1
- package/src/rules/no-mutable-property-of-props-interface.ts +49 -49
- package/src/rules/no-mutable-public-property-of-construct.ts +60 -60
- package/src/rules/no-parent-name-construct-id-match.ts +60 -61
- package/src/rules/no-variable-construct-id.ts +3 -1
- package/src/rules/pascal-case-construct-id.ts +3 -2
- package/src/rules/props-name-convention.ts +3 -2
- package/src/rules/require-jsdoc.ts +3 -2
- package/src/rules/require-passing-this.ts +3 -2
- package/src/rules/require-props-default-doc.ts +5 -7
- package/src/utils/createRule.ts +5 -0
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
} from "@typescript-eslint/utils";
|
|
7
7
|
|
|
8
8
|
import { toPascalCase } from "../utils/convertString";
|
|
9
|
+
import { createRule } from "../utils/createRule";
|
|
9
10
|
import { getConstructorPropertyNames } from "../utils/parseType";
|
|
10
11
|
import { isConstructOrStackType } from "../utils/typeCheck";
|
|
11
12
|
|
|
@@ -23,9 +24,9 @@ type Context = TSESLint.RuleContext<"invalidConstructId", []>;
|
|
|
23
24
|
* Enforce PascalCase for Construct ID.
|
|
24
25
|
* @param context - The rule context provided by ESLint
|
|
25
26
|
* @returns An object containing the AST visitor functions
|
|
26
|
-
* @see {@link https://eslint-cdk-plugin.dev/rules/pascal-case-construct-id} - Documentation
|
|
27
27
|
*/
|
|
28
|
-
export const pascalCaseConstructId =
|
|
28
|
+
export const pascalCaseConstructId = createRule({
|
|
29
|
+
name: "pascal-case-construct-id",
|
|
29
30
|
meta: {
|
|
30
31
|
type: "problem",
|
|
31
32
|
docs: {
|
|
@@ -4,15 +4,16 @@ import {
|
|
|
4
4
|
TSESTree,
|
|
5
5
|
} from "@typescript-eslint/utils";
|
|
6
6
|
|
|
7
|
+
import { createRule } from "../utils/createRule";
|
|
7
8
|
import { isConstructType } from "../utils/typeCheck";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Enforces a naming convention for props interfaces in Construct classes
|
|
11
12
|
* @param context - The rule context provided by ESLint
|
|
12
13
|
* @returns An object containing the AST visitor functions
|
|
13
|
-
* @see {@link https://eslint-cdk-plugin.dev/rules/props-name-convention} - Documentation
|
|
14
14
|
*/
|
|
15
|
-
export const propsNameConvention =
|
|
15
|
+
export const propsNameConvention = createRule({
|
|
16
|
+
name: "props-name-convention",
|
|
16
17
|
meta: {
|
|
17
18
|
type: "problem",
|
|
18
19
|
docs: {
|
|
@@ -4,15 +4,16 @@ import {
|
|
|
4
4
|
ESLintUtils,
|
|
5
5
|
} from "@typescript-eslint/utils";
|
|
6
6
|
|
|
7
|
+
import { createRule } from "../utils/createRule";
|
|
7
8
|
import { isConstructType } from "../utils/typeCheck";
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
11
|
* Require JSDoc comments for interface properties and public properties in Construct classes
|
|
11
12
|
* @param context - The rule context provided by ESLint
|
|
12
13
|
* @returns An object containing the AST visitor functions
|
|
13
|
-
* @see {@link https://eslint-cdk-plugin.dev/rules/require-jsdoc} - Documentation
|
|
14
14
|
*/
|
|
15
|
-
export const requireJSDoc =
|
|
15
|
+
export const requireJSDoc = createRule({
|
|
16
|
+
name: "require-jsdoc",
|
|
16
17
|
meta: {
|
|
17
18
|
type: "problem",
|
|
18
19
|
docs: {
|
|
@@ -4,6 +4,7 @@ import {
|
|
|
4
4
|
TSESLint,
|
|
5
5
|
} from "@typescript-eslint/utils";
|
|
6
6
|
|
|
7
|
+
import { createRule } from "../utils/createRule";
|
|
7
8
|
import { getConstructorPropertyNames } from "../utils/parseType";
|
|
8
9
|
import { isConstructType } from "../utils/typeCheck";
|
|
9
10
|
|
|
@@ -19,9 +20,9 @@ type Context = TSESLint.RuleContext<"missingPassingThis", Options>;
|
|
|
19
20
|
* Enforces that `this` is passed to the constructor
|
|
20
21
|
* @param context - The rule context provided by ESLint
|
|
21
22
|
* @returns An object containing the AST visitor functions
|
|
22
|
-
* @see {@link https://eslint-cdk-plugin.dev/rules/require-passing-this} - Documentation
|
|
23
23
|
*/
|
|
24
|
-
export const requirePassingThis =
|
|
24
|
+
export const requirePassingThis = createRule({
|
|
25
|
+
name: "require-passing-this",
|
|
25
26
|
meta: {
|
|
26
27
|
type: "problem",
|
|
27
28
|
docs: {
|
|
@@ -1,16 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
ESLintUtils,
|
|
5
|
-
} from "@typescript-eslint/utils";
|
|
1
|
+
import { AST_NODE_TYPES, AST_TOKEN_TYPES } from "@typescript-eslint/utils";
|
|
2
|
+
|
|
3
|
+
import { createRule } from "../utils/createRule";
|
|
6
4
|
|
|
7
5
|
/**
|
|
8
6
|
* Requires @default JSDoc documentation for optional properties in interfaces ending with 'Props'
|
|
9
7
|
* @param context - The rule context provided by ESLint
|
|
10
8
|
* @returns An object containing the AST visitor functions
|
|
11
|
-
* @see {@link https://eslint-cdk-plugin.dev/rules/require-props-default-doc} - Documentation
|
|
12
9
|
*/
|
|
13
|
-
export const requirePropsDefaultDoc =
|
|
10
|
+
export const requirePropsDefaultDoc = createRule({
|
|
11
|
+
name: "require-props-default-doc",
|
|
14
12
|
meta: {
|
|
15
13
|
type: "problem",
|
|
16
14
|
docs: {
|