deno icon indicating copy to clipboard operation
deno copied to clipboard

Warn when invalid "unstable" value in deno.jsonc

Open littledivy opened this issue 1 year ago • 3 comments

{
  "tasks": {
    "start": "deno run index.js"
  },
  "unstable": [
    "abc"
  ]
}
deno task start

This should warn that "abc" is not a valid unstable feature. There is no indication where the feature is being used or not.

littledivy avatar Jan 18 '24 17:01 littledivy

This seems like a simple fix, but I'm not sure where we use this configuration to decide on unstable features. @dsherret maybe you could provide some pointers?

bartlomieju avatar Jan 18 '24 23:01 bartlomieju

Maybe we should just warn here?

https://github.com/denoland/deno/blob/47232f8a41532a7ea3ed05c87b52bbd66a68cdab/cli/args/mod.rs#L696

dsherret avatar Jan 19 '24 17:01 dsherret

Maybe we can use #[serde(deny_unknown_fields)] for the config and print the error?

littledivy avatar Jan 19 '24 17:01 littledivy

Hello @dsherret, I'd like to to give this issue a shot.

But, can you please confirm if the valid unstable features are the following? Since I'll refer to them in solving the issue.

  1. (UNSTABLE_GRANULAR_FLAGS) can be found in deno/runtime/lib.rs
  2. bare_node_builtins
  3. byonm
  4. sloppy_imports All the preceding unstable flags were mentioned within this link: https://docs.deno.com/runtime/manual/tools/unstable_flags

Hasan-Alrimawi avatar Jun 04 '24 09:06 Hasan-Alrimawi