Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Grouped sorting of JSX props for ESLint

License

NotificationsYou must be signed in to change notification settings

ericmatthys/eslint-plugin-jsx-grouped-sort-props

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Specify a specific order of props or use named groups with loose ordering within each group.

Rule Details

This rule checks all JSX components and verifies that all props are sorted correctly.

Rule Options

..."jsx-grouped-sort-props/jsx-grouped-sort-props":[<enabled>, [{group:"reserved"},  "foo",  "bar",{group:"html"},{group:"aria"},{group:"data"},{group:"other"},{group:"callback"}]]...

reserved

All reserved props, as listed in theReact docs.

<Buttonkey="1"ref="button"/>

html

All props that map to supported html attributes, as listed in theReact docs.

<ButtonclassName="goodbye"/>

aria

All aria-* attributes. If not specified, aria-* attributes will be considered part of thehtml group.

<Buttonaria-label="Submit"/>

data

All custom data-* attributes. If not specified, data-* attributes will be considered part of thehtml group.

<Buttondata-id="submit"/>

callback

All props that match the patternonCallback.

<ButtononClick={onClick}/>

other

All props that do not match a different group.

<ButtonisLoading={true}/>

When not to use

This rule is a formatting preference and not following it won't negatively affect the quality of your code. If prop sort order isn't a part of your coding standards, then you can leave this rule off.

About

Grouped sorting of JSX props for ESLint

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp