Socket
Socket
Sign inDemoInstall

remark-lint-code-block-style

Package Overview
Dependencies
9
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    remark-lint-code-block-style

remark-lint rule to warn when code-blocks do not adhere to a given style


Version published
Weekly downloads
68K
decreased by-49.2%
Maintainers
1
Install size
87.9 kB
Created
Weekly downloads
 

Readme

Source

remark-lint-code-block-style

Warn when code-blocks do not adhere to a given style.

Options: string, either 'consistent', 'fenced', or 'indented', default: 'consistent'.

The default value, consistent, detects the first used code-block style, and will warn when a subsequent code-block uses a different style.

Install

npm install --save remark-lint-code-block-style

Example

When this rule is 'indented', the following file valid.md is ok:

<!-- This is also valid when `'consistent'` -->

    alpha();

Paragraph.

    bravo();

When this rule is 'indented', the following file invalid.md is not ok:

        ```
        alpha();
        ```

        Paragraph.

        ```
        bravo();
        ```
1:1-3:4: Code blocks should be indented
7:1-9:4: Code blocks should be indented

When this rule is 'fenced', the following file valid.md is ok:

        <!-- This is also valid when `'consistent'` -->

        ```
        alpha();
        ```

        Paragraph.

        ```
        bravo();
        ```

When this rule is 'fenced', the following file invalid.md is not ok:

    alpha();

Paragraph.

    bravo();
1:1-1:13: Code blocks should be fenced
5:1-5:13: Code blocks should be fenced

When this rule is turned on, the following file invalid.md is not ok:

        <!-- This is always invalid -->

            alpha();

        Paragraph.

        ```
        bravo();
        ```
7:1-9:4: Code blocks should be indented

When 'invalid' is passed in, the following error is given:

1:1: Invalid code block style `invalid`: use either `'consistent'`, `'fenced'`, or `'indented'`

License

MIT © Titus Wormer

Keywords

FAQs

Last updated on 23 Feb 2017

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc