Repository navigation
Commit bec1e39
committed
fix(rules): close the split-literal gap in no-unrouted-cli-invocation
The regex required a launcher in front of the package name, so a split
literal (`"npx " + "@taskless/cli"`) put the two halves in separate
string_fragment nodes and the rule never saw a match. It now matches the
package name alone, which costs nothing: every string in packages/cli/src/
naming the package is an invocation, and both existing occurrences already
sit inside applyCliInvocation(). Added a split-literal test case, which
fails against the launcher-anchored regex.
Both remaining limitations are documented in the rule's note rather than
left implicit, since this rule is the only enforcement for some sites it
covers: a split placed mid-name still evades any single-fragment rule, and
an aliased import is not recognised as routed, which is a false positive
and therefore the safe direction to fail in.
Reported by review on #209.1 parent ec077ed commit bec1e39
2 files changed
Lines changed: 20 additions & 1 deletion
File tree
- .taskless/rules/sg/no-unrouted-cli-invocation
- .tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
18 | 20 | | |
19 | 21 | | |
20 | 22 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
27 | 44 | | |
28 | 45 | | |
29 | 46 | | |
30 | 47 | | |
31 | 48 | | |
32 | 49 | | |
33 | 50 | | |
34 | | - | |
| 51 | + | |
35 | 52 | | |
36 | 53 | | |
37 | 54 | | |
| |||
0 commit comments