npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@diplodoc/yfmlint

v1.4.0

Published

YFM (Yandex Flavored Markdown) syntax linter with custom rules for Diplodoc platform

Readme

NPM version Quality Gate Status Coverage Maintainability Rating Reliability Rating Security Rating

YFM syntax linter

YFM (Yandex Flavored Markdown) syntax linter with custom rules for Diplodoc platform. Extends markdownlint with YFM-specific validation rules.

Features

  • 11 custom YFM rules (YFM001-YFM011) for validating YFM-specific syntax
  • Integration with markdownlint - all standard markdownlint rules are available
  • Plugin support - integrates with plugins from @diplodoc/transform (e.g., term plugin)
  • Configurable rule levels - error, warn, info, or disabled
  • Source map support - accurate error reporting after Liquid template processing

Installation

npm install @diplodoc/yfmlint

Usage

Basic Example

import {yfmlint, log, LogLevels} from '@diplodoc/yfmlint';

const content = `# Title

[Link to missing file](./missing.md)
`;

const errors = await yfmlint(content, 'example.md', {
  lintConfig: {
    YFM003: LogLevels.ERROR, // Unreachable link
  },
});

if (errors && errors.length > 0) {
  log(errors, console);
}

With Plugins

import {yfmlint} from '@diplodoc/yfmlint';
import termPlugin from '@diplodoc/transform/plugins/term';

const errors = await yfmlint(content, path, {
  plugins: [termPlugin],
  pluginOptions: {
    // Plugin-specific options
  },
  lintConfig: {
    YFM007: true, // Term used without definition
    YFM009: 'warn', // Term definition not at end of file
  },
});

Configuration

Rules can be configured with different log levels:

const lintConfig = {
  // Boolean: true = warn, false = disabled
  YFM001: true,
  YFM002: false,

  // String: log level name
  YFM003: 'error',
  YFM004: 'warn',
  YFM005: 'info',

  // Object: full configuration
  YFM001: {
    level: 'warn',
    maximum: 120, // Custom parameter
  },
};

Documentation

For detailed information about architecture, development, and contributing, see AGENTS.md.

YFM Rules

This package extends markdownlint with 11 custom rules for YFM syntax validation. All standard markdownlint rules are also available.

YFM001 - Inline code line length

Tags: line_length
Aliases: inline-code-length
Parameters: maximum (default: 100)

Validates that inline code spans don't exceed the maximum length. Useful for preventing overly long inline code that breaks formatting.

Example:

`this is a very long inline code that exceeds the maximum length and will trigger YFM001`

YFM002 - No header found for link

Tags: links
Aliases: no-header-found-for-link

Validates that links to headers (anchors) reference existing headers in the target file.

Example:

[Link to non-existent header](./file.md#nonexistent)

YFM003 - Unreachable link

Tags: links
Aliases: unreachable-link

Validates that linked files exist and are accessible. Checks for:

  • File not found
  • File missing in table of contents
  • Both conditions

Example:

[Link to missing file](./missing.md)

YFM004 - Table not closed

Tags: table
Aliases: table-not-closed

Validates that YFM tables are properly closed. Requires the table plugin from @diplodoc/transform.

YFM005 - Tab list not closed

Tags: tab
Aliases: tab-list-not-closed

Validates that YFM tab lists are properly closed. Requires the tabs plugin from @diplodoc/transform.

YFM006 - Term definition duplicated

Tags: term
Aliases: term-definition-duplicated

Validates that term definitions are not duplicated. Requires the term plugin from @diplodoc/transform.

Example:

[term]: definition

[term]: another definition <!-- Error: duplicate definition -->

YFM007 - Term used without definition

Tags: term
Aliases: term-used-without-definition

Validates that all used terms have corresponding definitions. Requires the term plugin from @diplodoc/transform.

Example:

This uses [term] but no definition is provided.

YFM008 - Term inside definition not allowed

Tags: term
Aliases: term-inside-definition-not-allowed

Validates that term definitions don't contain other terms. Requires the term plugin from @diplodoc/transform.

YFM009 - Term definition not at end of file

Tags: term
Aliases: no-term-definition-in-content

Validates that all term definitions are placed at the end of the file. Requires the term plugin from @diplodoc/transform.

Example:

[term]: definition

Some content here <!-- Error: content after term definitions -->

[another-term]: another definition

YFM010 - Unreachable autotitle anchor

Tags: titles
Aliases: unreachable-autotitle-anchor

Validates that links to autotitle anchors reference existing titles.

Example:

[Link to non-existent title](#nonexistent-title)

YFM011 - Max SVG size

Tags: image_svg
Aliases: max-svg-size

Validates that SVG images don't exceed the maximum size limit. Requires image processing plugins from @diplodoc/transform.