@khanacademy/perseus-linter 0.3.10 → 0.3.12

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.
Files changed (53) hide show
  1. package/dist/es/index.js +1 -1
  2. package/dist/index.js +1 -1
  3. package/package.json +7 -4
  4. package/.eslintrc.js +0 -12
  5. package/CHANGELOG.md +0 -148
  6. package/src/README.md +0 -41
  7. package/src/__tests__/matcher.test.ts +0 -498
  8. package/src/__tests__/rule.test.ts +0 -110
  9. package/src/__tests__/rules.test.ts +0 -548
  10. package/src/__tests__/selector-parser.test.ts +0 -51
  11. package/src/__tests__/tree-transformer.test.ts +0 -444
  12. package/src/index.ts +0 -281
  13. package/src/proptypes.ts +0 -19
  14. package/src/rule.ts +0 -419
  15. package/src/rules/absolute-url.ts +0 -23
  16. package/src/rules/all-rules.ts +0 -71
  17. package/src/rules/blockquoted-math.ts +0 -9
  18. package/src/rules/blockquoted-widget.ts +0 -9
  19. package/src/rules/double-spacing-after-terminal.ts +0 -11
  20. package/src/rules/extra-content-spacing.ts +0 -11
  21. package/src/rules/heading-level-1.ts +0 -13
  22. package/src/rules/heading-level-skip.ts +0 -19
  23. package/src/rules/heading-sentence-case.ts +0 -10
  24. package/src/rules/heading-title-case.ts +0 -68
  25. package/src/rules/image-alt-text.ts +0 -20
  26. package/src/rules/image-in-table.ts +0 -9
  27. package/src/rules/image-spaces-around-urls.ts +0 -34
  28. package/src/rules/image-widget.ts +0 -49
  29. package/src/rules/link-click-here.ts +0 -10
  30. package/src/rules/lint-utils.ts +0 -47
  31. package/src/rules/long-paragraph.ts +0 -13
  32. package/src/rules/math-adjacent.ts +0 -9
  33. package/src/rules/math-align-extra-break.ts +0 -10
  34. package/src/rules/math-align-linebreaks.ts +0 -42
  35. package/src/rules/math-empty.ts +0 -9
  36. package/src/rules/math-font-size.ts +0 -11
  37. package/src/rules/math-frac.ts +0 -9
  38. package/src/rules/math-nested.ts +0 -10
  39. package/src/rules/math-starts-with-space.ts +0 -11
  40. package/src/rules/math-text-empty.ts +0 -9
  41. package/src/rules/math-without-dollars.ts +0 -13
  42. package/src/rules/nested-lists.ts +0 -10
  43. package/src/rules/profanity.ts +0 -9
  44. package/src/rules/table-missing-cells.ts +0 -19
  45. package/src/rules/unbalanced-code-delimiters.ts +0 -13
  46. package/src/rules/unescaped-dollar.ts +0 -9
  47. package/src/rules/widget-in-table.ts +0 -9
  48. package/src/selector.ts +0 -504
  49. package/src/tree-transformer.ts +0 -583
  50. package/src/types.ts +0 -7
  51. package/src/version.ts +0 -10
  52. package/tsconfig-build.json +0 -12
  53. package/tsconfig-build.tsbuildinfo +0 -1
