markdownlint-cli
Advanced tools
Comparing version 0.38.0 to 0.39.0
@@ -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 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
23118
293
+ Addedentities@4.5.0(transitive)
+ Addedlinkify-it@5.0.0(transitive)
+ Addedmarkdown-it@14.0.0(transitive)
+ Addedmarkdownlint@0.33.0(transitive)
+ Addedmarkdownlint-micromark@0.1.8(transitive)
+ Addedmdurl@2.0.0(transitive)
+ Addedpunycode.js@2.3.1(transitive)
+ Addeduc.micro@2.1.0(transitive)
- Removedentities@3.0.1(transitive)
- Removedlinkify-it@4.0.1(transitive)
- Removedmarkdown-it@13.0.2(transitive)
- Removedmarkdownlint@0.32.1(transitive)
- Removedmarkdownlint-micromark@0.1.7(transitive)
- Removedmdurl@1.0.1(transitive)
- Removeduc.micro@1.0.6(transitive)
Updatedjsonc-parser@~3.2.1
Updatedmarkdownlint@~0.33.0