Домашняя страница проекта — тут>>>.
В дополнение к к самой утилите HTMLlint — имеется утилита htmllint-cli, которая используется для управления самим HTMLlint.
Её и будем устанавливать.
HTMLlint использует NodeJS.
Система:
$ system_profiler SPSoftwareDataType
Software:
System Software Overview:
System Version: OS X 10.10.5 (14F27)
Kernel Version: Darwin 14.5.0
...
Со страницы https://nodejs.org/en/ загружаем и устанавливаем NodeJS.
Устанавливаем htmllint-cli:
$ sudo npm install -g htmllint-cli Password: /usr/local/bin/htmllint -> /usr/local/lib/node_modules/htmllint-cli/bin/cli.js [email protected] /usr/local/lib/node_modules/htmllint-cli ├── [email protected] ├── [email protected] ├── [email protected] ├── [email protected] ([email protected]) ├── [email protected] ([email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected]) ├── [email protected] ([email protected], [email protected], [email protected], [email protected])
Для проверки — создадим временную директорию и простой HTML файл:
$ cd /tmp $ mkdir htmltest $ cd htmltest/
Файл:
$ cat index.html
<!DOCTYPE html>
<html>
<head>
<title>Хедер и футер. Тэги header и footer</title>
<meta charset="utf-8">
</head>
<body>
Хедер
Футер
</body>
</html>
Инициализируем HTMLlint, что бы он создал файл конфигурации:
$ htmllint init
Находим файл:
$ ls -1a . .. .htmllintrc index.html
Его содержимое
$ cat .htmllintrc
{
// names of npm modules to load into htmllint
"plugins": []
// TODO: export htmllint's default cfg
}
И запускаем проверку файла:
$ htmllint index.html index.html: line 4, col 1, indenting spaces must be used in groups of 4 index.html: line 5, col 1, indenting spaces must be used in groups of 4 [htmllint] found 2 errors out of 1 files
Готово.




