@motifx/compiler 1.1.0 → 1.2.0-rc.1

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
@@ -53,7 +53,7 @@ compiler({
53
53
 
54
54
  | Option | Default | Description |
55
55
  | --- | --- | --- |
56
- | `diagnostics` | `true` | Print compiler warnings (`MJX001`–`MJX004`, `MJX007`) for patterns that compile but do not behave as they read. |
56
+ | `diagnostics` | `true` | Print compiler warnings (`MJX001`–`MJX004`, `MJX007`, `MJX015`) for patterns that compile but do not behave as they read. `MJX015` (a class component override that does not reach `super` on every path) is also checked in `.ts` / `.js` files. |
57
57
  | `explain` | `false` | Print what every JSX expression was lowered to. `true` for all files, or a string / `RegExp` matched against the file path. |
58
58
 
59
59
  ## Command-line tools
@@ -62,7 +62,7 @@ compiler({
62
62
  npx motif-lint [--project tsconfig.json] [--json] [--no-fail] [file.tsx …]
63
63
  ```
64
64
 
65
- Type-aware lint (`MJX005`): reports a ternary passed to a component prop whose declared type does not accept a getter. Exits with code 1 when there are findings (`--no-fail` to disable).
65
+ Type-aware lint: `MJX005` reports a ternary passed to a component prop whose declared type does not accept a getter; `MJX015` reports a class component override that does not reach `super` on every path, with the base class resolved by the type checker. Exits with code 1 when there are findings (`--no-fail` to disable).
66
66
 
67
67
  ```bash
68
68
  npx motif-explain src/App.tsx [more.tsx …] [--json] [--site child|attr|prop|…] [--code]
@@ -1,11 +1,13 @@
1
1
  #!/usr/bin/env node
2
2
  /*
3
- * motif-lint — type-aware JSX check (MJX005: ternary passed to a prop that is not Bind<T>)
3
+ * motif-lint — type-aware checks (MJX005: ternary passed to a prop that is not Bind<T>;
4
+ * MJX015: class component override that does not reach super on every path)
4
5
  *
5
6
  * npx motif-lint [--project tsconfig.json] [--json] [--no-fail] [file.tsx …]
6
7
  *
7
8
  * Builds the TypeScript program and reports a ternary written to a component prop whose
8
- * declared type does not accept a function (the compiler always wraps a ternary in a getter).
9
+ * declared type does not accept a function (the compiler always wraps a ternary in a getter),
10
+ * and an override of a ComponentBase method or accessor that can finish without reaching super.
9
11
  * Exits with code 1 when there are findings (0 with `--no-fail`).
10
12
  */
11
13
  const compiler = require('../dist/index.cjs');