Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error about using ES2023 #2699

Open
jmagaram opened this issue Jan 15, 2025 · 5 comments
Open

error about using ES2023 #2699

jmagaram opened this issue Jan 15, 2025 · 5 comments
Labels
bug Something isn't working

Comments

@jmagaram
Copy link

This is a bit beyond me, but I've got a new React project I made with the vite template. I tried to update the tsconfig.json to target ES2023 and I'm getting this error below specifically from the Edge development tools. I have the latest typescript 5.6.3. I'm actually able to use the latest functions like array.toSorted and get docs on them inside of VS Code. It seems the Edge Dev Tools aren't happy. Don't know how to fix this.

// tsconfig.json
{
  "files": [],
  "references": [
    { "path": "./tsconfig.app.json" },
    { "path": "./tsconfig.node.json" }
  ],
  "compilerOptions": {
    "forceConsistentCasingInFileNames": true,
    "strict": true,
    "noUnusedLocals": true,
    "noUnusedParameters": false,
    "noFallthroughCasesInSwitch": true,
    "noUncheckedSideEffectImports": true,
    "types": ["vitest/importMeta"]
  }
}

// tsconfig.node.json
{
  "extends": "./tsconfig.json",

  "compilerOptions": {
    "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
    "target": "ES2023",
    "lib": ["ES2023"],
    "module": "ESNext",
    "skipLibCheck": true,

    /* Bundler mode */
    "moduleResolution": "Bundler",
    "allowImportingTsExtensions": true,
    "isolatedModules": true,
    "moduleDetection": "force",
    "noEmit": true
  },
  "include": ["vite.config.ts"]
}

'compilerOptions/target' must be equal to one of the allowed values 'ES3, ES5, ES6, ES2015, ES2016, ES2017, ES2018, ES2019, ES2020, ES2021, ES2022, ESNext'. Value found '"ES2023"'. Or 'compilerOptions/target' must match pattern '^([Ee][Ss]([356]|(20(1[56789]|2[012]))|[Nn][Ee][Xx][Tt]))$'. Value found 'ES2023'

/Source/hot% npm list typescript
[email protected] /Users/justinmagaram/Source/hot
├─┬ [email protected]
│ └── [email protected] deduped
├─┬ [email protected]
│ └─┬ @typescript-eslint/[email protected]
│   └─┬ [email protected]
│     └── [email protected] deduped
└── [email protected]
@jmagaram
Copy link
Author

This is the version of Edge on my Mac...

Version 131.0.2903.147 (Official build) (arm64)

@jmagaram
Copy link
Author

package.json...

  "devDependencies": {
    "@eslint/js": "^9.13.0",
    "@types/react": "^18.3.12",
    "@types/react-dom": "^18.3.1",
    "@vitejs/plugin-react-swc": "^3.5.0",
    "eslint": "^9.13.0",
    "eslint-plugin-react-hooks": "^5.0.0",
    "eslint-plugin-react-refresh": "^0.4.14",
    "globals": "^15.11.0",
    "ts-node": "^10.9.2",
    "typescript": "~5.6.2",
    "typescript-eslint": "^8.11.0",
    "typescript-language-server": "^4.3.3",
    "vite": "^5.4.10",
    "vitest": "^2.1.5"
  },

@vidorteg
Copy link
Contributor

Hi @jmagaram,

Thank you for reporting this. The message you pasted, where are you observing it? Are you seeing this though a message or a "squiggle" (underline zig-zag line)?

Depending on where you observe this you might be able to disable the specific hint via a .hintrc file that turns the rule off: e.g

{
  "extends": [
    "development"
  ],
  "hints": {
    "compat-api/css": [
      "default",
      {
        "ignore": [
          "backdrop-filter",
          "mask-repeat"
        ]
      }
    ]
  }
}

You could also disable webhint from the extension settings, although that will apply for all the projects.

@vidorteg vidorteg added the bug Something isn't working label Jan 17, 2025
@jmagaram
Copy link
Author

I am seeing this inside the tsconfg.node.json file with a squiggle and in the Problems view. The quick fix is to add a .hintrc or disable the typescript-config/is-valid hints for the entire project. When I add this hint file, I get "Edge Tools Server crashed 5 times in the last 3 minutes".

Is this a bug? It seems the .hintrc file should not be needed at all.

@vidorteg
Copy link
Contributor

Thank you for the follow up, this seems be a bug between webhint and the Edge Tools for VSCode. I'll take a look to see what I can find.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants