1.0.7 • Published 2 years ago
eslint-plugin-sort-annotation v1.0.7
eslint-plugin-sort-annotation
An ESLint plugin for sorting interface properties, object keys and array values if code has annotation. Rules support auto fix and Typescript also.
sort-annotation/sort | sort-annotation/sort-keys |
|---|---|
![]() | ![]() |
Installation
You’ll first need to install ESLint:
npm i eslint --save-devNext, install eslint-plugin-sort-annotation:
npm i eslint-plugin-sort-annotation --save-devUsage
Here’s a suggested ESLint configuration that:
{
"parserOptions": { ... }, // Nothing changed
"plugins": [..., "sort-annotation"], // Add 'sort-annotation' next to old plugins
"rules": {
...
// Add below rules next to old rules
'sort-annotation/sort-keys': 'error',
'sort-annotation/sort': 'error',
}
}Supported Rules
sort-keys: Sort interface properties or object keys if has@sort-keysannotationsort: Sort array values if has@sortannotation
License
BSD License

