required attr - bhsd-harry/wikiparser-node GitHub Wiki

❌ By default, this rule reports extension tags without required attributes as errors.

Examples

Examples of incorrect code for { "required-attr": 2 }:

<indicator>Foo</indicator>
<langconvert>Bar</langconvert>
<mapframe/>
<maplink/>
<phonos file=""/>
<section/>
<templatestyles src/>

Examples of correct code for { "required-attr": 2 }:

<indicator name=foo>Foo</indicator>
<langconvert from=en to=en-x-piglatin>Bar</langconvert>
<mapframe width=300 height=300/>
<maplink width=300 height=300/>
<phonos file=Example.ogg/>
<section BEGIN=baz/>
<templatestyles src=foo.css/>

Options

Extension tag name

This rule can be configured for specific extension tags by providing an object with the tag name as the key and the severity as the value.

Examples of incorrect code for { "required-attr": [ 0, { "indicator": 2 } ] }:

<indicator>Foo</indicator>

Examples of correct code for { "required-attr": [ 2, { "indicator": 0 } ] }:

<indicator>Foo</indicator>
⚠️ **GitHub.com Fallback** ⚠️