htmlhint / htmlhint/HTMLHint

Rewrite configuration structure

Open
#279 7 comments 5 reactions 1 assignee View on GitHub

@Shinigami92 is already working on this.

Since May 16, 2020.

  • #286 by @Shinigami92 — closed without merging
  • #445 by @Shinigami92 — merged
  • #447 by @Shinigami92 — merged
  • #476 by @Shinigami92 — merged
  • #489 by @Shinigami92 — closed without merging
feature request keep-unstale
Dominant language
JavaScript
Stars
3.3k
Forks
474
Avg merge
1d 11h
Merged PRs (30d)
12

Description

Is your feature request related to a problem? Please describe.

Today's tools are characterized by a much better style of configuration file
It's much more extensible and supports things like defaultSeverity and presets that load before its own configuration

Describe the solution you'd like

We will rewrite the configuration in eslint-style, see https://github.com/htmlhint/HTMLHint/issues/279#issuecomment-417939741

TODOs

  • rewrite rules (#445 merged)
  • update docu (#447 merged)
  • move rules into attribute "rules": { /* ... */ } (#476 merged)
  • parse inline rules with options (extracted to #503)
  • add attribute "extends" (#489 in review)
    • define value "htmlhint:recommended"
  • add attribute "defaultSeverity" (is this still needed? 🤔)
    this could be done after release 1.0.0
  • add attribute "exclude" (extracted to #502)
    this could be done after release 1.0.0

Old proposal
We should rewrite the configuration file into something like this:

{
    "extends": ["htmlhint:recommended"],
    "defaultSeverity": "error",
    "htmlVersion": "html5",
    "rules": {
        "attr-no-duplication": true,
        "attr-unsafe-chars": true,
        "attr-value-double-quotes": true,
        "doctype-first": false,
        "doctype-html5": true,
        "id-class-ad-disabled": true,
        "id-class-value": ["dash", { "severity": "warning" }],
        "id-unique": true,
        "inline-style-disabled": false,
        "space-tab-mixed-disabled": ["tab", { "severity": "warning" }],
        "spec-char-escape": true,
        "src-not-empty": true,
        "style-disabled": [true, { "severity": "warning" }],
        "tag-pair": true,
        "tag-self-close": false,
        "tagname-lowercase": [
            true,
            {
                "exceptions": ["linearGradient"]
            }
        ],
        "title-require": true,
        "stylelint": [
            true,
            {
                "extends": "stylelint-config-standard",
                "rules": {
                    "block-no-empty": null,
                    "color-no-invalid-hex": true
                }
            }
        ],
        "eslint": [
            true,
            {
                "configFile": "./.eslintrc.json"
            }
        ]
    },
    "exclude": ["test/**/*.html"]
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.