You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(linter): get cli args on JS side, to avoid runtime inconsistencies (#14223)
fixes#14150
related: #14112, #14071
This seems to be the only reliable way to get arguments across different runtimes.
when running with deno, the args from `std::env::args_os()` look like:
```
[
"/Users/cameron/.deno/bin/deno",
"run",
"--ext=js",
"-A",
"/Users/cameron/github/camc314/oxlint-repros/issue-14150/node_modules/.deno/oxlint@1.18.0/node_modules/oxlint/bin/oxlint",
".",
]
```
however `process.argv` looks like:
```
[
"oxlint",
"/Users/cameron/github/camc314/oxlint-repros/issue-14150/node_modules/.deno/oxlint@1.18.0/node_modules/oxlint/bin/oxlint",
"."
]
```
so skipping the first two means that we end up with incorrect args that we're trying to parts.
There are (potentially) other solutions e.g. search for one of the args ending in`oxlint`, or other methods of trying to guess.
However, this feels like the most reliable solution.
0 commit comments