brillout / telefunc

Remote Functions. Instead of API.
https://telefunc.com
MIT License
690 stars 31 forks source link

Use prefixed node: APIs #114

Closed sergeysova closed 4 months ago

sergeysova commented 5 months ago

fixes #113

brillout commented 5 months ago

:+1: Also, one thing we could do is to add a Biome rule to avoid mistakenly omitting the node: prefix. WDYT?

sergeysova commented 4 months ago

Looks like the rule available since v1.5.0 https://biomejs.dev/linter/rules/use-nodejs-import-protocol/ But actually I see:

telefunc/telefunc/biome.json:24:9 deserialize ━━━━━━━━━━━━━━━━━━━━━━━━━

  ✖ Found an unknown key `useNodejsImportProtocol`.

    22 │       "style": {
    23 │         "recommended": true,
  > 24 │         "useNodejsImportProtocol": "error"
       │         ^^^^^^^^^^^^^^^^^^^^^^^^^
    25 │       }
    26 │     }

Looks like biome need to be upgraded

brillout commented 4 months ago

Very nice.

Running $ biome lint --write . doesn't fix the imports that are missing the node: prefix, can we make Biome autofix this as well? It says Unsafe fix so maybe that's why, and maybe we need to tell Biome to apply its autofix despite being "unsafe".

Biome doesn't complain about dynamic imports such as import('path'), is there a way to make it complain about dynamic imports as well? Actually it does, my bad (I was testing with an ignored file).

brillout commented 4 months ago

The arg --unsafe does the trick.

brillout commented 4 months ago

Closing in favor of https://github.com/brillout/telefunc/pull/115.