@khanacademy/simple-markdown 0.9.3 → 0.10.0

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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # @khanacademy/simple-markdown
2
2
 
3
+ ## 0.10.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 0993a46b: Don't generate Flow types
8
+
9
+ ### Patch Changes
10
+
11
+ - afb14cff: Add eslint rule to make type imports consistent
12
+ - ce5e6297: Upgrade wonder-blocks deps to package versions without Flow types
13
+
3
14
  ## 0.9.3
4
15
 
5
16
  ### Patch Changes
package/dist/es/index.js CHANGED
@@ -134,11 +134,11 @@ var parserFor = function parserFor(rules, defaultState) {
134
134
  // the initial quality is NaN (that's why there's the
135
135
  // condition negation).
136
136
  if (!(currQuality <= quality)) {
137
- // @ts-expect-error [FEI-5003] - TS2322 - Type 'string' is not assignable to type 'null'.
137
+ // @ts-expect-error - TS2322 - Type 'string' is not assignable to type 'null'.
138
138
  ruleType = currRuleType;
139
- // @ts-expect-error [FEI-5003] - TS2322 - Type 'ParserRule' is not assignable to type 'null'.
139
+ // @ts-expect-error - TS2322 - Type 'ParserRule' is not assignable to type 'null'.
140
140
  rule = currRule;
141
- // @ts-expect-error [FEI-5003] - TS2322 - Type 'Capture' is not assignable to type 'null'.
141
+ // @ts-expect-error - TS2322 - Type 'Capture' is not assignable to type 'null'.
142
142
  capture = currCapture;
143
143
  quality = currQuality;
144
144
  }
@@ -166,13 +166,13 @@ var parserFor = function parserFor(rules, defaultState) {
166
166
  if (rule == null || capture == null) {
167
167
  throw new Error("Could not find a matching rule for the below " + "content. The rule with highest `order` should " + "always match content provided to it. Check " + "the definition of `match` for '" + ruleList[ruleList.length - 1] + "'. It seems to not match the following source:\n" + source);
168
168
  }
169
- // @ts-expect-error [FEI-5003] - TS2339 - Property 'index' does not exist on type 'never'.
169
+ // @ts-expect-error - TS2339 - Property 'index' does not exist on type 'never'.
170
170
  if (capture.index) {
171
171
  // If present and non-zero, i.e. a non-^ regexp result:
172
172
  throw new Error("`match` must return a capture starting at index 0 " + "(the current parse index). Did you forget a ^ at the " + "start of the RegExp?");
173
173
  }
174
174
 
175
- // @ts-expect-error [FEI-5003] - TS2339 - Property 'parse' does not exist on type 'never'.
175
+ // @ts-expect-error - TS2339 - Property 'parse' does not exist on type 'never'.
176
176
  var parsed = rule.parse(capture, nestedParse, state);
177
177
  // We maintain the same object here so that rules can
178
178
  // store references to the objects they return and
@@ -224,7 +224,7 @@ var inlineRegex = function inlineRegex(regex) {
224
224
  return null;
225
225
  }
226
226
  };
227
- // @ts-expect-error [FEI-5003] - TS2339 - Property 'regex' does not exist on type '(source: string, state: State, prevCapture: string) => Capture | null | undefined'.
227
+ // @ts-expect-error - TS2339 - Property 'regex' does not exist on type '(source: string, state: State, prevCapture: string) => Capture | null | undefined'.
228
228
  match.regex = regex;
229
229
  return match;
230
230
  };
@@ -430,7 +430,7 @@ var TABLES = function () {
430
430
  if (node.type === "text" && (tableRow[i + 1] == null || tableRow[i + 1].type === "tableSeparator")) {
431
431
  node.content = node.content.replace(TABLE_CELL_END_TRIM, "");
432
432
  }
433
- // @ts-expect-error [FEI-5003] - TS2345 - Argument of type 'SingleASTNode' is not assignable to parameter of type 'never'.
433
+ // @ts-expect-error - TS2345 - Argument of type 'SingleASTNode' is not assignable to parameter of type 'never'.
434
434
  cells[cells.length - 1].push(node);
435
435
  }
436
436
  });
