@khanacademy/perseus-linter 0.3.3 → 0.3.5
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 +17 -0
- package/dist/es/index.js +31 -25
- package/dist/es/index.js.map +1 -1
- package/dist/index.d.ts +25 -0
- package/dist/index.js +31 -24
- package/dist/index.js.map +1 -1
- package/dist/version.d.ts +1 -0
- package/package.json +4 -3
- package/src/index.ts +26 -24
- package/src/version.ts +10 -0
- package/tsconfig-build.json +1 -0
- package/tsconfig-build.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @khanacademy/perseus-linter
|
|
2
2
|
|
|
3
|
+
## 0.3.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 55d4cd00: Print package name and version when loaded in the page
|
|
8
|
+
- Updated dependencies [55d4cd00]
|
|
9
|
+
- @khanacademy/perseus-core@1.1.1
|
|
10
|
+
- @khanacademy/perseus-error@0.2.4
|
|
11
|
+
|
|
12
|
+
## 0.3.4
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 388b6506: Convert runLinter doc comment to /\*\* \*/ format so editors pick it up better (VSCode).
|
|
17
|
+
- Updated dependencies [388b6506]
|
|
18
|
+
- @khanacademy/perseus-error@0.2.3
|
|
19
|
+
|
|
3
20
|
## 0.3.3
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
package/dist/es/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PerseusError, Errors } from '@khanacademy/perseus-error';
|
|
2
|
+
import { addLibraryVersionToPerseusDebug } from '@khanacademy/perseus-core';
|
|
2
3
|
import PropTypes from 'prop-types';
|
|
3
4
|
|
|
4
5
|
function _extends() {
|
|
@@ -1749,6 +1750,11 @@ class Stack {
|
|
|
1749
1750
|
}
|
|
1750
1751
|
}
|
|
1751
1752
|
|
|
1753
|
+
// This file is processed by a Rollup plugin (replace) to inject the production
|
|
1754
|
+
const libName = "@khanacademy/perseus-linter";
|
|
1755
|
+
const libVersion = "0.3.5";
|
|
1756
|
+
addLibraryVersionToPerseusDebug(libName, libVersion);
|
|
1757
|
+
|
|
1752
1758
|
// Define the shape of the linter context object that is passed through the
|
|
1753
1759
|
const linterContextProps = PropTypes.shape({
|
|
1754
1760
|
contentType: PropTypes.string,
|
|
@@ -1765,30 +1771,30 @@ const linterContextDefault = {
|
|
|
1765
1771
|
|
|
1766
1772
|
const allLintRules = AllRules.filter(r => r.severity < Rule.Severity.BULK_WARNING);
|
|
1767
1773
|
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1774
|
+
/**
|
|
1775
|
+
* Run the Perseus linter over the specified markdown parse tree,
|
|
1776
|
+
* with the specified context object, and
|
|
1777
|
+
* return a (possibly empty) array of lint warning objects. If the
|
|
1778
|
+
* highlight argument is true, this function also modifies the parse
|
|
1779
|
+
* tree to add "lint" nodes that can be visually rendered,
|
|
1780
|
+
* highlighting the problems for the user. The optional rules argument
|
|
1781
|
+
* is an array of Rule objects specifying which lint rules should be
|
|
1782
|
+
* applied to this parse tree. When omitted, a default set of rules is used.
|
|
1783
|
+
*
|
|
1784
|
+
* The context object may have additional properties that some lint
|
|
1785
|
+
* rules require:
|
|
1786
|
+
*
|
|
1787
|
+
* context.content is the source content string that was parsed to create
|
|
1788
|
+
* the parse tree.
|
|
1789
|
+
*
|
|
1790
|
+
* context.widgets is the widgets object associated
|
|
1791
|
+
* with the content string
|
|
1792
|
+
*
|
|
1793
|
+
* TODO: to make this even more general, allow the first argument to be
|
|
1794
|
+
* a string and run the parser over it in that case? (but ignore highlight
|
|
1795
|
+
* in that case). This would allow the one function to be used for both
|
|
1796
|
+
* online linting and batch linting.
|
|
1797
|
+
*/
|
|
1792
1798
|
function runLinter(tree, context, highlight, rules = allLintRules) {
|
|
1793
1799
|
const warnings = [];
|
|
1794
1800
|
const tt = new TreeTransformer(tree);
|
|
@@ -2017,5 +2023,5 @@ function pushContextStack(context, name) {
|
|
|
2017
2023
|
});
|
|
2018
2024
|
}
|
|
2019
2025
|
|
|
2020
|
-
export { Rule, linterContextDefault, linterContextProps, pushContextStack, allLintRules as rules, runLinter };
|
|
2026
|
+
export { Rule, libVersion, linterContextDefault, linterContextProps, pushContextStack, allLintRules as rules, runLinter };
|
|
2021
2027
|
//# sourceMappingURL=index.js.map
|