Skip to content

Support for multilineLast in jsx-sort-props #3170

Closed
@duhamelgm

Description

@duhamelgm

Hello!

We have an use case that its not covered in jsx-sort-props.
For readability purposes we prefer to have multiline props at the bottom. We found that long components become hard to read when following only alphabetical order, and it's prefered to split them by the complexity of the prop instead.

// Current jsx-sort-props 
<Field
  float
  className={classNames(classes.inputWidth, {
    [classes.noBorder]: isActive === "values",
  })}
  disabled={isDisabled}
  initialValue={computePercentage(number, count)}
  InputProps={{
    ...customInputProps,
  }}
  inputProps={{
    className: inputClassName,
  }}
  min="0"
  name="fieldName"
  placeholder={getTranslation("field")}
  validate={validate}
/>
// Using a possible multilineLast rule option
<Field
  float
  disabled={isDisabled}
  initialValue={computePercentage(number, count)}
  min="0"
  name="fieldName"
  placeholder={getTranslation("field")}
  validate={validate}
  className={classNames(classes.inputWidth, {
    [classes.noBorder]: isActive === "values",
  })}
  InputProps={{
    ...customInputProps
  }}
  inputProps={{
    className: inputClassName,
  }}
/>

Should this option be implemented in jsx-sort-props?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions