What is remark-lint-no-duplicate-definitions?
The remark-lint-no-duplicate-definitions package is a linting rule for remark-lint that ensures there are no duplicate definitions in Markdown files. This helps maintain clean and error-free Markdown documents by preventing multiple definitions with the same identifier.
What are remark-lint-no-duplicate-definitions's main functionalities?
Detect Duplicate Definitions
This feature detects duplicate definitions in a Markdown file. In the provided code sample, the identifier 'foo' is defined twice, which would trigger a linting error.
```markdown
[foo]: http://example.com
[foo]: http://example.org
```
Other packages similar to remark-lint-no-duplicate-definitions
remark-lint
remark-lint is a plugin for remark that provides a collection of linting rules for Markdown files. It can be extended with additional rules like remark-lint-no-duplicate-definitions. While remark-lint provides a broader set of rules, remark-lint-no-duplicate-definitions focuses specifically on detecting duplicate definitions.
markdownlint
markdownlint is a Node.js style checker and linting tool for Markdown files. It includes a variety of rules to enforce consistent Markdown style, including rules to prevent duplicate definitions. It is similar to remark-lint-no-duplicate-definitions but offers a wider range of linting capabilities.
markdown-it
markdown-it is a Markdown parser that can be extended with plugins to add various functionalities, including linting. While it is primarily a parser, it can be used with plugins to achieve similar functionality to remark-lint-no-duplicate-definitions by detecting and preventing duplicate definitions.
Warn when duplicate definitions are found.
Presets
This rule is included in the following presets:
Example
valid.md
In
[foo]: bar
[baz]: qux
Out
No messages.
invalid.md
In
[foo]: bar
[foo]: qux
Out
2:1-2:11: Do not use definitions with the same identifier (1:1)
Install
npm:
npm install remark-lint-no-duplicate-definitions
Use
You probably want to use it on the CLI through a config file:
...
"remarkConfig": {
"plugins": [
...
"lint",
+ "lint-no-duplicate-definitions",
...
]
}
...
Or use it on the CLI directly
remark -u lint -u lint-no-duplicate-definitions readme.md
Or use this on the API:
var remark = require('remark');
var report = require('vfile-reporter');
remark()
.use(require('remark-lint'))
+ .use(require('remark-lint-no-duplicate-definitions'))
.process('_Emphasis_ and **importance**', function (err, file) {
console.error(report(err || file));
});
Contribute
See contributing.md
in remarkjs/.github
for ways
to get started.
See support.md
for ways to get help.
This project has a Code of Conduct.
By interacting with this repository, organisation, or community you agree to
abide by its terms.
License
MIT © Titus Wormer