@@ -689,7 +689,7 @@ var defaultRules = {
689
689
  var bullet = capture[2];
690
690
  var ordered = bullet.length > 1;
691
691
  var start = ordered ? +bullet : undefined;
692
- // @ts-expect-error [FEI-5003] - TS2322 - Type 'RegExpMatchArray | null' is not assignable to type 'string[]'.
692
+ // @ts-expect-error - TS2322 - Type 'RegExpMatchArray | null' is not assignable to type 'string[]'.
693
693
  var items = capture[0].replace(LIST_BLOCK_END_R, "\n").match(LIST_ITEM_R);
694
694
 
695
695
  // We know this will match here, because of how the regexes are
@@ -1246,7 +1246,7 @@ var ruleOutput = function ruleOutput(rules, property) {
1246
1246
  console.warn("simple-markdown ruleOutput should take 'react' or " + "'html' as the second argument.");
1247
1247
  }
1248
1248
  var nestedRuleOutput = function nestedRuleOutput(ast, outputFunc, state) {
1249
- // @ts-expect-error [FEI-5003] - TS2349 - This expression is not callable.
1249
+ // @ts-expect-error - TS2349 - This expression is not callable.
1250
1250
  // Type 'unknown' has no call signatures.
1251
1251
  return rules[ast.type][property](ast, outputFunc, state);
1252
1252
  };
@@ -1269,12 +1269,12 @@ var reactFor = function reactFor(outputFunc) {
1269
1269
  state.key = "" + i;
1270
1270
  var nodeOut = nestedOutput(ast[i], state);
1271
1271
  if (typeof nodeOut === "string" && typeof lastResult === "string") {
1272
- // @ts-expect-error [FEI-5003] - TS2322 - Type 'string' is not assignable to type 'null'.
1272
+ // @ts-expect-error - TS2322 - Type 'string' is not assignable to type 'null'.
1273
1273
  lastResult = lastResult + nodeOut;
1274
1274
  result[result.length - 1] = lastResult;
1275
1275
  } else {
1276
1276
  result.push(nodeOut);
1277
- // @ts-expect-error [FEI-5003] - TS2322 - Type 'ReactNode' is not assignable to type 'null'.
1277
+ // @ts-expect-error - TS2322 - Type 'ReactNode' is not assignable to type 'null'.
1278
1278
  lastResult = nodeOut;
1279
1279
  }
1280
1280
  }
@@ -1310,11 +1310,11 @@ var outputFor = function outputFor(rules, property, defaultState = {}) {
1310
1310
  var arrayRule = rules.Array || defaultRules.Array;
1311
1311
 
1312
1312
  // Tricks to convince tsc that this var is not null:
1313
- // @ts-expect-error [FEI-5003] - TS2538 - Type 'symbol' cannot be used as an index type.
1313
+ // @ts-expect-error - TS2538 - Type 'symbol' cannot be used as an index type.
1314
1314
  var arrayRuleCheck = arrayRule[property];
1315
1315
  if (!arrayRuleCheck) {
1316
1316
  throw new Error("simple-markdown: outputFor: to join nodes of type `" +
1317
- // @ts-expect-error [FEI-5003] - TS2469 - The '+' operator cannot be applied to type 'symbol'.
1317
+ // @ts-expect-error - TS2469 - The '+' operator cannot be applied to type 'symbol'.
1318
1318
  property + "` you must provide an `Array:` joiner rule with that type, " + "Please see the docs for details on specifying an Array rule.");
1319
1319
  }
1320
1320
  var arrayRuleOutput = arrayRuleCheck;
@@ -1324,7 +1324,7 @@ var outputFor = function outputFor(rules, property, defaultState = {}) {
1324
1324
  if (Array.isArray(ast)) {
1325
1325
  return arrayRuleOutput(ast, nestedOutput, state);
1326
1326
  } else {
1327
- // @ts-expect-error [FEI-5003] - TS2349 - This expression is not callable.
1327
+ // @ts-expect-error - TS2349 - This expression is not callable.
1328
1328
  // Type 'unknown' has no call signatures.
1329
1329
  return rules[ast.type][property](ast, nestedOutput, state);
1330
1330
  }
@@ -1336,7 +1336,7 @@ var outputFor = function outputFor(rules, property, defaultState = {}) {
1336
1336
  return outerOutput;
1337
1337
  };
1338
1338
 
1339
- // @ts-expect-error [FEI-5003] - TS2345 - Argument of type 'DefaultRules' is not assignable to parameter of type 'ParserRules'.
1339
+ // @ts-expect-error - TS2345 - Argument of type 'DefaultRules' is not assignable to parameter of type 'ParserRules'.
1340
1340
  var defaultRawParse = parserFor(defaultRules);
1341
1341
  var defaultBlockParse = function defaultBlockParse(source, state) {
1342
1342
  state = state || {};