0.5.0 • Published 3 years ago
htmlhint-riot-rules v0.5.0
htmlhint-riot-rules
HTMLHint custom rules for Riot.js
Install
npm install htmlhint-riot-rules
Useage
with htmlhint-loader
// webpack.config.js
var htmlhintRiotRules = require('htmlhint-riot-rules')
module.exports = {
module: {
rules: [{
enforce: 'pre',
test: /\.tag\.html/,
loader: 'htmlhint-loader',
exclude: /node_modules/,
options: {
customRules: htmlhintRiotRules(),
'file-line-limit': true, // Change the limit by set numeric. 'true' meaning default size 100.
'tag-name-include-hyphen': true,
'use-script-inside-tag': true,
'tag-expressions-simple': true, // Change the limit by set numeric. 'true' meaning default size 10.
'tag-options-primitive': true,
'assign-this-to-tag': true,
'properties-and-methods-order': true,
'fake-es6-syntax-disabled': true,
'tag-parent-disabled': true,
'use-each-in-syntax': true
}
}]
}
}
with gulp-htmlhint
// gulp.config.js
var gulp = require('gulp');
var htmlhint = require("gulp-htmlhint");
var htmlhintRiotRules = require('htmlhint-riot-rules')
gulp.src("./src/*.tag.html")
.pipe(htmlhint('.htmlhintrc', htmlhintRiotRules()))
CLI
.htmlhintrc
{
"file-line-limit": true,
"tag-name-include-hyphen": true,
"use-script-inside-tag": true,
"tag-expressions-simple": true,
"tag-options-primitive": true,
"assign-this-to-tag": true,
"properties-and-methods-order": true,
"fake-es6-syntax-disabled": true,
"tag-parent-disabled": true,
"use-each-in-syntax": true
}
htmlhint --config .htmlhintrc --rulesdir ./node_modules/htmlhint-riot-rules/add_rules **/*.tag.html
Rules
ID | Description | Level |
---|---|---|
file-line-limit | Module based development | warn |
tag-name-include-hyphen | Tag module names | error |
use-script-inside-tag | Use <script> inside tag | error |
tag-expressions-simple | Keep tag expressions simple | warn |
tag-options-primitive | Keep tag options primitive | warn |
assign-this-to-tag | Assign this to tag | warn |
properties-and-methods-order | Put tag properties and methods on top | warn |
fake-es6-syntax-disabled | Avoid fake ES6 syntax | warn |
tag-parent-disabled | Avoid tag.parent | warn |
use-each-in-syntax | Use each ... in syntax | warn |
Options
You can specify rules to disable with JSON arguments. By default all rules are turned on and it is up to you to disable them.
var htmlhintRiotRules = require('htmlhint-riot-rules')
var customRules = htmlhintRiotRules({
'avoid-tag-parent': false
})
0.5.0
3 years ago
0.4.0
5 years ago
0.3.14
5 years ago
0.3.13
5 years ago
0.3.12
5 years ago
0.3.11
5 years ago
0.3.10
5 years ago
0.3.9
5 years ago
0.3.8
5 years ago
0.3.7
5 years ago
0.3.6
5 years ago
0.3.5
5 years ago
0.3.4
5 years ago
0.3.3
5 years ago
0.3.2
5 years ago
0.3.1
5 years ago
0.3.0
5 years ago
0.2.0
5 years ago
0.1.6
5 years ago
0.1.5
5 years ago
0.1.4
5 years ago
0.1.2
5 years ago
0.1.1
5 years ago
0.1.0
5 years ago