@khanacademy/perseus-linter 0.3.3 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/es/index.js +24 -24
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +24 -0
- package/dist/index.js +24 -24
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/src/index.ts +24 -24
- package/tsconfig-build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @khanacademy/perseus-linter
|
|
2
2
|
|
|
3
|
+
## 0.3.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 388b6506: Convert runLinter doc comment to /\*\* \*/ format so editors pick it up better (VSCode).
|
|
8
|
+
- Updated dependencies [388b6506]
|
|
9
|
+
- @khanacademy/perseus-error@0.2.3
|
|
10
|
+
|
|
3
11
|
## 0.3.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
package/dist/es/index.js
CHANGED
|
@@ -1765,30 +1765,30 @@ const linterContextDefault = {
|
|
|
1765
1765
|
|
|
1766
1766
|
const allLintRules = AllRules.filter(r => r.severity < Rule.Severity.BULK_WARNING);
|
|
1767
1767
|
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1768
|
+
/**
|
|
1769
|
+
* Run the Perseus linter over the specified markdown parse tree,
|
|
1770
|
+
* with the specified context object, and
|
|
1771
|
+
* return a (possibly empty) array of lint warning objects. If the
|
|
1772
|
+
* highlight argument is true, this function also modifies the parse
|
|
1773
|
+
* tree to add "lint" nodes that can be visually rendered,
|
|
1774
|
+
* highlighting the problems for the user. The optional rules argument
|
|
1775
|
+
* is an array of Rule objects specifying which lint rules should be
|
|
1776
|
+
* applied to this parse tree. When omitted, a default set of rules is used.
|
|
1777
|
+
*
|
|
1778
|
+
* The context object may have additional properties that some lint
|
|
1779
|
+
* rules require:
|
|
1780
|
+
*
|
|
1781
|
+
* context.content is the source content string that was parsed to create
|
|
1782
|
+
* the parse tree.
|
|
1783
|
+
*
|
|
1784
|
+
* context.widgets is the widgets object associated
|
|
1785
|
+
* with the content string
|
|
1786
|
+
*
|
|
1787
|
+
* TODO: to make this even more general, allow the first argument to be
|
|
1788
|
+
* a string and run the parser over it in that case? (but ignore highlight
|
|
1789
|
+
* in that case). This would allow the one function to be used for both
|
|
1790
|
+
* online linting and batch linting.
|
|
1791
|
+
*/
|
|
1792
1792
|
function runLinter(tree, context, highlight, rules = allLintRules) {
|
|
1793
1793
|
const warnings = [];
|
|
1794
1794
|
const tt = new TreeTransformer(tree);
|