Skip to content

Provide warnings/errors when putting tsconfig compilerOptions in the root of the tsconfig.jsonΒ #43293

Closed
@orta

Description

@orta

Suggestion

πŸ” Search Terms

TSConfig root fields errors

βœ… Viability Checklist

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion

{
    "target": "es2017",
    "module": "commonjs",
    "lib": [
      "esnext",
      "es2015",
      "es2016",
      "es2017"
    ] 
}

Should give some sort of feedback that you really want:

{
  "compilerOptions": {
    "target": "es2017",
    "module": "commonjs",
    "lib": [
      "esnext",
      "es2015",
      "es2016",
      "es2017"
    ] 
  }
}

πŸ“ƒ Motivating Example

I can't think of a reason why you might want to have these keys in the root of your tsconfig, open to ideas about why you might.

πŸ’» Use Cases

New folks who accidentally set up the tsconfig wrong

Metadata

Metadata

Assignees

No one assigned

    Labels

    Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions