@linthtml/linthtml
Advanced tools
Changelog
v0.8.0
It's now possible to provide plugins to LintHTML using the property plugins
in the config file.
This property accept a string or an array of strings. The string values can be the name of a package or the path to a file.
To learn more about Plugins read the documentation page.
Value for settings attr-name-ignore-regex
and id-class-ignore-regex
are now correctly converted to regexp when coming from a json config file.
Changelog
v0.8.0-beta.1
It's now possible to provide plugins to LintHTML using the property plugins
in the config file.
This property accept a string value or an array of string, which could be the name of package or the path to a file.
To learn more about Plugins read the documentation page.
Changelog
v0.7.2
indent-width
now longer ignore nodes that are siblings with a text node ending with an EOL char<div>
foo
<span>bar</span>
<!-- Now the previous node is correctly handle and this report an error -->
</div>
Changelog
v0.7.0
Because of the latest version of htmlparser2, the HTML parser now return a single node instead of an array of nodes. The node returned by the parser is the root
node of the HTML document parsed.
This internal change has also an impact on the new parser feature. Custom parsers will also have to return a root
node to LintHTML and not an array of node.
It's now possible to provide a custom parser to the linter using the property parser
in the config file.
This property accept a string value, which could be the name of package or the path to a file. The file or package should expose a function that takes a string value in input (HTML to parse) and return an AST tree compatible with LintHTML.
You can have a look to @linthtml/linthtml-pug to see an example of a custom parser.
Move nested rules into their own folder. The code for rules like indent-width
, indent-style
... are no longer mixed in the files.
indent
property to nodeNodes no longer have the property indent
. This property was used by the rules indent-*
to know what type of indentation is present before a node.
But this property was not necessary, a node indentation can be found by looking at the previous node. If the previous node is a text node with only spaces/tabs chars then it's an indentation node and we can use it, otherwise, it means that the node has no indentation.
--print-config
option with meowChangelog
v0.7.0-beta.4
Because of the latest version of htmlparser2 the HTML parser now return a single node instead of an array of nodes. The node returned by the parser is the root
node of the HTML document parsed.
This internal change has also an impact on the new parser feature. Custom parsers will also have to return a root
node to LintHTML.
indent
property to nodeNodes no longer have the property indent
. This property was used by the rules indent-*
to know what type of indentation is present before a node.
But this property was not necessary, a node indentation can be found by looking at the previous node. If the previous node is a text node with only spaces/tabs chars then it's an indentation node and we can use it, otherwise, it means that the node has no indentation.
Changelog
v0.7.0-beta.3
It's now possible to provide a custom parser to the linter using the property parser
in the config file.
This property accept a string value, which could be the name of package or the path to a file. The file or package should expose a function that takes a string value in input (HTML to parse) and return an AST tree compatible with LintHTML.
You can have a look to @linthtml/linthtml-pug to see an example of a custom parser.