New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@injms/remark-frontmatter-linter

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@injms/remark-frontmatter-linter

A linter for YAML frontmatter

  • 0.8.10
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Remark Frontmatter linter

Uses eslint-plugin-yml to lint YAML frontmatter in a Markdown file.

Requirements:

🏗️ Installation

Install this package - @injms/remark-frontmatter-linter - and its dependencies - remark-lint and remark-frontmatter - with npm:

npm install remark-lint remark-frontmatter @injms/remark-frontmatter-linter

⌨️ Set up for remark-cli

Add the plugin in the list of plugins, where ever that is being set, remembering to add it after the remark-lint and remark-frontmatter plugins.

// .remarkrc.mjs
export default {
  "plugins": [
    "remark-lint",
    "remark-frontmatter",
    "remark-frontmatter-linter",
  ],
}

⚙️ Configuration

By default the rules are the standard YML set of rules (plugin:yml/standard) but with indentation changed to be 2 spaces.

To change this, both the extends and rules properties can be set in the Remark config file, for example:

// .remarkrc.mjs
export default {
  "plugins": [
    "remark-lint",
    "remark-frontmatter",
    [
      "remark-frontmatter-linter",
      {
        extends: [
          'yml:prettier',
        ],
        rules: {
          'yml/indent': ['error', 4],
          'yml/plain-scalar': 'off',
        }
      }
    ],
  ],
}

See the eslint-plugin-yml configuration docs for a list of available configs and rules.

Setting anything in extends will overwrite the default use of yml:standard.

Setting anything in rules will add to the rules - so unless yml/indent is set then the default of 2 spaces will be used.

🧪 Tests

npm run test

This plugin uses the AVA test runner.

Keywords

FAQs

Package last updated on 12 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc