eslint-plugin-markdown
Advanced tools
Comparing version 2.1.0 to 2.2.0
@@ -0,1 +1,5 @@ | ||
v2.2.0 - May 26, 2021 | ||
* [`32203f6`](https://github.com/eslint/eslint-plugin-markdown/commit/32203f6ec86ec5e220d18099863d94408f334665) Update: Replace Markdown parser (fixes #125, fixes #186) (#188) (Brandon Mills) | ||
v2.1.0 - April 25, 2021 | ||
@@ -2,0 +6,0 @@ |
@@ -14,4 +14,8 @@ /** | ||
* @typedef {Object} RangeMap | ||
* @property {number} js | ||
* @property {number} md | ||
* @property {number} indent Number of code block indent characters trimmed from | ||
* the beginning of the line during extraction. | ||
* @property {number} js Offset from the start of the code block's range in the | ||
* extracted JS. | ||
* @property {number} md Offset from the start of the code block's range in the | ||
* original Markdown. | ||
* | ||
@@ -28,4 +32,3 @@ * @typedef {Object} BlockBase | ||
const unified = require("unified"); | ||
const remarkParse = require("remark-parse"); | ||
const parse = require("mdast-util-from-markdown"); | ||
@@ -38,4 +41,2 @@ const UNSATISFIABLE_RULES = [ | ||
const markdown = unified().use(remarkParse); | ||
/** | ||
@@ -158,3 +159,3 @@ * @type {Map<string, Block[]>} | ||
* should normally begin (typically the first column of the line, but more | ||
* inside a list item, for example). The code block's opening fance may be | ||
* inside a list item, for example). The code block's opening fence may be | ||
* further indented by up to three characters. If the code block has | ||
@@ -194,2 +195,3 @@ * additional indenting, the opening fence's first backtick may be up to | ||
const rangeMap = [{ | ||
indent: baseIndent, | ||
js: 0, | ||
@@ -223,2 +225,3 @@ md: 0 | ||
rangeMap.push({ | ||
indent: trimLength, | ||
js: jsOffset, | ||
@@ -248,3 +251,3 @@ | ||
function preprocess(text, filename) { | ||
const ast = markdown.parse(text); | ||
const ast = parse(text); | ||
const blocks = []; | ||
@@ -337,3 +340,3 @@ | ||
line: lineInCode + blockStart, | ||
column: message.column + block.position.indent[lineInCode - 1] - 1 | ||
column: message.column + block.rangeMap[lineInCode].indent | ||
}; | ||
@@ -340,0 +343,0 @@ |
{ | ||
"name": "eslint-plugin-markdown", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "An ESLint plugin to lint JavaScript in Markdown code fences.", | ||
@@ -50,4 +50,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"remark-parse": "^7.0.0", | ||
"unified": "^6.1.2" | ||
"mdast-util-from-markdown": "^0.8.5" | ||
}, | ||
@@ -54,0 +53,0 @@ "peerDependencies": { |
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
46419
2
398
+ Added@types/mdast@3.0.15(transitive)
+ Added@types/unist@2.0.11(transitive)
+ Addedmdast-util-from-markdown@0.8.5(transitive)
+ Addedmdast-util-to-string@2.0.0(transitive)
+ Addedmicromark@2.11.4(transitive)
+ Addedparse-entities@2.0.0(transitive)
+ Addedunist-util-stringify-position@2.0.3(transitive)
- Removedremark-parse@^7.0.0
- Removedunified@^6.1.2
- Removedbail@1.0.5(transitive)
- Removedcollapse-white-space@1.0.6(transitive)
- Removedextend@3.0.2(transitive)
- Removedinherits@2.0.4(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-plain-obj@1.1.0(transitive)
- Removedis-whitespace-character@1.0.4(transitive)
- Removedis-word-character@1.0.4(transitive)
- Removedmarkdown-escapes@1.0.4(transitive)
- Removedparse-entities@1.2.2(transitive)
- Removedremark-parse@7.0.2(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedreplace-ext@1.0.0(transitive)
- Removedstate-toggle@1.0.3(transitive)
- Removedtrim@0.0.1(transitive)
- Removedtrim-trailing-lines@1.1.4(transitive)
- Removedtrough@1.0.5(transitive)
- Removedunherit@1.1.3(transitive)
- Removedunified@6.2.0(transitive)
- Removedunist-util-is@3.0.0(transitive)
- Removedunist-util-remove-position@1.1.4(transitive)
- Removedunist-util-stringify-position@1.1.2(transitive)
- Removedunist-util-visit@1.4.1(transitive)
- Removedunist-util-visit-parents@2.1.2(transitive)
- Removedvfile@2.3.0(transitive)
- Removedvfile-location@2.0.6(transitive)
- Removedvfile-message@1.1.1(transitive)
- Removedx-is-string@0.1.0(transitive)
- Removedxtend@4.0.2(transitive)