File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed
converters/eslint-plugin-react Expand file tree Collapse file tree 3 files changed +32
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { RuleConverter } from "../../converter" ;
2
+
3
+ export const convertJsxKey : RuleConverter = ( ) => {
4
+ return {
5
+ rules : [
6
+ {
7
+ ruleName : "react/jsx-key" ,
8
+ } ,
9
+ ] ,
10
+ plugins : [ "eslint-plugin-react" ] ,
11
+ } ;
12
+ } ;
Original file line number Diff line number Diff line change
1
+ import { convertJsxKey } from "../jsx-key" ;
2
+
3
+ describe ( convertJsxKey , ( ) => {
4
+ test ( "conversion without arguments" , ( ) => {
5
+ const result = convertJsxKey ( {
6
+ ruleArguments : [ ] ,
7
+ } ) ;
8
+
9
+ expect ( result ) . toEqual ( {
10
+ rules : [
11
+ {
12
+ ruleName : "react/jsx-key" ,
13
+ } ,
14
+ ] ,
15
+ plugins : [ "eslint-plugin-react" ] ,
16
+ } ) ;
17
+ } ) ;
18
+ } ) ;
Original file line number Diff line number Diff line change @@ -174,6 +174,7 @@ import { convertUsePipeTransformInterface } from "./converters/codelyzer/use-pip
174
174
175
175
// ESLint-React converters
176
176
import { convertJsxBooleanValue } from "./converters/eslint-plugin-react/jsx-boolean-value" ;
177
+ import { convertJsxKey } from "./converters/eslint-plugin-react/jsx-key" ;
177
178
178
179
/**
179
180
* Keys TSLint rule names to their ESLint rule converters.
@@ -212,6 +213,7 @@ export const rulesConverters = new Map([
212
213
[ "interface-over-type-literal" , convertInterfaceOverTypeLiteral ] ,
213
214
[ "jsdoc-format" , convertJSDocFormat ] ,
214
215
[ "jsx-boolean-value" , convertJsxBooleanValue ] ,
216
+ [ "jsx-key" , convertJsxKey ] ,
215
217
[ "label-position" , convertLabelPosition ] ,
216
218
[ "linebreak-style" , convertLinebreakStyle ] ,
217
219
[ "max-classes-per-file" , convertMaxClassesPerFile ] ,
You can’t perform that action at this time.
0 commit comments