GithubHelp home page GithubHelp logo

isabella232 / gulp-linthtml Goto Github PK

View Code? Open in Web Editor NEW

This project forked from linthtml/gulp-linthtml

0.0 0.0 0.0 324 KB

A gulp plugin for processing files with LintHTML

License: MIT License

JavaScript 100.00%

gulp-linthtml's Introduction

gulp-linthtml Build Status

A gulp plugin for LintHTML

Installation

Use npm.

npm install @linthtml/gulp-linthtml

Usage

const {src} = require('gulp');
const linthtml = require('@linthtml/gulp-linthtml');

function lintHTML() {
  return src("app/**/*.html")
    .pipe(linthtml())
    .pipe(linthtml.format())
    .pipe(linthtml.failOnError());
}

lintHTML.description = "Analyse all HTML files using linthtml";
exports.default = lintHTML;

API

linthtml()

No explicit configuration. A .linthtmlrc.* file may be resolved relative to the gulpfile.

linthtml(options)

options.rules

Type: Object

Set of rules.

{
  "rules":{
    "attr-bans": ["div", "center"],
    "attr-quote-style": "double",
    "html-req-lang": true
  }
}

options.configFile

Type: String

Path to the LintHTML rules configuration file.

linthtml(configFilePath)

Type: String

Shorthand for defining options.configFile.

linthtml.failOnError()

Stop a task/stream if a LintHTML error has been reported for any file.

// Cause the stream to stop(/fail) before copying an invalid JS file to the output directory
gulp.src('**/*.html')
    .pipe(linthtml())
    .pipe(linthtml.failOnError());

linthtml.format()

Format all linted files once. This should be used in the stream after piping through linthtml; otherwise, this will find no LintHTML results to format.

gulp-linthtml's People

Contributors

kamikillerto avatar dependabot-preview[bot] avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.