no duplicate - bhsd-harry/wikiparser-node GitHub Wiki

no-duplicate

❌ By default, this rule reports duplicate attributes, categories, templates parameters, etc. as errors.

Examples

Examples of correct code for { "no-duplicate": 2 }:

<span id="mw-customcollapsible-foo">1</span>
<span id="mw-customcollapsible-foo">2</span>
{{Foo|bar=<ref name="1">1</ref>|bar=<ref name="2">2</ref>}}

Options

attribute

This option can be configured to specify the severity of duplicate attributes.

Examples of incorrect code for { "no-duplicate": [ 0, { "attribute": 2 } ] }:

<br id=foo id=bar>

Examples of correct code for { "no-duplicate": [ 2, { "attribute": 0 } ] }:

<br id=foo id=bar>

category

⚠️ By default, this rule reports duplicate categories as warnings. This can be configured by providing a category option with a severity value.

Examples of incorrect code for { "no-duplicate": [ 0, { "category": 2 } ] }:

[[Category:Foo]]
[[Category:Foo]]

Examples of correct code for { "no-duplicate": [ 2, { "category": 0 } ] }:

[[Category:Foo]]
[[Category:Foo]]

id

⚠️ By default, this rule reports duplicate HTML ids as warnings. This can be configured by providing a id option with a severity value. See also: Help:Lint errors/duplicate-ids.

Examples of incorrect code for { "no-duplicate": [ 0, { "id": 2 } ] }:

<br id="foo"><br id="foo">

Examples of correct code for { "no-duplicate": [ 2, { "id": 0 } ] }:

<br id="foo"><br id="foo">

imageParameter

This option can be configured to specify the severity of duplicate image parameters. See also: Help:Lint errors/bogus-image-options.

Examples of incorrect code for { "no-duplicate": [ 0, { "imageParameter": 2 } ] }:

[[File:Foo.jpg|alt=1|alt=2]]
[[File:Foo.jpg|Bar|Baz]]
[[File:Foo.jpg|frame|thumb]]
[[File:Foo.jpg|none|left]]
[[File:Foo.jpg|top|middle]]

Examples of correct code for { "no-duplicate": [ 2, { "imageParameter": 0 } ] }:

[[File:Foo.jpg|alt=1|alt=2]]
[[File:Foo.jpg|Bar|Baz]]
[[File:Foo.jpg|frame|thumb]]
[[File:Foo.jpg|none|left]]
[[File:Foo.jpg|top|middle]]

parameter

This option can be configured to specify the severity of duplicate template parameters.

Examples of incorrect code for { "no-duplicate": [ 0, { "parameter": 2 } ] }:

{{Foo|bar=1|bar=2}}

Examples of correct code for { "no-duplicate": [ 2, { "parameter": 0 } ] }:

{{Foo|bar=1|bar=2}}

unknownImageParameter

⚠️ By default, this rule reports duplicate unknown image parameters as warnings. This can be configured by providing a unknownImageParameter option with a severity value.

Examples of incorrect code for { "no-duplicate": [ 0, { "unknownImageParameter": 2 } ] }:

[[File:Foo.ogg|muted|loop]]
[[File:Foo.jpg|{{Bar}}|Baz]]

Examples of correct code for { "no-duplicate": [ 2, { "unknownImageParameter": 0 } ] }:

[[File:Foo.ogg|muted|loop]]
[[File:Foo.jpg|{{Bar}}|Baz]]
⚠️ **GitHub.com Fallback** ⚠️