File tree Expand file tree Collapse file tree 3 files changed +34
-0
lines changed
converters/eslint-plugin-react Expand file tree Collapse file tree 3 files changed +34
-0
lines changed Original file line number Diff line number Diff line change 1+ import { RuleConverter } from "../../converter" ;
2+
3+ export const convertJsxNoBind : RuleConverter = ( ) => {
4+ return {
5+ rules : [
6+ {
7+ ruleName : "react/jsx-no-bind" ,
8+ notices : [ "ESLint rule 'jsx-no-bind' also checks for arrow functions" ] ,
9+ } ,
10+ ] ,
11+ plugins : [ "eslint-plugin-react" ] ,
12+ } ;
13+ } ;
Original file line number Diff line number Diff line change 1+ import { convertJsxNoBind } from "../jsx-no-bind" ;
2+
3+ describe ( convertJsxNoBind , ( ) => {
4+ test ( "conversion without arguments" , ( ) => {
5+ const result = convertJsxNoBind ( {
6+ ruleArguments : [ ] ,
7+ } ) ;
8+
9+ expect ( result ) . toEqual ( {
10+ rules : [
11+ {
12+ ruleName : "react/jsx-no-bind" ,
13+ notices : [ "ESLint rule 'jsx-no-bind' also checks for arrow functions" ] ,
14+ } ,
15+ ] ,
16+ plugins : [ "eslint-plugin-react" ] ,
17+ } ) ;
18+ } ) ;
19+ } ) ;
Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ import { convertJsxBooleanValue } from "./converters/eslint-plugin-react/jsx-boo
177177import { convertJsxCurlySpacing } from "./converters/eslint-plugin-react/jsx-curly-spacing" ;
178178import { convertJsxEqualsSpacing } from "./converters/eslint-plugin-react/jsx-equals-spacing" ;
179179import { convertJsxKey } from "./converters/eslint-plugin-react/jsx-key" ;
180+ import { convertJsxNoBind } from "./converters/eslint-plugin-react/jsx-no-bind" ;
180181
181182/**
182183 * Keys TSLint rule names to their ESLint rule converters.
@@ -218,6 +219,7 @@ export const rulesConverters = new Map([
218219 [ "jsx-curly-spacing" , convertJsxCurlySpacing ] ,
219220 [ "jsx-equals-spacing" , convertJsxEqualsSpacing ] ,
220221 [ "jsx-key" , convertJsxKey ] ,
222+ [ "jsx-no-bind" , convertJsxNoBind ] ,
221223 [ "label-position" , convertLabelPosition ] ,
222224 [ "linebreak-style" , convertLinebreakStyle ] ,
223225 [ "max-classes-per-file" , convertMaxClassesPerFile ] ,
You can’t perform that action at this time.
0 commit comments