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

Missing Parentheses in TypeScript Documentation Example for #paths #60995

Closed
1 task done
Git-abby opened this issue Jan 18, 2025 · 2 comments · Fixed by microsoft/TypeScript-Website#3305
Closed
1 task done
Labels
Needs More Info The issue still hasn't been fully clarified

Comments

@Git-abby
Copy link

Acknowledgement

  • I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.

Comment

The TypeScript documentation example for configuring paths in tsconfig.json has a typo involving missing {parentheses}. The issue can be found in the following code snippet:

Steps to Reproduce:
TypeScript - Paths

Image

Corrected:

{
  "compilerOptions": {
    "paths": {
      "app/*": ["./src/app/*"],
      "config/*": ["./src/app/_config/*"],
      "environment/*": ["./src/environments/*"],
      "shared/*": ["./src/app/_shared/*"],
      "helpers/*": ["./src/helpers/*"],
      "tests/*": ["./src/tests/*"]
    }
  }
}

@RyanCavanaugh
Copy link
Member

I don't see any parentheses in the corrected form, nor do I believe parens are legal here. I can't see a difference between the screenshot and the text -- can you clarify?

@RyanCavanaugh RyanCavanaugh added the Needs More Info The issue still hasn't been fully clarified label Jan 21, 2025
@Git-abby
Copy link
Author

Git-abby commented Jan 21, 2025

Well, If you see thoroughly you can notice three (3) ending parans in the corrected code, however, in the typescript original docs on the above image I captured has only two (2) ending parans. which I ran and giving me error (Expected comma or closing brace)

original :

{  **<---- 1**
  "[compilerOptions](https://www.typescriptlang.org/tsconfig#compilerOptions)": { **<---- 2**
    "[paths](https://www.typescriptlang.org/tsconfig#paths)": { **<---- 3**
        "app/*": ["./src/app/*"],
        "config/*": ["./src/app/_config/*"],
        "environment/*": ["./src/environments/*"],
        "shared/*": ["./src/app/_shared/*"],
        "helpers/*": ["./src/helpers/*"],
        "tests/*": ["./src/tests/*"]
    },  **<---- 1**
} **<---- 2**

here you are missing clossing paran,

Corrected:

{
  "compilerOptions": {
    "paths": {
      "app/*": ["./src/app/*"],
      "config/*": ["./src/app/_config/*"],
      "environment/*": ["./src/environments/*"],
      "shared/*": ["./src/app/_shared/*"],
      "helpers/*": ["./src/helpers/*"],
      "tests/*": ["./src/tests/*"]
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs More Info The issue still hasn't been fully clarified
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants