npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

htmlhint-riot-rules

v0.5.0

Published

HTMLHint custom rules for Riot.js

Downloads

124

Readme

htmlhint-riot-rules

npm version Build Status Coverage Status GitHub license npm

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
})