denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
97.62k stars 5.37k forks source link

deno.json: Unsupported property 'target' in compilerOptions #26800

Closed BlasterM2A closed 2 days ago

BlasterM2A commented 3 days ago

Version: Deno 2.0.5

According to the doc Configuring TypeScript, you can define the target property in compilerOptions, but neither the IDE nor Deno CLI recognize it as valid.



image

JetBrains WebStorm


image

VSCode



image




Note: deno.json config used in previous cases.

{
  "$schema": "https://deno.land/x/deno/cli/schemas/config-file.v1.json",
  "vendor": true,
  "tasks": {
    "fmt": "deno task dprint fmt",
    "fmt:check": "deno task dprint check"
  },
  "nodeModulesDir": "auto",
  "lint": {
    "rules": {
      "tags": [
        "recommended"
      ],
      "include": [
        "no-non-null-assertion"
      ]
    }
  },
  "compilerOptions": {
    "target": "esnext",
    "jsx": "react-jsxdev",
    "jsxImportSource": "react"
  }
}
BlackAsLight commented 3 days ago

On that link you listed, it has the target property in a few examples, but it doesn't say a single word anywhere about it. Moreover on that page it has a table listing the valid compiler options and target isn't on that list.

BlasterM2A commented 3 days ago

On that link you listed, it has the target property in a few examples, but it doesn't say a single word anywhere about it. Moreover on that page it has a table listing the valid compiler options and target isn't on that list.

The reference to "target" and "esnext" is by no means residual in that documentation, and the use of examples that aren't reproducible or banal causes confusion. The comment "For a complete list of compiler options and how they affect TypeScript, see the TypeScript Manual" also suggests that other properties are supported.

BlackAsLight commented 3 days ago

The comment "For a complete list of compiler options and how they affect TypeScript, see the TypeScript Manual" also suggests that other properties are supported.

I can see how that comment can be confusing, but I believe it is essentially saying TypeScript supports more options, but Deno isn't exposing all those options in the version it ships.

BlasterM2A commented 2 days ago

The comment "For a complete list of compiler options and how they affect TypeScript, see the TypeScript Manual" also suggests that other properties are supported.

I can see how that comment can be confusing, but I believe it is essentially saying TypeScript supports more options, but Deno isn't exposing all those options in the version it ships.

Got it. I was having issues with a third-party library related to the use of import.meta, which led me to review the documentation and try to reproduce the examples.

I'm closing this ticket since the reported issue isn't a Deno CLI bug.