1.0.5 • Published 11 months ago

@josundt/htmlhint-config v1.0.5

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

@josundt/htmlhint-config

Ruleset for HTML code style and linting

Usage

  1. Install this package

  2. Add npm task in package.json

    {
      "scripts": {
        "lint:html": "htmlhint src -c ./node_modules/@josundt/htmlhint-config/.htmlhintrc --format unix"
      }
    }
  3. When using Visual Studio Code:

    a) Install the htmllint extension ("htmlhint.vscode-htmlhint"), and add it to the VSCode recommmended extensions for the workspace (".vscode/extensions.json").
    Then make sure the following two propeties are added to VSCode workspace settings (".vscode/settings.json"):

    {
      // ...
      "htmlhint.documentSelector": ["html", "ejs"],
      "htmlhint.configFile": "./node_modules/@josundt/htmlhint-config/.htmlhintrc",
      // ...
    }

    b) Add a task in ".vscode/tasks.json" to run sass-lint as a VSCode task for the whole workspace:

    {
      "version": "2.0.0",
      "runner": "terminal",
      "tasks": [
        {
          "label": "lint:html",
          "type": "shell",
          "command": "npx",
          "args": [
            "htmlhint",
            "src",
            "-c",
            "./node_modules/@josundt/htmlhint-config/.htmlhintrc",
            "--format",
            "unix"
          ],
          "group": "build",
          "presentation": {
            "echo": true,
            "reveal": "silent",
            "focus": false,
            "panel": "shared"
          },
          "problemMatcher": {
            "applyTo": "allDocuments",
            "severity": "error",
            "fileLocation": "absolute",
            "source": "lint:sass",
            "pattern": [
              {
                "regexp": "(.*):(\\d+):(\\d+): (.*)",
                "file": 1,
                "line": 2,
                "column": 3,
                "message": 4
              }
            ]
          }
        }
      ]
    }
1.0.5

11 months ago

1.0.4

12 months ago

1.0.3

2 years ago

1.0.0

3 years ago