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.
@@ -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 = ESLintUtils.RuleCreator.withoutDocs({
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 = ESLintUtils.RuleCreator.withoutDocs({
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 = ESLintUtils.RuleCreator.withoutDocs({
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 = ESLintUtils.RuleCreator.withoutDocs({
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
- AST_NODE_TYPES,
3
- AST_TOKEN_TYPES,
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 = ESLintUtils.RuleCreator.withoutDocs({
10
+ export const requirePropsDefaultDoc = createRule({
11
+ name: "require-props-default-doc",
14
12
  meta: {
15
13
  type: "problem",
16
14
  docs: {
@@ -0,0 +1,5 @@
1
+ import { ESLintUtils } from "@typescript-eslint/utils";
2
+
3
+ export const createRule = ESLintUtils.RuleCreator(
4
+ (name) => `https://eslint-cdk-plugin.dev/rules/${name}`
5
+ );