0.1.12 • Published 3 years ago
@factorial/stack-html v0.1.12
@factorial/stack-html
This is the HTML plugin for @factorial/stack-core.
It adds a lint task using https://html-validate.org/.
Installation
You can install it via:
yarn factorial initor manually via:
yarn add @factorial/stack-htmlMake sure it is added to your .factorialrc.js like this:
// .factorialrc.js
module.exports = {
use: [require("@factorial/stack-html")],
};And add a .htmlvalidate.js:
// .htmlvalidate.js
const htmlValidateConfig = require("@factorial/stack-html").htmlValidate;
module.exports = htmlValidateConfig;Extending or overwriting linting rules
If you need to extend or overwrite the linting rules, you can do that like this:
const htmlValidateConfig = require("@factorial/stack-html").htmlValidate;
const deepMerge = require("deepmerge");
module.exports = deepMerge(htmlValidateConfig, {
rules: {
…
},
});Default configuration
This package uses the html-validate:recommended ruleset of html-validate with the following overwrites:
{
"no-inline-style": 0,
"no-trailing-whitespace": 0
}folder
By default, html-validate will lint all html files in your rootFolder using this glob: **/*.html. If you do not want that, you can pass files to this package:
// .factorialrc.js
module.exports = {
use: [
[
require("@factorial/stack-html"),
{
files: "some/other/glob/**/*.html",
},
],
],
};