Closed
Description
Hello.
I can not say, confidently, that this is a bug or a problem with my code. But when I run eslint with --fix the lines under jsx-sort-props
is breaking all the file and making such a mess.
Here is the output only to this file without the --fix
flag:
5:1 error Imports should be sorted alphabetically sort-imports-es6-autofix/sort-imports-es6
118:9 error Props should be sorted alphabetically react/jsx-sort-props
119:9 error Props should be sorted alphabetically react/jsx-sort-props
120:9 error Props should be sorted alphabetically react/jsx-sort-props
121:9 error Props should be sorted alphabetically react/jsx-sort-props
122:9 error Props should be sorted alphabetically react/jsx-sort-props
130:9 error Props should be sorted alphabetically react/jsx-sort-props
132:9 error Props should be sorted alphabetically react/jsx-sort-props
133:9 error Props should be sorted alphabetically react/jsx-sort-props
134:9 error Props should be sorted alphabetically react/jsx-sort-props
135:9 error Props should be sorted alphabetically react/jsx-sort-props
136:9 error Props should be sorted alphabetically react/jsx-sort-props
137:9 error Props should be sorted alphabetically react/jsx-sort-props
138:9 error Props should be sorted alphabetically react/jsx-sort-props
149:9 error Props should be sorted alphabetically react/jsx-sort-props
150:9 error Props should be sorted alphabetically react/jsx-sort-props
151:9 error Props should be sorted alphabetically react/jsx-sort-props
159:9 error Props should be sorted alphabetically react/jsx-sort-props
161:9 error Props should be sorted alphabetically react/jsx-sort-props
162:9 error Props should be sorted alphabetically react/jsx-sort-props
163:9 error Props should be sorted alphabetically react/jsx-sort-props
164:9 error Props should be sorted alphabetically react/jsx-sort-props
165:9 error Props should be sorted alphabetically react/jsx-sort-props
166:9 error Props should be sorted alphabetically react/jsx-sort-props
167:9 error Props should be sorted alphabetically react/jsx-sort-props
178:9 error Props should be sorted alphabetically react/jsx-sort-props
Ok. When I run the --fix flag, the JSX Tags in my file turn from this:
<CreateNewJob
closed={false}
flagOptions={flagOptions}
jobHeight={300}
jobWidth={200}
campaign='Some Campaign name'
campaignStart={moment('2018-07-28 00:00:00')}
campaignFinish={moment('2018-09-01 00:00:00')}
jobNumber={'Job Number can be a String'}
jobTemplateOptions={jobTemplateOptions}
numberOfPages={30}
onChange={onChange}
onClose={onClose}
spreadSheetTemplateOptions={spreadSheetTemplateOptions}
stateMachineOptions={stateMachineOptions}
workflowTemplateOptions={workflowTemplateOptions}
workflowTemplateSteps={workflowTemplateSteps}
description='Some description for this job'
jobTemplate='1'
stateMachine='1'
flag='1'
spreadSheetTemplate='1'
workflowTemplate='1'
validation={validation}
onSubmit={onSubmit}
/>
To this:
<CreateNewJob
campaign='Some Campaign name'
campaignFinish={moment('2018-09-01 00:00:00')}
campaignStart={moment('2closed={false}0:00')}
description='Some description for thisflag='1'ampaignStart={moment('2018-07-28 00:00:00')}
flagOptions={flagOptions}0:00')}
jobNumber={'JojobHeight={300}mplateOptions={jobTemplateOptions}jobNumber={'Job Number can be a String'}hange={ojobTemplate='1'nClose={onCljobTemplateOptions={jobTempljobWidth={200}s={30}
stateMachineOpti
stateMachineOptions={stateMachineOptions}
workflowTemplateOptions={workflowTemplateOptions}
workflowTemplateSteps={workflowTemplateSteps}
description='Some description for this job'
jobTemplate='1'
stateMachine='1'
flag='1'
spreadSheetTemplate='1'
workflowTemplate='1'
validation={validation}
onSubmit={onSubmit}
/>
Is there anything I could do to make it auto fix work? It would be really tedious to fix them all manually.
Any suggestion is appreciated.
Thank you.