rip-lang 3.13.82 → 3.13.83

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/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  </p>
10
10
 
11
11
  <p align="center">
12
- <a href="CHANGELOG.md"><img src="https://img.shields.io/badge/version-3.13.82-blue.svg" alt="Version"></a>
12
+ <a href="CHANGELOG.md"><img src="https://img.shields.io/badge/version-3.13.83-blue.svg" alt="Version"></a>
13
13
  <a href="#zero-dependencies"><img src="https://img.shields.io/badge/dependencies-ZERO-brightgreen.svg" alt="Dependencies"></a>
14
14
  <a href="#"><img src="https://img.shields.io/badge/tests-1%2C436%2F1%2C436-brightgreen.svg" alt="Tests"></a>
15
15
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green.svg" alt="License"></a>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rip-lang",
3
- "version": "3.13.82",
3
+ "version": "3.13.83",
4
4
  "description": "A modern language that compiles to JavaScript",
5
5
  "type": "module",
6
6
  "main": "src/compiler.js",
package/src/typecheck.js CHANGED
@@ -322,7 +322,7 @@ export async function runCheck(targetDir, opts = {}) {
322
322
  else if (severity === 'warning') totalWarnings++;
323
323
  }
324
324
 
325
- // Untyped component prop checking
325
+ // Untyped component prop checking — flag props without :: annotation
326
326
  if (!opts.allowAny && entry.dts) {
327
327
  const dtsLines = entry.dts.split('\n');
328
328
  const srcLines = entry.source.split('\n');
@@ -331,13 +331,16 @@ export async function runCheck(targetDir, opts = {}) {
331
331
  if (!cm) continue;
332
332
  for (let p = d + 1; p < dtsLines.length; p++) {
333
333
  if (/^\}/.test(dtsLines[p])) break;
334
- const pm = dtsLines[p].match(/^\s+(\w+)\?\s*:\s*any;$/);
334
+ const pm = dtsLines[p].match(/^\s+(\w+)\??\s*:/);
335
335
  if (!pm) continue;
336
336
  const propName = pm[1];
337
337
  for (let s = 0; s < srcLines.length; s++) {
338
- if (new RegExp('@' + propName + '\\s*:=').test(srcLines[s])) {
339
- errors.push({ line: s + 1, message: `Prop '${propName}' on component ${cm[1]} has no type annotation`, severity: 'error', code: 'rip' });
340
- totalErrors++;
338
+ const m = new RegExp('@' + propName + '\\s*(::|([:!]?=))').exec(srcLines[s]);
339
+ if (m) {
340
+ if (m[1] !== '::') {
341
+ errors.push({ line: s + 1, message: `Prop '${propName}' on component ${cm[1]} has no type annotation`, severity: 'error', code: 'rip' });
342
+ totalErrors++;
343
+ }
341
344
  break;
342
345
  }
343
346
  }