Giter VIP home page Giter VIP logo

htmllint-cli's Introduction

htmllint npm version license build status coveralls

stories in ready dependencies devDependencies

An unofficial html5 linter and validator.

htmllint uses a parser to get the DOM for your html. It then uses the provided rules (and default rules) to lint both the DOM and then individual lines. Take a look at the supported options.

Using htmllint

If you'd like to run htmllint, we have a few options.

This module doesn't provide any interface on its own. It is highly recommended that you use one of the following modules to run the linter:

Getting Started with Contributing

You can use htmllint in Node.JS by using

require('htmllint')  

in your code, and doing an install with

npm install htmllint

(Remember --save-dev if this is just for your development).

Now What?

To learn more about the options and usage of htmllint, check out the user manual.

npm

htmllint-cli's People

Contributors

bardiharborow avatar coalman avatar fhemberger avatar mlochbaum avatar nwoltman avatar robloach avatar tengattack avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

htmllint-cli's Issues

lint template strings in JS

I'd like to lint all strings in my JS assigned to the variable template or using the template tag html

eg:

const template = `
    <div class="foo">
        <span>this is a test</span>
    </div>
`;

or

function render(class_) {
    return = html`
        <div class="${class_}">
            <span>this is a test</span>
        </div>
    `;
}

Provide a valid .htmllintrc file with options

I'm trying to get a project up and running but I need to disable some rules so they don't get triggered on CI run.

My config is:

{
    // names of npm modules to load into htmllint
    "plugins": [],

    // TODO: export htmllint's default cfg
    "options": [
      {"attr-name-style":"none"},
      {"attr-req-value":"none"}
    ]
}

But it doesn't seem to be being used. What is the correct way of using htmllint options in the rc file?

add cli config

Map configuration values specified in the command line arguments to htmllint options.

Support excluding directories

Hello,

I'd like to run htmllint on my project. However, running htmllint **/*.html gives a lot of false positives since it lints also the HTML files of the project dependencies stored in ./node_modules. The only workaround I can think of is to list all the directories (e.g. foo/**/*.html, bar/**/*.html) and the top-level HTML files (i.e. *.html). But with this approach, there is a big chance that I'll forget to add a newly created directories in the future and I won't notice that they are not linted.

It would be nice if there was a way to list directories/globs that should be excluded (like what you can do with .gitignore).

add global htmllint resolution

At the moment, the htmllint command assumes a local htmllint module will be available. The user might not be in a directory with the module, so it might be best to make sure a global htmllint module can be used.

May need to declare htmllint as a dependency too.

Why is width banned by default?

per https://github.com/htmllint/htmllint/wiki/Options

Default: ['align', 'background', 'bgcolor', 'border', 'frameborder', 'longdesc', 'marginwidth', 'marginheight', 'scrolling', 'style', 'width']

The value of this option is a list of strings, each of which is an attribute name. Attributes with any of the given names are disallowed.

Isn't specifying height / width of an image best practice?

Read file list from a file

I just realized that there is no cross-platform way to use environment variables in NPM scripts. So, I guess that the only way to have a single source of file patterns is to store them in a file. Can you please consider adding a support to read the patterns from files? I would prefer a simple text file over e.g. a JSON file.

Add CLI argument `--version`

Add a CLI argument to output the current version.

I need this for the version check to work for https://github.com/necramirez/SublimeLinter-contrib-htmllint

Example:

$ htmllint --version
0.0.5

I vaguely remember that this worked before. I don't know why it doesn't work for me anymore -- it goes straight to execution (hence my ^C).

$ htmllint --version
local htmllint version is not supported: 0.4.0 != ^0.3.0
using builtin version of htmllint
^C

New Version Please

The --stdin flag that was added recently is a really important feature so it would be nice to have a new version released with it.

NF support piping

hello
I would like to be able to do

cat foo.html | htmllint

regards
thx

New version needs to be released

It has been over a year since the last version of htmllint-cli was released. There have been some important improvements since then (such as support for the latest version of htmllint) so it would be helpful to have these changes available on npm.

Doesn't work with full path arguments

If I pass htmllint with a full path to an HTML file, like:
htmllint /Users/user/code/app_repo/apps/simple/src/app/app.component.html

htmllint-cli will say that file does not exist.

If that same file's path becomes relative: htmllint apps/simple/src/app/app.component.html, it will work properly.

@coalman I see that there is a commit that fixes this but a new build hasn't been pushed.

add a man page

Add a man page. Should do this later, when the api is more stable.

liftoff 2x / v8flags 2x released

Heya, this is just a friendly note to let you know that a new version of Liftoff and some of the dependencies commonly used in conjunction with it have been released. This release adds better support for situations where your user's configuration files are written using features behind a v8 flag (e.g. --harmony). Windows users and io.js users should see less issues if you upgrade!

Some helpful links:
https://github.com/tkellen/node-liftoff/blob/master/UPGRADING.md#100---200
https://github.com/tkellen/node-v8flags/blob/master/README.md#example
https://github.com/tkellen/node-hacker/blob/master/bin/hacker.js#L10-L14

Thanks!

add help message

Need to add some useful help info when the following is run:

$ htmllint --help
# or:
$ htmllint -h

add colored output

The output at the moment is pretty boring. Allowing colored output (perhaps use the chalk module) would be really helpful.

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.