svet
svet3w ago

Have a trouble using github hooks and deno

For some reason when I try to use deno lint --allow-import it throws this: error: unexpected argument '--allow-import' found I tried anything, but this just won't work, neither --allow-import nor -I, neither in the beggining deno -I lint nor in the end deno lint -I Maybe I have something wrongly configured?
$ deno -I lint
error: unexpected argument '--allow-import' found

tip: 'lint --allow-import' exists
$ deno -I lint
error: unexpected argument '--allow-import' found

tip: 'lint --allow-import' exists
And if I use just deno lint and press y to allow imports everything works flawlessly using deno cli 2.1.3
12 Replies
svet
svetOP3w ago
btw https://docs.deno.com/go/lint seems not to work When I try to use it with my new project it also tells me that such argument does not exist, so I would suppose it might be a problem with my OS configuration, however deno lint -I also fails on CI 🤷‍♂️
Leokuma
Leokuma3w ago
Try:
deno lint --rules-exclude=no-import,no-import-assertions,no-import-assign,no-sloppy-imports
deno lint --rules-exclude=no-import,no-import-assertions,no-import-assign,no-sloppy-imports
Also try:
deno lint --rules-include=allow-import
deno lint --rules-include=allow-import
svet
svetOP3w ago
The cli commands you've provided are the ones you configure linting rules with, but the thing I have not working is import access flag --allow-import to make deno lint run without having to agree to allow import accesses And yet it is obvious that deno lint --allow-import exists, it just doesn't work on my machine
Leokuma
Leokuma3w ago
Sorry I misread your question
Leokuma
Leokuma3w ago
Maybe --allow-import requires that you provide a specific domain? https://docs.deno.com/runtime/fundamentals/security/#importing-from-the-web
Deno
Security and permissions
In-depth documentation, guides, and reference materials for building secure, high-performance JavaScript and TypeScript applications with Deno
Leokuma
Leokuma3w ago
like --allow-import=raw.githubusercontent.com
svet
svetOP3w ago
damn, so I have to put in every domain...
Leokuma
Leokuma3w ago
but actually the docs say it's optional maybe you've found a bug
svet
svetOP3w ago
yeah, I think so, because specifying domains doesn't fix it
thank you for your help! I'ma go and file an issue
svet
svetOP3w ago
@Leokuma Turned out to be a bug and now it is fixed https://github.com/denoland/deno/issues/27318
GitHub
unexpected argument --allow-import found with deno lint · Issue #27...
Version: Deno 2.1.3 When trying to use deno -I lint in project of mine deno cli outputs the following: error: unexpected argument '--allow-import' found tip: 'lint --allow-import' e...
Leokuma
Leokuma3w ago
That was fast ⚡
svet
svetOP3w ago
Considering 2K issues listed on github that was actually fast

Did you find this page helpful?