1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00
denoland-deno/tests
Nathan Whitaker 5ec3c5c3a4
feat(lint): Add lint for usage of node globals (with autofix) (#25048)
From upgrading `deno_lint`.

Previously if you had a node project that used a bunch of node globals
(`process.env`, etc), you would have to fix the errors by hand. This PR
includes a new lint that detects usages of node globals (`process`,
`setImmediate`, `Buffer`, etc.) and provides an autofix to import the
correct value. For instance:

```ts
// main.ts
const _foo = process.env.FOO;
```

`deno lint` gives you

```ts
error[no-node-globals]: NodeJS globals are not available in Deno
 --> /home/foo.ts:1:14
  |
1 | const _foo = process.env.FOO;
  |              ^^^^^^^
  = hint: Add `import process from "node:process";`

  docs: https://lint.deno.land/rules/no-node-globals


Found 1 problem (1 fixable via --fix)
Checked 1 file
```
And `deno lint --fix` adds the import for you:

```ts
// main.ts
import process from "node:process";
const _foo = process.env.FOO;
```
2024-08-15 20:43:04 +00:00
..
config chore: use @std prefix for internal module specifiers (#24543) 2024-07-25 10:26:54 +10:00
ffi chore: update to std@2024.07.19 (#24715) 2024-07-25 15:30:28 +10:00
integration feat(serve): Opt-in parallelism for deno serve (#24920) 2024-08-14 22:26:21 +00:00
napi chore: update the copyright of c, mjs, and jsx (#25005) 2024-08-12 12:41:32 -04:00
node_compat feat: vm rewrite (#24596) 2024-08-06 12:52:53 +00:00
registry fix(lsp): import map lookup for jsr subpath auto import (#25025) 2024-08-14 22:38:18 +01:00
specs feat(lint): Add lint for usage of node globals (with autofix) (#25048) 2024-08-15 20:43:04 +00:00
testdata feat(serve): Opt-in parallelism for deno serve (#24920) 2024-08-14 22:26:21 +00:00
unit test: run unit tests with DENO_FUTURE=1 (#24400) 2024-08-14 22:50:06 +02:00
unit_node feat(ext/node): support http2session.socket (#24786) 2024-08-14 21:59:22 +00:00
util chore: upgrade to rust 1.80 (#24778) 2024-07-29 12:58:04 -04:00
wpt feat(fetch): accept async iterables for body (#24623) 2024-08-06 00:13:02 -07:00
Cargo.toml chore: upgrade flaky_test, fastwebsockets, base64, base32, notify (#24746) 2024-08-01 08:35:35 -04:00
lib.rs chore: move cli/tests/ -> tests/ (#22369) 2024-02-10 20:22:13 +00:00
README.md chore: continue tests/ re-org (#22396) 2024-02-12 17:13:14 -07:00

Deno Integration Tests