File tree Expand file tree Collapse file tree 3 files changed +32
-0
lines changed
src/converters/lintConfigs/rules
ruleConverters/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 @@ -181,6 +181,7 @@ import { convertJsxCurlySpacing } from "./ruleConverters/eslint-plugin-react/jsx
181181import { convertJsxEqualsSpacing } from "./ruleConverters/eslint-plugin-react/jsx-equals-spacing" ;
182182import { convertJsxKey } from "./ruleConverters/eslint-plugin-react/jsx-key" ;
183183import { convertJsxNoBind } from "./ruleConverters/eslint-plugin-react/jsx-no-bind" ;
184+ import { convertJsxSelfClose } from "./ruleConverters/eslint-plugin-react/jsx-self-close" ;
184185import { convertJsxWrapMultiline } from "./ruleConverters/eslint-plugin-react/jsx-wrap-multiline" ;
185186
186187// eslint-plugin-rxjs converters
@@ -242,6 +243,7 @@ export const ruleConverters = new Map([
242243 [ "jsx-equals-spacing" , convertJsxEqualsSpacing ] ,
243244 [ "jsx-key" , convertJsxKey ] ,
244245 [ "jsx-no-bind" , convertJsxNoBind ] ,
246+ [ "jsx-self-close" , convertJsxSelfClose ] ,
245247 [ "jsx-wrap-multiline" , convertJsxWrapMultiline ] ,
246248 [ "label-position" , convertLabelPosition ] ,
247249 [ "linebreak-style" , convertLinebreakStyle ] ,
Original file line number Diff line number Diff line change 1+ import { RuleConverter } from "../../ruleConverter" ;
2+
3+ export const convertJsxSelfClose : RuleConverter = ( ) => {
4+ return {
5+ rules : [
6+ {
7+ ruleName : "react/self-closing-comp" ,
8+ } ,
9+ ] ,
10+ plugins : [ "eslint-plugin-react" ] ,
11+ } ;
12+ } ;
Original file line number Diff line number Diff line change 1+ import { convertJsxSelfClose } from "../jsx-self-close" ;
2+
3+ describe ( convertJsxSelfClose , ( ) => {
4+ test ( "conversion without arguments" , ( ) => {
5+ const result = convertJsxSelfClose ( {
6+ ruleArguments : [ ] ,
7+ } ) ;
8+
9+ expect ( result ) . toEqual ( {
10+ rules : [
11+ {
12+ ruleName : "react/self-closing-comp" ,
13+ } ,
14+ ] ,
15+ plugins : [ "eslint-plugin-react" ] ,
16+ } ) ;
17+ } ) ;
18+ } ) ;
You can’t perform that action at this time.
0 commit comments