tsconfig.json not working for some reason?

  Kiến thức lập trình

here is my directory:

d-----      2024-04-29   오후 8:15                JavaScript
d-----      2024-04-30   오후 7:29                Python
d-----      2024-04-30   오후 6:25                Texts and etc
d-----      2024-04-21  오전 11:10                TypeScript
d-----      2024-05-01   오후 2:14                Web

i use typescript in that typescript folder

d-----      2024-04-26   오후 4:36                Functions
d-----      2024-03-23   오후 9:48                node_modules
-a----      2024-04-21  오전 11:08              0 main.ts
-a----      2024-03-23   오후 9:48            675 package-lock.json
-a----      2024-04-19   오후 9:14            322 package.json
-a----      2024-04-27   오후 8:17            115 tsconfig.json

and all of the ts files are in the FUnctions folder or the main.ts
the problem is that, the tsconfig.json compiler options just does not work

{
  "compilerOptions": {
    "target": "ES2022",
    "module": "commonjs",
    "lib": ["ESNext", "DOM"]
  }
}

i clearly specified the compiler options, the lib option to that but when i compile the file in the Functions folder, it says that;

Property 'flat' does not exist on type 'any[]'. Do you need to change your target library? Try changing the 'lib' compiler option to 'es2019' or later.

I think I did everything right but why does it say this?
also because the compiler options does not work, when i try to use a specific function in it then it says that “Array.reduce()” is not a function
i tried moving the ts files inside that folder into C:/Coding/TypeScript but still, it returns an error again
PLEASE HELP ME

New contributor

Lanzoor is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

LEAVE A COMMENT