package/dist/es/index.js CHANGED
@@ -1768,7 +1768,7 @@ class Stack {
1768
1768
 
1769
1769
  // This file is processed by a Rollup plugin (replace) to inject the production
1770
1770
  const libName = "@khanacademy/perseus-linter";
1771
- const libVersion = "0.3.10";
1771
+ const libVersion = "0.3.12";
1772
1772
  addLibraryVersionToPerseusDebug(libName, libVersion);
1773
1773
 
1774
1774
  // Define the shape of the linter context object that is passed through the
package/dist/index.js CHANGED
@@ -1747,7 +1747,7 @@ class Stack {
1747
1747
 
1748
1748
  // This file is processed by a Rollup plugin (replace) to inject the production
1749
1749
  const libName = "@khanacademy/perseus-linter";
1750
- const libVersion = "0.3.10";
1750
+ const libVersion = "0.3.12";
1751
1751
  perseusCore.addLibraryVersionToPerseusDebug(libName, libVersion);
1752
1752
 
1753
1753
  // Define the shape of the linter context object that is passed through the
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Linter engine for Perseus",
4
4
  "author": "Khan Academy",
5
5
  "license": "MIT",
6
- "version": "0.3.10",
6
+ "version": "0.3.12",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -18,15 +18,18 @@
18
18
  "module": "dist/es/index.js",
19
19
  "main": "dist/index.js",
20
20
  "source": "src/index.ts",
21
+ "files": [
22
+ "dist"
23
+ ],
21
24
  "scripts": {
22
25
  "test": "bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'"
23
26
  },
24
27
  "dependencies": {
25
- "@khanacademy/perseus-core": "1.4.1",
26
- "@khanacademy/perseus-error": "^0.2.9"
28
+ "@khanacademy/perseus-core": "1.4.2",
29
+ "@khanacademy/perseus-error": "^0.2.11"
27
30
  },
28
31
  "devDependencies": {
29
- "@khanacademy/pure-markdown": "^0.2.13",
32
+ "@khanacademy/pure-markdown": "^0.2.15",
30
33
  "prop-types": "^15.6.1"
31
34
  },
32
35
  "peerDependencies": {
package/.eslintrc.js DELETED
@@ -1,12 +0,0 @@
1
- /* eslint-disable @typescript-eslint/no-var-requires */
2
- /* eslint-disable import/no-commonjs */
3
- const path = require("path");
4
-
5
- module.exports = {
6
- rules: {
7
- "import/no-extraneous-dependencies": [
8
- "error",
9
- {packageDir: [__dirname, path.join(__dirname, "../../")]},
10
- ],
11
- },
12
- };
package/CHANGELOG.md DELETED
@@ -1,148 +0,0 @@
1
- # @khanacademy/perseus-linter
2
-
3
- ## 0.3.10
4
-
5
- ### Patch Changes
6
-
7
- - Updated dependencies [[`1f4e17ba`](https://github.com/Khan/perseus/commit/1f4e17ba77e1491523813655af18a70285a25989), [`8857950b`](https://github.com/Khan/perseus/commit/8857950bdeeb6e13bc3766b1c6545289b21cbe2a)]:
8
- - @khanacademy/perseus-core@1.4.1
9
- - @khanacademy/perseus-error@0.2.9
10
-
11
- ## 0.3.9
12
-
13
- ### Patch Changes
14
-
15
- - [#814](https://github.com/Khan/perseus/pull/814) [`105d2060`](https://github.com/Khan/perseus/commit/105d20603d935d35cff237b17f0bfb57ca751e4c) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Minor build change to how we provide Typescript type definitions (should be no change to build output).
16
-
17
- - Updated dependencies [[`a91c84fe`](https://github.com/Khan/perseus/commit/a91c84fe53827ff4333220777a9918882b7fe9f0), [`105d2060`](https://github.com/Khan/perseus/commit/105d20603d935d35cff237b17f0bfb57ca751e4c)]:
18
- - @khanacademy/perseus-core@1.4.0
19
- - @khanacademy/perseus-error@0.2.8
20
-
21
- ## 0.3.8
22
-
23
- ### Patch Changes
24
-
25
- - Updated dependencies [[`79403e06`](https://github.com/Khan/perseus/commit/79403e06eedb597d7818d6c858bbba6f51ff3fe1)]:
26
- - @khanacademy/perseus-core@1.3.0
27
- - @khanacademy/perseus-error@0.2.7
28
-
29
- ## 0.3.7
30
-
31
- ### Patch Changes
32
-
33
- - Updated dependencies [[`376eb0e4`](https://github.com/Khan/perseus/commit/376eb0e4aaaa4c7a90fd6107a84bb74d382b077c)]:
34
- - @khanacademy/perseus-core@1.2.0
35
- - @khanacademy/perseus-error@0.2.6
36
-
37
- ## 0.3.6
38
-
39
- ### Patch Changes
40
-
41
- - Updated dependencies [22a9c408]
42
- - @khanacademy/perseus-core@1.1.2
43
- - @khanacademy/perseus-error@0.2.5
44
-
45
- ## 0.3.5
46
-
47
- ### Patch Changes
48
-
49
- - 55d4cd00: Print package name and version when loaded in the page
50
- - Updated dependencies [55d4cd00]
51
- - @khanacademy/perseus-core@1.1.1
52
- - @khanacademy/perseus-error@0.2.4
53
-
54
- ## 0.3.4
55
-
56
- ### Patch Changes
57
-
58
- - 388b6506: Convert runLinter doc comment to /\*\* \*/ format so editors pick it up better (VSCode).
59
- - Updated dependencies [388b6506]
60
- - @khanacademy/perseus-error@0.2.3
61
-
62
- ## 0.3.3
63
-
64
- ### Patch Changes
65
-
66
- - Updated dependencies [a383823d]
67
- - @khanacademy/perseus-error@0.2.2
68
-
69
- ## 0.3.2
70
-
71
- ### Patch Changes
72
-
73
- - ce5e6297: Upgrade wonder-blocks deps to package versions without Flow types
74
-
75
- ## 0.3.1
76
-
77
- ### Patch Changes
78
-
79
- - 1f062e98: Bump all package versions since the build settings have been updated
80
- - Updated dependencies [1f062e98]
81
- - @khanacademy/perseus-error@0.2.1
82
-
83
- ## 0.3.0
84
-
85
- ### Minor Changes
86
-
87
- - 53fd3768: Migrate source code to TypeScript
88
-
89
- ### Patch Changes
90
-
91
- - Updated dependencies [53fd3768]
92
- - @khanacademy/perseus-error@0.2.0
93
-
94
- ## 0.2.5
95
-
96
- ### Patch Changes
97
-
98
- - Updated dependencies [a1b4ab3c]
99
- - @khanacademy/perseus-error@0.1.5
100
-
101
- ## 0.2.4
102
-
103
- ### Patch Changes
104
-
105
- - Updated dependencies [6a7f36be]
106
- - @khanacademy/perseus-error@0.1.4
107
-
108
- ## 0.2.3
109
-
110
- ### Patch Changes
111
-
112
- - f567f660: Update the eslint config to look at both the package.json for the package and the one from the root
113
- - Updated dependencies [f567f660]
114
- - @khanacademy/perseus-error@0.1.3
115
-
116
- ## 0.2.2
117
-
118
- ### Patch Changes
119
-
120
- - bf180fe1: Fix our use of import/no-extraneous-dependencies
121
- - Updated dependencies [bf180fe1]
122
- - @khanacademy/perseus-error@0.1.2
123
-
124
- ## 0.2.1
125
-
126
- ### Patch Changes
127
-
128
- - 98d283ff: Fix storybook
129
- - Updated dependencies [98d283ff]
130
- - @khanacademy/perseus-error@0.1.1
131
-
132
- ## 0.2.0
133
-
134
- ### Minor Changes
135
-
136
- - 2578bd16: Rename NotGorgon to TranslationLinter
137
- - 2578bd16: Rename Gorgon to PerseusLinter
138
-
139
- ## 0.1.0
140
-
141
- ### Minor Changes
142
-
143
- - a4f10ace: Move Gorgon, PerseusError, PureMarkdown into their own packages
144
-
145
- ### Patch Changes
146
-
147
- - Updated dependencies [a4f10ace]
148
- - @khanacademy/perseus-error@0.1.0
package/src/README.md DELETED
@@ -1,41 +0,0 @@
1
- # perseus-linter
2
-
3
- The linter is implemented by the following files:
4
-
5
- tree-transformer.js:
6
-
7
- This file defines a TreeTransformer class for traversing (and
8
- optionally transforming by inserting, reparenting and removing
9
- nodes) markdown parse trees. When traversing a tree, a
10
- TreeTransformer calls the function you specify on each node. This is
11
- a post-order traversal: the function is called on the way back up,
12
- not on the way down. When the function is invoked, it is passed the
13
- current node, a state object, and the concatenated content of the
14
- node and its descendants. The state object is the interesting one:
15
- it is an instance of TraversalState, which is a class defined in
16
- (but not exported by) this same file. TraversalState has an API for
17
- querying the ancestors and siblings of the current node, and also an
18
- API for replacing the current node with a new one.
19
-
20
- selector.js:
21
-
22
- This file defines the Selector class which works like a CSS selector
23
- for markdown parse trees. Selector.parse() converts strings like
24
- "heading + paragraph > text" to Selector objects. A Selector object
25
- has a match() method that tests whether a given node in a parse tree
26
- matches. The match() method takes a TraversalState object as its
27
- argument, so selectors can only be used during a TreeTransformer
28
- traversal.
29
-
30
- rule.js:
31
-
32
- This file defines the Rule class which represents a single lint
33
- rule. A Rule object has a check() method that takes the same (node,
34
- state, content) arguments that a TreeTransformer passes to the
35
- traversal callback function. Rules can have a selector, a regular
36
- expression, and a function. If a node matches the selector and its
37
- content matches the regular expression, then the function is called
38
- to check the node and return a warning message if the node does, in
39
- fact, have lint.
40
-
41
- See the individual file for additional documentation.