diff --git a/src/converters/lintConfigs/rules/ruleConverters.ts b/src/converters/lintConfigs/rules/ruleConverters.ts index ee2779794..5f72f64bd 100644 --- a/src/converters/lintConfigs/rules/ruleConverters.ts +++ b/src/converters/lintConfigs/rules/ruleConverters.ts @@ -181,6 +181,7 @@ import { convertJsxCurlySpacing } from "./ruleConverters/eslint-plugin-react/jsx 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"; @@ -243,6 +244,7 @@ export const ruleConverters = new Map([ ["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], 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 000000000..62f52b363 --- /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/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 000000000..d57750c2a --- /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"], + }); + }); +});