Socket
Socket
Sign inDemoInstall

markdownlint-cli

Package Overview
Dependencies
Maintainers
3
Versions
57
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

markdownlint-cli - npm Package Compare versions

Comparing version 0.38.0 to 0.39.0

16

markdownlint.js

@@ -24,6 +24,14 @@ #!/usr/bin/env node

function jsoncParse(text) {
return JSON.parse(require('jsonc-parser').stripComments(text));
const {parse, printParseErrorCode} = require('jsonc-parser');
const errors = [];
const result = parse(text, errors, {allowTrailingComma: true});
if (errors.length > 0) {
const aggregate = errors.map(error => `${printParseErrorCode(error.error)} (offset ${error.offset}, length ${error.length})`).join(', ');
throw new Error(`Unable to parse JSON(C) content, ${aggregate}`);
}
return result;
}
function jsYamlSafeLoad(text) {
function yamlParse(text) {
return require('js-yaml').load(text);

@@ -40,3 +48,3 @@ }

const projectConfigFiles = ['.markdownlint.jsonc', '.markdownlint.json', '.markdownlint.yaml', '.markdownlint.yml'];
const configParsers = [jsoncParse, jsYamlSafeLoad];
const configParsers = [jsoncParse, yamlParse];
const fsOptions = {encoding: 'utf8'};

@@ -204,3 +212,3 @@ const processCwd = process.cwd();

try {
if (path.basename(filepath) === filepath && path.extname(filepath) === '') {
if ((path.basename(filepath) === filepath || filepath.startsWith('@')) && path.extname(filepath) === '') {
// Looks like a package name, resolve it relative to cwd

@@ -207,0 +215,0 @@ // Get list of directories, where requested module can be.

{
"name": "markdownlint-cli",
"version": "0.38.0",
"version": "0.39.0",
"description": "MarkdownLint Command Line Interface",

@@ -45,4 +45,4 @@ "main": "markdownlint.js",

"js-yaml": "^4.1.0",
"jsonc-parser": "~3.2.0",
"markdownlint": "~0.32.1",
"jsonc-parser": "~3.2.1",
"markdownlint": "~0.33.0",
"minimatch": "~9.0.3",

@@ -52,3 +52,3 @@ "run-con": "~1.3.2"

"devDependencies": {
"ava": "^6.0.1",
"ava": "^6.1.0",
"execa": "^8.0.1",

@@ -55,0 +55,0 @@ "markdownlint-cli-local-test-rule": "./test/custom-rules/markdownlint-cli-local-test-rule",

@@ -137,3 +137,3 @@ # markdownlint-cli

- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.38.0
rev: v0.39.0
hooks:

@@ -140,0 +140,0 @@ - id: markdownlint

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