{"id":13779941,"url":"https://github.com/linthtml/linthtml","last_synced_at":"2025-05-11T13:31:13.910Z","repository":{"id":34361658,"uuid":"171710965","full_name":"linthtml/linthtml","owner":"linthtml","description":"The html5 linter and validator.","archived":false,"fork":false,"pushed_at":"2024-10-14T14:05:49.000Z","size":10483,"stargazers_count":85,"open_issues_count":37,"forks_count":14,"subscribers_count":4,"default_branch":"develop","last_synced_at":"2024-11-07T07:53:07.205Z","etag":null,"topics":["cli","hint","html","lint","linter","linting","static-code-analysis"],"latest_commit_sha":null,"homepage":"linthtml.vercel.app","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/linthtml.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-02-20T16:40:21.000Z","updated_at":"2024-10-27T20:08:29.000Z","dependencies_parsed_at":"2024-01-15T09:03:34.733Z","dependency_job_id":"23e6a800-2c0f-413a-bcbb-35aa8f1799f6","html_url":"https://github.com/linthtml/linthtml","commit_stats":{"total_commits":1427,"total_committers":45,"mean_commits":"31.711111111111112","dds":0.5164681149264191,"last_synced_commit":"113ef60de66fdc0e338027e81edd75d459b4fb93"},"previous_names":[],"tags_count":64,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linthtml%2Flinthtml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linthtml%2Flinthtml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linthtml%2Flinthtml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/linthtml%2Flinthtml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/linthtml","download_url":"https://codeload.github.com/linthtml/linthtml/tar.gz/refs/heads/develop","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225056749,"owners_count":17414200,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","hint","html","lint","linter","linting","static-code-analysis"],"created_at":"2024-08-03T18:01:10.783Z","updated_at":"2025-05-11T13:31:13.866Z","avatar_url":"https://github.com/linthtml.png","language":"TypeScript","readme":"# LintHTML\n\n[![npm version](https://img.shields.io/npm/v/@linthtml/linthtml.svg?style=flat-square)](https://npmjs.org/package/@linthtml/linthtml)\n[![npm beta version](https://img.shields.io/npm/v/%40linthtml%2Flinthtml/beta?style=flat-square)](https://npmjs.org/package/@linthtml/linthtml)\n[![license](https://img.shields.io/npm/l/@linthtml/linthtml.svg?style=flat-square)](https://npmjs.org/package/@linthtml/linthtml)\n[![codebeat badge](https://codebeat.co/badges/b16712c0-c863-4fda-8ea2-75dacd0faf1a)](https://codebeat.co/projects/github-com-linthtml-linthtml-develop)\n[![Coverage Status](https://coveralls.io/repos/github/linthtml/linthtml/badge.svg?branch=develop)](https://coveralls.io/github/linthtml/linthtml?branch=develop)\n\u003c!-- [![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Flinthtml%2Flinthtml.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Flinthtml%2Flinthtml?ref=badge_shield) --\u003e\n\n\u003e The HTML5 linter and validator you need.\n\nLintHTML is a fork of [htmllint](https://github.com/htmllint/htmllint) featuring a built-in CLI and multiple bug fixes and improvements.\nThe migration from htmllint to LintHTML is easy, as all htmllint's rules can be used with LintHTML – just follow this [simple guide](#migrate-from-htmllint).\n\n## Installation and Usage\n\nYou can install LintHTML either locally or globally.\nFor most cases we recommend the former, which can be achieved this way with npm:\n\n```shell\nnpm install @linthtml/linthtml --save-dev\n```\n\nYou should then init a configuration file:\n\n```shell\nnpx linthtml --init\n```\n\nThis will generate a file `.linthtmlrc` in the current directory.\n\nAfter that, you can run LintHTML on any file or directory like this:\n\n```shell\nnpx linthtml 'yourfile.html'\nnpx linthtml 'src/**/*.html'\n```\n\nIf you want to read about alternative installation and usage methods, have a look to the [installation and usage](./doc/docs/user-guide/installation-and-usage.md) page in the documentation.\n\n## Migrate from htmllint\n\nTo migrate from [htmllint](https://github.com/htmllint/htmllint) to LintHTML, first remove all the htmllint-related packages you were using:\n\n```shell\nnpm uninstall htmllint htmllint-cli\n```\n\nThen rename the file `.htmlintrc` to `.linthtmlrc`.\nYou might want to remove the rules `indent-delta` and `indent-width-cont` from there in case you were using them since LintHTML's indent style checker deals with those aspects out of the box.\n\nFinally, install LintHTML:\n\n```shell\nnpm install @linthtml/linthtml --save-dev\n```\n\n## Rules\n\nThe list of current rules and deprecations can be found in [here](./doc/docs/user-guide/rules/list.md).\n\n### Global Configuration\n\nBy default, LintHTML will look for a `JSON`, `YAML`, or `JavaScript` file named `.linthtmlrc.*` or a `linthtmlConfig` section in `package.json`.\nAnyway, you can specify a custom configuration file using the `--config` option when running LintHTML in the command line.\nSee our documentation about [configuration](./doc/docs/user-guide/configuration.md) to see how to configure rules, use custom parser, plugins...\n\n### Inline Configuration\n\nSometimes it is necessary to disable a rule or tweak the configuration for a specific line, block or HTML file.\nThis might be the case, for example, for an inline SVG block of code.\nThis can be achieved by using inline configurations.\n\nInline configurations are HTML comments beginning with the keyword `linthtml-XXX`.\n\n`XXX` can be replaced with the following values, which are called instructions.\nInstructions have different effects:\n\n- `configure` : change a rule configuration for the HTML nodes that follow\n- `enable` : activate a rule which was has deactivated previously\n- `disable` : disable a rule\n\n#### Configure instruction\n\nMultiple rules can be set in a single inline configuration comment.\nValues must be surrounded with double/single quotes if they contain spaces, and must be either a valid value for the rule (encoded in pretty-much-JSON).\n\nSome examples:\n\n* change the `tag-bans` rule value\n\n```html\n\u003c!-- linthtml-configure tag-bans=\"['p','style']\" --\u003e\n\u003c!-- linthtml-configure tag-bans=['p','style'] --\u003e\n```\n\n* turn off the `attr-bans` rule\n\n```html\n\u003c!-- linthtml-configure attr-bans=\"false\" --\u003e\n\u003c!-- linthtml-configure attr-bans=false --\u003e\n\u003c!-- linthtml-configure attr-bans=\"off\" --\u003e\n```\n\n_We recommend using the enable/disable instructions instead 😉_\n\n* turn on the `attr-bans` rule\n\n```html\n\u003c!-- linthtml-configure attr-bans=\"true\" --\u003e\n\u003c!-- linthtml-configure attr-bans=true --\u003e\n```\n\n_⚠️ you can only turn on rules that have been deactivated by an inline config_\n_We recommend using the enable/disable instructions instead 😉_\n\n* restore the previous value of the `tag-bans` rule\n_⚠️ works only with the legacy config_\n\n```html\n\u003c!-- linthtml-configure tag-bans=\"$previous\" --\u003e\n```\n\nIt's worth noting that inline configurations only affect the file they're on, so if they are not explicitly reversed with the `$previous` value, they will just apply until the end of the file.\n\n## Ecosystem\n\nApart from the built-in CLI, you might want to use some of the following tools to integrate LintHTML in different scenarios:\n\n* [vscode-linthtml](https://marketplace.visualstudio.com/items?itemName=kamikillerto.vscode-linthtml): an extension for the VSCode IDE\n* [@linthtml/gulp-linthtml](https://github.com/linthtml/gulp-linthtml): a gulp interface for LintHTML\n* [@linthtml/linthtml-pug](https://github.com/linthtml/linthtml-pug): PUG parser to lint pug files with LintHTML\n* [@linthtml/linthtml-config-recommended](https://github.com/linthtml/linthtml-config-recommended): Recommended shareable config for linthtml\n\n🚧 Coming soon:\n\n* `linthtml-loader`: LintHTML loader for webpack\n* `broccoli-linthtml`: Integrates HTML linting with LintHTML as part of your Broccoli build pipeline\n\n## Contributing\n\nContributions are welcome, please make sure to use the proper GitHub tag on your issue/PR.\n\n* `cli`: anything related to LintHTML's CLI\n* `rule`: anything related to the rules (bugs, improvements, docs, new rules...)\n* `core`: anything related to LintHTML's core (file parsing, plugin system...)\n* `doc`: anything related to LintHTML's documentation\n","funding_links":[],"categories":["Linters","TypeScript"],"sub_categories":["HTML"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinthtml%2Flinthtml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flinthtml%2Flinthtml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flinthtml%2Flinthtml/lists"}