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

no-duplicate

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

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](/bhsd-harry/wikiparser-node/wiki/Category:Foo)
[Category:Foo](/bhsd-harry/wikiparser-node/wiki/Category:Foo)

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

[Category:Foo](/bhsd-harry/wikiparser-node/wiki/Category:Foo)
[Category:Foo](/bhsd-harry/wikiparser-node/wiki/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 } ] }:

![1|alt=2](https://raw.githubusercontent.com/wiki/bhsd-harry/wikiparser-nodeFile:Foo.jpg)
![Bar|Baz](https://raw.githubusercontent.com/wiki/bhsd-harry/wikiparser-nodeFile:Foo.jpg)
![frame|thumb](https://raw.githubusercontent.com/wiki/bhsd-harry/wikiparser-nodeFile:Foo.jpg)
![none|left](https://raw.githubusercontent.com/wiki/bhsd-harry/wikiparser-nodeFile:Foo.jpg)
![top|middle](https://raw.githubusercontent.com/wiki/bhsd-harry/wikiparser-nodeFile:Foo.jpg)

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

![1|alt=2](https://raw.githubusercontent.com/wiki/bhsd-harry/wikiparser-nodeFile:Foo.jpg)
![Bar|Baz](https://raw.githubusercontent.com/wiki/bhsd-harry/wikiparser-nodeFile:Foo.jpg)
![frame|thumb](https://raw.githubusercontent.com/wiki/bhsd-harry/wikiparser-nodeFile:Foo.jpg)
![none|left](https://raw.githubusercontent.com/wiki/bhsd-harry/wikiparser-nodeFile:Foo.jpg)
![top|middle](https://raw.githubusercontent.com/wiki/bhsd-harry/wikiparser-nodeFile:Foo.jpg)

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](/bhsd-harry/wikiparser-node/wiki/muted|loop)
![{{Bar}}|{{Baz}}](https://raw.githubusercontent.com/wiki/bhsd-harry/wikiparser-nodeFile:Foo.jpg)

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

[File:Foo.ogg](/bhsd-harry/wikiparser-node/wiki/muted|loop)
![{{Bar}}|{{Baz}}](https://raw.githubusercontent.com/wiki/bhsd-harry/wikiparser-nodeFile:Foo.jpg)