posthtml-attrs-sorter
A PostHTML plugin for sort attribute of the tag based on the given order.
Install
$ npm i -D posthtml-attrs-sorter
Why?
To follow the guidelines for writing code such as Code Guide by @mdo.
Usage
const posthtml = ;const attrsSorter = ;const htmlRaw = fs;
You can also use this plugin in the PostHTML plugin to Gulp or Grunt.
Options
order
- Type:
string[]
- Info:
- Strings are turned into Regular Expressions
- Use
$unknown$
to specify where the unsorted attributes are placed
- Default: http://codeguide.co/#html-attribute-order
An array of attributes in the correct order.
Plugins for editors and IDE
Changelog
See the Releases section of our GitHub project for changelogs for each release version.
License
MIT.