Repository: typescript-eslint/tslint-to-eslint-config (ts)

Issue:
Missing tslint-react rule: jsx-ban-props
### Missing Converter

-   `tslint-to-eslint-config` version: 1.0.0-beta

-   `typescript-eslint` version: 2.31.0

#### TSLint Rule Name

jsx-ban-props

#### Package Source

**tslint-react**: https://github.com/palantir/tslint-react (see [#rules](https://github.com/palantir/tslint-react#rules))

Equivalents for tslint-react rules generally live in [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react). If an ESLint rule equivalent doesn't yet exist, this tslint-to-eslint-config issue can be closed until that equivalent is created.

Pull request:
Added converter for jsx-ban-props
## PR Checklist

-   [x] Addresses an existing issue: fixes #517
-   [x] That issue was marked as [`status: accepting prs`](https://github.com/typescript-eslint/tslint-to-eslint-config/labels/status%3A%20accepting%20prs)

## Overview

https://github.com/palantir/tslint-react/blob/master/src/rules/jsxBanPropsRule.ts -> https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/forbid-component-props.md. 

Patch:
diff --git a/src/converters/lintConfigs/rules/ruleConverters.ts b/src/converters/lintConfigs/rules/ruleConverters.ts
index 4baf906..b278b11 100644
--- a/src/converters/lintConfigs/rules/ruleConverters.ts
+++ b/src/converters/lintConfigs/rules/ruleConverters.ts
@@ -176,11 +176,14 @@ import { convertUsePipeDecorator } from "./ruleConverters/codelyzer/use-pipe-dec
 import { convertUsePipeTransformInterface } from "./ruleConverters/codelyzer/use-pipe-transform-interface";
 
 // ESLint-React converters
+import { convertJsxBanProps } from "./ruleConverters/eslint-plugin-react/jsx-ban-props";
 import { convertJsxBooleanValue } from "./ruleConverters/eslint-plugin-react/jsx-boolean-value";
 import { convertJsxCurlySpacing } from "./ruleConverters/eslint-plugin-react/jsx-curly-spacing";
 import { convertJsxEqualsSpacing } from "./ruleConverters/eslint-plugin-react/jsx-equals-spacing";
 import { convertJsxKey } from "./ruleConverters/eslint-plugin-react/jsx-key";
 import { convertJsxNoBind } from "./ruleConverters/eslint-plugin-react/jsx-no-bind";
+import { convertJsxNoLambda } from "./ruleConverters/eslint-plugin-react/jsx-no-lambda";
+import { convertJsxSelfClose } from "./ruleConverters/eslint-plugin-react/jsx-self-close";
 import { convertJsxWrapMultiline } from "./ruleConverters/eslint-plugin-react/jsx-wrap-multiline";
 
 // eslint-plugin-rxjs converters
@@ -237,11 +240,14 @@ export const ruleConverters = new Map([
     ["interface-name", convertInterfaceName],
     ["interface-over-type-literal", convertInterfaceOverTypeLiteral],
     ["jsdoc-format", convertJSDocFormat],
+    ["jsx-ban-props", convertJsxBanProps],
     ["jsx-boolean-value", convertJsxBooleanValue],
     ["jsx-curly-spacing", convertJsxCurlySpacing],
     ["jsx-equals-spacing", convertJsxEqualsSpacing],
     ["jsx-key", convertJsxKey],
     ["jsx-no-bind", convertJsxNoBind],
+    ["jsx-no-lambda", convertJsxNoLambda],
+    ["jsx-self-close", convertJsxSelfClose],
     ["jsx-wrap-multiline", convertJsxWrapMultiline],
     ["label-position", convertLabelPosition],
     ["linebreak-style", convertLinebreakStyle],
diff --git a/src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-react/jsx-ban-props.ts b/src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-react/jsx-ban-props.ts
new file mode 100644
index 0000000..d66dae7
--- /dev/null
+++ b/src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-react/jsx-ban-props.ts
@@ -0,0 +1,23 @@
+import { RuleConverter } from "../../ruleConverter";
+
+export const convertJsxBanProps: RuleConverter = (tslintRule) => {
+    return {
+        rules: [
+            {
+                ...(tslintRule.ruleArguments.length !== 0 && {
+                    ruleArguments: tslintRule.ruleArguments.map((ruleArgument) => ({
+                        forbid:
+                            ruleArgument.length === 1
+                                ? ruleArgument[0]
+                                : {
+                                      message: ruleArgument[1],
+                                      propName: ruleArgument[0],
+                                  },
+                    })),
+                }),
+                ruleName: "react/forbid-component-props",
+            },
+        ],
+        plugins: ["eslint-plugin-react"],
+    };
+};
diff --git a/src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-react/jsx-no-lambda.ts b/src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-react/jsx-no-lambda.ts
new file mode 100644
index 0000000..62f52b3
--- /dev/null
+++ b/src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-react/jsx-no-lambda.ts
@@ -0,0 +1,13 @@
+import { RuleConverter } from "../../ruleConverter";
+
+export const convertJsxNoLambda: RuleConverter = () => {
+    return {
+        rules: [
+            {
+                notices: ["ESLint rule 'jsx-no-bind' also checks for Function.bind"],
+                ruleName: "react/jsx-no-bind",
+            },
+        ],
+        plugins: ["eslint-plugin-react"],
+    };
+};
diff --git a/src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-react/jsx-self-close.ts b/src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-react/jsx-self-close.ts
new file mode 100644
index 0000000..03ab28a
--- /dev/null
+++ b/src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-react/jsx-self-close.ts
@@ -0,0 +1,12 @@
+import { RuleConverter } from "../../ruleConverter";
+
+export const convertJsxSelfClose: RuleConverter = () => {
+    return {
+        rules: [
+            {
+                ruleName: "react/self-closing-comp",
+            },
+        ],
+        plugins: ["eslint-plugin-react"],
+    };
+};


Test patch:
diff --git a/src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-react/tests/jsx-ban-props.test.ts b/src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-react/tests/jsx-ban-props.test.ts
new file mode 100644
index 0000000..ed95596
--- /dev/null
+++ b/src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-react/tests/jsx-ban-props.test.ts
@@ -0,0 +1,64 @@
+import { convertJsxBanProps } from "../jsx-ban-props";
+
+describe(convertJsxBanProps, () => {
+    test("conversion without arguments", () => {
+        const result = convertJsxBanProps({
+            ruleArguments: [],
+        });
+
+        expect(result).toEqual({
+            rules: [
+                {
+                    ruleName: "react/forbid-component-props",
+                },
+            ],
+            plugins: ["eslint-plugin-react"],
+        });
+    });
+
+    test("conversion with a single prop", () => {
+        const result = convertJsxBanProps({
+            ruleArguments: [["someProp"]],
+        });
+
+        expect(result).toEqual({
+            rules: [
+                {
+                    ruleArguments: [
+                        {
+                            forbid: "someProp",
+                        },
+                    ],
+                    ruleName: "react/forbid-component-props",
+                },
+            ],
+            plugins: ["eslint-plugin-react"],
+        });
+    });
+
+    test("conversion with a message", () => {
+        const result = convertJsxBanProps({
+            ruleArguments: [["someProp"], ["anotherProp", "Optional explanation"]],
+        });
+
+        expect(result).toEqual({
+            rules: [
+                {
+                    ruleArguments: [
+                        {
+                            forbid: "someProp",
+                        },
+                        {
+                            forbid: {
+                                message: "Optional explanation",
+                                propName: "anotherProp",
+                            },
+                        },
+                    ],
+                    ruleName: "react/forbid-component-props",
+                },
+            ],
+            plugins: ["eslint-plugin-react"],
+        });
+    });
+});
diff --git a/src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-react/tests/jsx-no-lambda.test.ts b/src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-react/tests/jsx-no-lambda.test.ts
new file mode 100644
index 0000000..d57750c
--- /dev/null
+++ b/src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-react/tests/jsx-no-lambda.test.ts
@@ -0,0 +1,19 @@
+import { convertJsxNoLambda } from "../jsx-no-lambda";
+
+describe(convertJsxNoLambda, () => {
+    test("conversion without arguments", () => {
+        const result = convertJsxNoLambda({
+            ruleArguments: [],
+        });
+
+        expect(result).toEqual({
+            rules: [
+                {
+                    notices: ["ESLint rule 'jsx-no-bind' also checks for Function.bind"],
+                    ruleName: "react/jsx-no-bind",
+                },
+            ],
+            plugins: ["eslint-plugin-react"],
+        });
+    });
+});
diff --git a/src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-react/tests/jsx-self-close.test.ts b/src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-react/tests/jsx-self-close.test.ts
new file mode 100644
index 0000000..511ca2c
--- /dev/null
+++ b/src/converters/lintConfigs/rules/ruleConverters/eslint-plugin-react/tests/jsx-self-close.test.ts
@@ -0,0 +1,18 @@
+import { convertJsxSelfClose } from "../jsx-self-close";
+
+describe(convertJsxSelfClose, () => {
+    test("conversion without arguments", () => {
+        const result = convertJsxSelfClose({
+            ruleArguments: [],
+        });
+
+        expect(result).toEqual({
+            rules: [
+                {
+                    ruleName: "react/self-closing-comp",
+                },
+            ],
+            plugins: ["eslint-plugin-react"],
+        });
+    });
+});