Nerdy Poly Millionaires

    remark-lint-code-block-syntax

    0.6.0 • Public • Published

    npm node

    remark-lint-code-block-syntax

    A remark-lint rule to check language syntax in a code block.

    Supported languages

    • JavaScript
    • JSON
    • YAML
    • CSS

    Install

    $ npm install remark-lint-code-block-syntax

    Usage

    Via a command-line argument:

    $ remark --use remark-lint-code-block-syntax
    docs/config.md
      32:1-32:4  warning  Invalid JSON: Unexpected token a in JSON at position 128  code-block-syntax  remark-lint

    Via a configuration file:

    {
      "plugins": ["remark-lint-code-block-syntax"]
    }

    Via JavaScript API:

    import { reporter } from "vfile-reporter";
    import { remark } from "remark";
    import remarkLintCodeBlockSyntax from "remark-lint-code-block-syntax";
    
    main();
    
    async function main() {
      const code = `
    \`\`\`js
    const sum = 1 +;
    \`\`\`
    `;
      const file = await remark().use(remarkLintCodeBlockSyntax).process(code);
      console.error(reporter(file));
    }

    Install

    npm i remark-lint-code-block-syntax

    DownloadsWeekly Downloads

    864

    Version

    0.6.0

    License

    MIT

    Unpacked Size

    6.06 kB

    Total Files

    4

    Last publish

    Collaborators

    • ybiquitous