1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00
denoland-deno/cli
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
..
args refactor: remove version::is_canary(), use ReleaseChannel instead (#25053) 2024-08-15 21:59:16 +02:00
bench chore: update the copyright of c, mjs, and jsx (#25005) 2024-08-12 12:41:32 -04:00
cache perf: skip saving to emit cache after first failure (#24896) 2024-08-08 09:41:30 +00:00
js feat(jupyter): support confirm and prompt in notebooks (#23592) 2024-07-04 22:12:14 +00:00
lsp fix(lsp): import map lookup for jsr subpath auto import (#25025) 2024-08-14 22:38:18 +01:00
napi chore: forward v1.45.5 release commit to main (#24818) 2024-07-31 15:14:27 -07:00
npm feat(node): support username and _password in .npmrc file (#24793) 2024-08-14 18:53:15 +02:00
ops fix: adapt to new jupyter runtime API and include session IDs (#24762) 2024-07-27 10:39:08 +02:00
schemas feat(workspace): support object config (#24483) 2024-07-09 17:06:50 -04:00
standalone refactor: remove version::is_canary(), use ReleaseChannel instead (#25053) 2024-08-15 21:59:16 +02:00
tools feat(lint): Add lint for usage of node globals (with autofix) (#25048) 2024-08-15 20:43:04 +00:00
tsc fix: rename watch event missing (#24893) 2024-08-07 18:15:57 +02:00
util feat(clean): add progress bar (#25026) 2024-08-14 13:04:07 +02:00
auth_tokens.rs fix(cli): Add IP address support to DENO_AUTH_TOKEN (#22297) 2024-02-06 19:45:40 +01:00
build.rs Revert "fix(cli): add NAPI support in standalone mode (#24642)" (#24682) 2024-07-23 02:42:26 +02:00
Cargo.toml feat(lint): Add lint for usage of node globals (with autofix) (#25048) 2024-08-15 20:43:04 +00:00
cdp.rs chore: upgrade to rust 1.79 (#24207) 2024-06-14 17:10:57 +05:30
clippy.toml refactor: don't share reqwest::HttpClient across tokio runtimes (#24092) 2024-06-03 21:17:08 +00:00
deno.ico fix(cli): add icon and metadata to deno.exe on Windows (#6693) 2020-07-15 21:54:38 +02:00
emit.rs perf: skip saving to emit cache after first failure (#24896) 2024-08-08 09:41:30 +00:00
entitlements.plist chore: start codesigning mac release builds (#21303) 2023-11-23 15:30:26 -07:00
errors.rs fix(compile): support workspace members importing other members (#24909) 2024-08-07 07:43:05 +00:00
factory.rs feat: deno remove (#24952) 2024-08-12 16:17:25 -04:00
file_fetcher.rs refactor: remove PermissionsContainer in deno_runtime (#24119) 2024-06-06 23:37:53 -04:00
graph_container.rs refactor: update to deno_config 0.25 (#24645) 2024-07-19 15:56:07 -04:00
graph_util.rs perf: skip saving to emit cache after first failure (#24896) 2024-08-08 09:41:30 +00:00
http_util.rs fix(ext/fetch): include URL and error details on fetch failures (#24910) 2024-08-07 23:18:33 -07:00
integration_tests_runner.rs chore: continue tests/ re-org (#22396) 2024-02-12 17:13:14 -07:00
js.rs chore: rename __runtime_js_source to hmr (#24442) 2024-07-05 17:47:53 +05:30
jsr.rs feat(lsp): workspace jsr resolution (#24121) 2024-06-10 17:03:17 +01:00
main.rs refactor: remove version::is_canary(), use ReleaseChannel instead (#25053) 2024-08-15 21:59:16 +02:00
mainrt.rs refactor: remove version::is_canary(), use ReleaseChannel instead (#25053) 2024-08-15 21:59:16 +02:00
module_loader.rs feat: upgrade V8 to 12.8 (#24693) 2024-07-31 23:22:34 +00:00
node.rs refactor: decouple node resolution from deno_core (#24724) 2024-07-25 19:08:14 -04:00
README.md docs(cli): do not need gen doc for cli (#17260) 2023-01-04 13:19:58 +01:00
resolver.rs fix(compile): support workspace members importing other members (#24909) 2024-08-07 07:43:05 +00:00
shared.rs refactor: remove version::is_canary(), use ReleaseChannel instead (#25053) 2024-08-15 21:59:16 +02:00
task_runner.rs fix(cli): Respect implied BYONM from DENO_FUTURE in deno task (#24652) 2024-07-19 18:59:04 +00:00
version.rs refactor: remove version::is_canary(), use ReleaseChannel instead (#25053) 2024-08-15 21:59:16 +02:00
worker.rs feat(serve): Opt-in parallelism for deno serve (#24920) 2024-08-14 22:26:21 +00:00

Deno CLI Crate

crates

This provides the actual deno executable and the user-facing APIs.

The deno crate uses the deno_core to provide the executable.