This repository was archived by the owner on Jun 25, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -37,11 +37,7 @@ rules:
3737 as a dependency / devDependency and invoke it using your package manager to ensure version pinning
3838 and reproducibility.
3939 patterns :
40- - pattern-either :
41- - pattern : " $CMD"
42- - pattern : |
43- `$CMD`
44- - metavariable-pattern :
45- metavariable : $CMD
46- language : sh
47- pattern : npx ...
40+ - pattern : " $STRING"
41+ - metavariable-regex :
42+ metavariable : $STRING
43+ regex : ' .*\bnpx\s'
Original file line number Diff line number Diff line change @@ -17,10 +17,10 @@ function lintCode() {
1717}
1818
1919// String literal in error message (like global.setup.ts:72)
20- // This won't be caught because "Example: npx..." doesn't parse as shell command starting with npx
20+ // Now caught with regex - flags npx usage anywhere in strings including docs/examples
2121function throwError ( ) {
2222 throw new Error (
23- // ok : npx-usage-js
23+ // ruleid : npx-usage-js
2424 'Please specify a project name with --project flag. Example: npx playwright test --project dummy-test-local'
2525 ) ;
2626}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ function runPlaywrightTests(): void {
1313// Error message with npx example
1414function throwConfigError ( ) : never {
1515 throw new Error (
16- // This may or may not be caught depending on shell parsing
16+ // ruleid: npx-usage-js
1717 'Please specify a project name with --project flag. Example: npx playwright test --project dummy-test-local'
1818 ) ;
1919}
You can’t perform that action at this time.
0 commit comments