You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 :
Didn't see anything about custom rule on the plugin documentation, if you have any clue it will be greatly appreciated
/* CustomRule is a class inheriting from Rule, as per documentation */constCustomRule=require("./rules/my-rule.js");/* plugin which adds the "my-prefix/custom-rule" definition */module.exports={rules: {"my-prefix/custom-rule": AnotherRule,},};
Activity
ext commentedon Apr 19, 2021
To add custom rules you must create a plugin with the rule definitions.
Something similar to
The plugin would be added like this:
extends: [ 'html-validate:recommended', ], + plugins: [ + "my-plugin" // npm package or local path + ], rules: { - "custom-rule": "error", + "my-prefix/custom-rule": "error", "no-raw-characters": "warn",