@khanacademy/perseus-linter 0.3.9 → 0.3.11

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