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

remark-lint-code-block-syntax

Package Overview
Dependencies
Maintainers
0
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

remark-lint-code-block-syntax - npm Package Compare versions

Comparing version 0.10.0 to 0.11.0

19

index.js

@@ -7,2 +7,3 @@ import { lintRule } from "unified-lint-rule";

import { default as jsonc } from "jsonc-parser";
import { default as JSON5 } from "json5";

@@ -13,3 +14,3 @@ const remarkLintCodeBlockSyntax = lintRule("remark-lint:code-block-syntax", codeSyntax);

function codeSyntax(tree, file) {
const supportedLangs = ["js", "javascript", "json", "jsonc", "yaml", "yml", "css"];
const supportedLangs = ["js", "javascript", "json", "jsonc", "json5", "yaml", "yml", "css"];
const test = supportedLangs.map((lang) => ({ type: "code", lang }));

@@ -49,2 +50,9 @@

}
case "json5": {
const reason = checkJson5(value);
if (reason) {
report(reason, "JSON5");
}
break;
}
case "yaml":

@@ -107,2 +115,11 @@ case "yml": {

function checkJson5(code) {
try {
JSON5.parse(code);
return null;
} catch (e) {
return e.message;
}
}
function checkYaml(code) {

@@ -109,0 +126,0 @@ try {

3

package.json
{
"name": "remark-lint-code-block-syntax",
"version": "0.10.0",
"version": "0.11.0",
"description": "A remark-lint rule to check language syntax in a code block.",

@@ -40,2 +40,3 @@ "author": "Masafumi Koba",

"js-yaml": "^4.1.0",
"json5": "^2.2.3",
"jsonc-parser": "^3.3.1",

@@ -42,0 +43,0 @@ "postcss": "^8.4.43",

@@ -13,2 +13,3 @@ [![npm](https://img.shields.io/npm/v/remark-lint-code-block-syntax?style=flat-square)](https://www.npmjs.com/package/remark-lint-code-block-syntax)

- JSONC
- JSON5
- YAML

@@ -15,0 +16,0 @@ - CSS

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