Skip to content

Use custom html-validate rule #44

@Axel3005

Description

@Axel3005

Hello,

I would like to use html-validate custom rule (https://html-validate.org/dev/writing-rules.html), but i don't know how to call it on my plugins options. I'm using Nuxt 2.15.3.

My plugin options are :

htmlValidator: {
    usePrettier: false,
    options: {
      extends: [
        'html-validate:recommended',
      ],
      rules: {
        "custom-rule": "error",
        "no-raw-characters": "warn",
        "unrecognized-char-ref": "warn",
        'attr-quotes': ['warn', {
          "style": "auto"
        }],
        'heading-level': 'off',
        'input-missing-label': 'off',
        'element-required-attributes': 'off',
        'element-permitted-content': "off"
      }
    }
  }

My custom rule is created on my project root, but on build i have an error 'Definition for rule was not found'. It seems looking for an html-validate rule and not my custom rule :
Capture d’écran 2021-04-14 à 14 02 42

Didn't see anything about custom rule on the plugin documentation, if you have any clue it will be greatly appreciated

Thanks,
Axel

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions