@khanacademy/perseus-linter 0.0.0-PR973-20240207204548 → 0.0.0-PR973-20240207204706

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 (51) hide show
  1. package/package.json +7 -4
  2. package/.eslintrc.js +0 -12
  3. package/CHANGELOG.md +0 -168
  4. package/src/README.md +0 -41
  5. package/src/__tests__/matcher.test.ts +0 -498
  6. package/src/__tests__/rule.test.ts +0 -110
  7. package/src/__tests__/rules.test.ts +0 -548
  8. package/src/__tests__/selector-parser.test.ts +0 -51
  9. package/src/__tests__/tree-transformer.test.ts +0 -444
  10. package/src/index.ts +0 -281
  11. package/src/proptypes.ts +0 -19
  12. package/src/rule.ts +0 -419
  13. package/src/rules/absolute-url.ts +0 -23
  14. package/src/rules/all-rules.ts +0 -71
  15. package/src/rules/blockquoted-math.ts +0 -9
  16. package/src/rules/blockquoted-widget.ts +0 -9
  17. package/src/rules/double-spacing-after-terminal.ts +0 -11
  18. package/src/rules/extra-content-spacing.ts +0 -11
  19. package/src/rules/heading-level-1.ts +0 -13
  20. package/src/rules/heading-level-skip.ts +0 -19
  21. package/src/rules/heading-sentence-case.ts +0 -10
  22. package/src/rules/heading-title-case.ts +0 -68
  23. package/src/rules/image-alt-text.ts +0 -20
  24. package/src/rules/image-in-table.ts +0 -9
  25. package/src/rules/image-spaces-around-urls.ts +0 -34
  26. package/src/rules/image-widget.ts +0 -49
  27. package/src/rules/link-click-here.ts +0 -10
  28. package/src/rules/lint-utils.ts +0 -47
  29. package/src/rules/long-paragraph.ts +0 -13
  30. package/src/rules/math-adjacent.ts +0 -9
  31. package/src/rules/math-align-extra-break.ts +0 -10
  32. package/src/rules/math-align-linebreaks.ts +0 -42
  33. package/src/rules/math-empty.ts +0 -9
  34. package/src/rules/math-font-size.ts +0 -11
  35. package/src/rules/math-frac.ts +0 -9
  36. package/src/rules/math-nested.ts +0 -10
  37. package/src/rules/math-starts-with-space.ts +0 -11
  38. package/src/rules/math-text-empty.ts +0 -9
  39. package/src/rules/math-without-dollars.ts +0 -13
  40. package/src/rules/nested-lists.ts +0 -10
  41. package/src/rules/profanity.ts +0 -9
  42. package/src/rules/table-missing-cells.ts +0 -19
  43. package/src/rules/unbalanced-code-delimiters.ts +0 -13
  44. package/src/rules/unescaped-dollar.ts +0 -9
  45. package/src/rules/widget-in-table.ts +0 -9
  46. package/src/selector.ts +0 -504
  47. package/src/tree-transformer.ts +0 -583
  48. package/src/types.ts +0 -7
  49. package/src/version.ts +0 -10
  50. package/tsconfig-build.json +0 -12
  51. package/tsconfig-build.tsbuildinfo +0 -1
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.0.0-PR973-20240207204548",
6
+ "version": "0.0.0-PR973-20240207204706",
7
7
  "publishConfig": {
8
8
  "access": "public"
9
9
  },
@@ -19,15 +19,18 @@
19
19
  "main": "dist/index.js",
20
20
  "source": "src/index.ts",
21
21
  "types": "dist/index.d.ts",
22
+ "files": [
23
+ "dist"
24
+ ],
22
25
  "scripts": {
23
26
  "test": "bash -c 'yarn --silent --cwd \"../..\" test ${@:0} $($([[ ${@: -1} = -* ]] || [[ ${@: -1} = bash ]]) && echo $PWD)'"
24
27
  },
25
28
  "dependencies": {
26
- "@khanacademy/perseus-core": "0.0.0-PR973-20240207204548",
27
- "@khanacademy/perseus-error": "^0.0.0-PR973-20240207204548"
29
+ "@khanacademy/perseus-core": "0.0.0-PR973-20240207204706",
30
+ "@khanacademy/perseus-error": "^0.0.0-PR973-20240207204706"
28
31
  },
29
32
  "devDependencies": {
30
- "@khanacademy/pure-markdown": "^0.0.0-PR973-20240207204548",
33
+ "@khanacademy/pure-markdown": "^0.0.0-PR973-20240207204706",
31
34
  "prop-types": "^15.6.1"
32
35
  },
33
36
  "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,168 +0,0 @@
1
- # @khanacademy/perseus-linter
2
-
3
- ## 0.0.0-PR973-20240207204548
4
-
5
- ### Patch Changes
6
-
7
- - [#973](https://github.com/Khan/perseus/pull/973) [`2ffc6971`](https://github.com/Khan/perseus/commit/2ffc6971e7003cbc64a8a3988337c6ca6019c9db) Thanks [@jeremywiebe](https://github.com/jeremywiebe)! - Include 'types' key in package.json
8
-
9
- - Updated dependencies [[`2ffc6971`](https://github.com/Khan/perseus/commit/2ffc6971e7003cbc64a8a3988337c6ca6019c9db)]:
10
- - @khanacademy/perseus-core@0.0.0-PR973-20240207204548
11
- - @khanacademy/perseus-error@0.0.0-PR973-20240207204548
12
-
13
- ## 0.3.11
14
-
15
- ### Patch Changes
16
-
17
- - [#971](https://github.com/Khan/perseus/pull/971) [`90ff7a48`](https://github.com/Khan/perseus/commit/90ff7a483b01552a556c7852427e98153cc20417) Thanks [@benchristel](https://github.com/benchristel)! - Remove source files from the distributed NPM package
18
-
19
- - Updated dependencies [[`90ff7a48`](https://github.com/Khan/perseus/commit/90ff7a483b01552a556c7852427e98153cc20417)]:
20
- - @khanacademy/perseus-core@1.4.2
21
- - @khanacademy/perseus-error@0.2.10
22
-
23
- ## 0.3.10
24
-
25
- ### Patch Changes
26
-
27
- - Updated dependencies [[`1f4e17ba`](https://github.com/Khan/perseus/commit/1f4e17ba77e1491523813655af18a70285a25989), [`8857950b`](https://github.com/Khan/perseus/commit/8857950bdeeb6e13bc3766b1c6545289b21cbe2a)]:
28
- - @khanacademy/perseus-core@1.4.1
29
- - @khanacademy/perseus-error@0.2.9
30
-
31
- ## 0.3.9
32
-
33
- ### Patch Changes
34
-
35
- - [#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).
36
-
37
- - Updated dependencies [[`a91c84fe`](https://github.com/Khan/perseus/commit/a91c84fe53827ff4333220777a9918882b7fe9f0), [`105d2060`](https://github.com/Khan/perseus/commit/105d20603d935d35cff237b17f0bfb57ca751e4c)]:
38
- - @khanacademy/perseus-core@1.4.0
39
- - @khanacademy/perseus-error@0.2.8
40
-
41
- ## 0.3.8
42
-
43
- ### Patch Changes
44
-
45
- - Updated dependencies [[`79403e06`](https://github.com/Khan/perseus/commit/79403e06eedb597d7818d6c858bbba6f51ff3fe1)]:
46
- - @khanacademy/perseus-core@1.3.0
47
- - @khanacademy/perseus-error@0.2.7
48
-
49
- ## 0.3.7
50
-
51
- ### Patch Changes
52
-
53
- - Updated dependencies [[`376eb0e4`](https://github.com/Khan/perseus/commit/376eb0e4aaaa4c7a90fd6107a84bb74d382b077c)]:
54
- - @khanacademy/perseus-core@1.2.0
55
- - @khanacademy/perseus-error@0.2.6
56
-
57
- ## 0.3.6
58
-
59
- ### Patch Changes
60
-
61
- - Updated dependencies [22a9c408]
62
- - @khanacademy/perseus-core@1.1.2
63
- - @khanacademy/perseus-error@0.2.5
64
-
65
- ## 0.3.5
66
-
67
- ### Patch Changes
68
-
69
- - 55d4cd00: Print package name and version when loaded in the page
70
- - Updated dependencies [55d4cd00]
71
- - @khanacademy/perseus-core@1.1.1
72
- - @khanacademy/perseus-error@0.2.4
73
-
74
- ## 0.3.4
75
-
76
- ### Patch Changes
77
-
78
- - 388b6506: Convert runLinter doc comment to /\*\* \*/ format so editors pick it up better (VSCode).
79
- - Updated dependencies [388b6506]
80
- - @khanacademy/perseus-error@0.2.3
81
-
82
- ## 0.3.3
83
-
84
- ### Patch Changes
85
-
86
- - Updated dependencies [a383823d]
87
- - @khanacademy/perseus-error@0.2.2
88
-
89
- ## 0.3.2
90
-
91
- ### Patch Changes
92
-
93
- - ce5e6297: Upgrade wonder-blocks deps to package versions without Flow types
94
-
95
- ## 0.3.1
96
-
97
- ### Patch Changes
98
-
99
- - 1f062e98: Bump all package versions since the build settings have been updated
100
- - Updated dependencies [1f062e98]
101
- - @khanacademy/perseus-error@0.2.1
102
-
103
- ## 0.3.0
104
-
105
- ### Minor Changes
106
-
107
- - 53fd3768: Migrate source code to TypeScript
108
-
109
- ### Patch Changes
110
-
111
- - Updated dependencies [53fd3768]
112
- - @khanacademy/perseus-error@0.2.0
113
-
114
- ## 0.2.5
115
-
116
- ### Patch Changes
117
-
118
- - Updated dependencies [a1b4ab3c]
119
- - @khanacademy/perseus-error@0.1.5
120
-
121
- ## 0.2.4
122
-
123
- ### Patch Changes
124
-
125
- - Updated dependencies [6a7f36be]
126
- - @khanacademy/perseus-error@0.1.4
127
-
128
- ## 0.2.3
129
-
130
- ### Patch Changes
131
-
132
- - f567f660: Update the eslint config to look at both the package.json for the package and the one from the root
133
- - Updated dependencies [f567f660]
134
- - @khanacademy/perseus-error@0.1.3
135
-
136
- ## 0.2.2
137
-
138
- ### Patch Changes
139
-
140
- - bf180fe1: Fix our use of import/no-extraneous-dependencies
141
- - Updated dependencies [bf180fe1]
142
- - @khanacademy/perseus-error@0.1.2
143
-
144
- ## 0.2.1
145
-
146
- ### Patch Changes
147
-
148
- - 98d283ff: Fix storybook
149
- - Updated dependencies [98d283ff]
150
- - @khanacademy/perseus-error@0.1.1
151
-
152
- ## 0.2.0
153
-
154
- ### Minor Changes
155
-
156
- - 2578bd16: Rename NotGorgon to TranslationLinter
157
- - 2578bd16: Rename Gorgon to PerseusLinter
158
-
159
- ## 0.1.0
160
-
161
- ### Minor Changes
162
-
163
- - a4f10ace: Move Gorgon, PerseusError, PureMarkdown into their own packages
164
-
165
- ### Patch Changes
166
-
167
- - Updated dependencies [a4f10ace]
168
- - @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.