-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
1,268 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
### `sort-tags` | ||
|
||
Sorts tags by a specified sequence according to tag name. | ||
|
||
(Default order originally inspired by [`@homer0/prettier-plugin-jsdoc`](https://github.com/homer0/packages/tree/main/packages/public/prettier-plugin-jsdoc).) | ||
|
||
#### Options | ||
|
||
##### `tagSequence` | ||
|
||
An array of tag names indicating the preferred sequence for sorting tags. | ||
|
||
Tag names earlier in the list will be arranged first. The relative position of | ||
tags of the same name will not be changed. | ||
|
||
Tags not in the list will be sorted alphabetically at the end (or in place of | ||
the pseudo-tag `-other` placed within `tagSequence`) if `alphabetizeExtras` is | ||
enabled and in their order of appearance otherwise (so if you want all your | ||
tags alphabetized, supply an empty array with `alphabetizeExtras` enabled). | ||
|
||
Defaults to the array below. | ||
|
||
Please note that this order is still experimental, so if you want to retain | ||
a fixed order that doesn't change into the future, supply your own | ||
`tagSequence`. | ||
|
||
```js | ||
[ | ||
// Brief descriptions | ||
'summary', | ||
'typeSummary', | ||
|
||
// Module/file-level | ||
'module', | ||
'exports', | ||
'file', | ||
'fileoverview', | ||
'overview', | ||
|
||
// Identifying (name, type) | ||
'typedef', | ||
'interface', | ||
'record', | ||
'template', | ||
'name', | ||
'kind', | ||
'type', | ||
'alias', | ||
'external', | ||
'host', | ||
'callback', | ||
'func', | ||
'function', | ||
'method', | ||
'class', | ||
'constructor', | ||
|
||
// Relationships | ||
'modifies', | ||
'mixes', | ||
'mixin', | ||
'mixinClass', | ||
'mixinFunction', | ||
'namespace', | ||
'borrows', | ||
'constructs', | ||
'lends', | ||
'implements', | ||
'requires', | ||
|
||
// Long descriptions | ||
'desc', | ||
'description', | ||
'classdesc', | ||
'tutorial', | ||
'copyright', | ||
'license', | ||
|
||
// Simple annotations | ||
'const', | ||
'constant', | ||
'final', | ||
'global', | ||
'readonly', | ||
'abstract', | ||
'virtual', | ||
'var', | ||
'member', | ||
'memberof', | ||
'memberof!', | ||
'inner', | ||
'instance', | ||
'inheritdoc', | ||
'inheritDoc', | ||
'override', | ||
'hideconstructor', | ||
|
||
// Core function/object info | ||
'param', | ||
'arg', | ||
'argument', | ||
'prop', | ||
'property', | ||
'return', | ||
'returns', | ||
|
||
// Important behavior details | ||
'async', | ||
'generator', | ||
'default', | ||
'defaultvalue', | ||
'enum', | ||
'augments', | ||
'extends', | ||
'throws', | ||
'exception', | ||
'yield', | ||
'yields', | ||
'event', | ||
'fires', | ||
'emits', | ||
'listens', | ||
'this', | ||
|
||
// Access | ||
'static', | ||
'private', | ||
'protected', | ||
'public', | ||
'access', | ||
'package', | ||
|
||
'-other', | ||
|
||
// Supplementary descriptions | ||
'see', | ||
'example', | ||
|
||
// METADATA | ||
|
||
// Other Closure (undocumented) metadata | ||
'closurePrimitive', | ||
'customElement', | ||
'expose', | ||
'hidden', | ||
'idGenerator', | ||
'meaning', | ||
'ngInject', | ||
'owner', | ||
'wizaction', | ||
|
||
// Other Closure (documented) metadata | ||
'define', | ||
'dict', | ||
'export', | ||
'externs', | ||
'implicitCast', | ||
'noalias', | ||
'nocollapse', | ||
'nocompile', | ||
'noinline', | ||
'nosideeffects', | ||
'polymer', | ||
'polymerBehavior', | ||
'preserve', | ||
'struct', | ||
'suppress', | ||
'unrestricted', | ||
|
||
// @homer0/prettier-plugin-jsdoc metadata | ||
'category', | ||
|
||
// Non-Closure metadata | ||
'ignore', | ||
'author', | ||
'version', | ||
'variation', | ||
'since', | ||
'deprecated', | ||
'todo', | ||
]; | ||
``` | ||
|
||
##### `alphabetizeExtras` | ||
|
||
Defaults to `false`. Alphabetizes any items not within `tagSequence` after any | ||
items within `tagSequence` (or in place of the special `-other` pseudo-tag) | ||
are sorted. | ||
|
||
||| | ||
|---|---| | ||
|Context|everywhere| | ||
|Tags|any| | ||
|Recommended|false| | ||
|Settings|| | ||
|Options|`tagSequence`, `alphabetizeExtras`| | ||
|
||
<!-- assertions sortTags --> |
Oops, something went wrong.