Skip to content

Commit f9eef67

Browse files
author
Josh Goldberg
authored
Added converter for jsx-no-lambda (#863)
* Added converter for jsx-no-lambda * Test...
1 parent 8f2a227 commit f9eef67

File tree

3 files changed

+34
-0
lines changed

3 files changed

+34
-0
lines changed

src/converters/lintConfigs/rules/ruleConverters.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ import { convertJsxCurlySpacing } from "./ruleConverters/eslint-plugin-react/jsx
181181
import { convertJsxEqualsSpacing } from "./ruleConverters/eslint-plugin-react/jsx-equals-spacing";
182182
import { convertJsxKey } from "./ruleConverters/eslint-plugin-react/jsx-key";
183183
import { convertJsxNoBind } from "./ruleConverters/eslint-plugin-react/jsx-no-bind";
184+
import { convertJsxNoLambda } from "./ruleConverters/eslint-plugin-react/jsx-no-lambda";
184185
import { convertJsxSelfClose } from "./ruleConverters/eslint-plugin-react/jsx-self-close";
185186
import { convertJsxWrapMultiline } from "./ruleConverters/eslint-plugin-react/jsx-wrap-multiline";
186187

@@ -243,6 +244,7 @@ export const ruleConverters = new Map([
243244
["jsx-equals-spacing", convertJsxEqualsSpacing],
244245
["jsx-key", convertJsxKey],
245246
["jsx-no-bind", convertJsxNoBind],
247+
["jsx-no-lambda", convertJsxNoLambda],
246248
["jsx-self-close", convertJsxSelfClose],
247249
["jsx-wrap-multiline", convertJsxWrapMultiline],
248250
["label-position", convertLabelPosition],
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { RuleConverter } from "../../ruleConverter";
2+
3+
export const convertJsxNoLambda: RuleConverter = () => {
4+
return {
5+
rules: [
6+
{
7+
notices: ["ESLint rule 'jsx-no-bind' also checks for Function.bind"],
8+
ruleName: "react/jsx-no-bind",
9+
},
10+
],
11+
plugins: ["eslint-plugin-react"],
12+
};
13+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import { convertJsxNoLambda } from "../jsx-no-lambda";
2+
3+
describe(convertJsxNoLambda, () => {
4+
test("conversion without arguments", () => {
5+
const result = convertJsxNoLambda({
6+
ruleArguments: [],
7+
});
8+
9+
expect(result).toEqual({
10+
rules: [
11+
{
12+
notices: ["ESLint rule 'jsx-no-bind' also checks for Function.bind"],
13+
ruleName: "react/jsx-no-bind",
14+
},
15+
],
16+
plugins: ["eslint-plugin-react"],
17+
});
18+
});
19+
});

0 commit comments

Comments
 (0)