Skip to content

allow per file compilerOptions #31035

Closed as not planned
Closed as not planned
@MarcWeber

Description

@MarcWeber

Search Terms

Allow to set compilerOption for each file

Suggestion

Having multiple "references" dependencies sucks because there is still much redundancy in managing dependencies such as having to add "refrerences" and still add it to your node_modules by a tool like fyn - also for small library (maybe single files) it seems to be some overhead.
It looks smarter to just have one ts process manage everything (mono repo) like, eg see https://github.com/MarcWeber/tsmono which allows linking dependencies so that you can use them as they were part of the current repository thus no wasting time writing intermediary .js files or the like which eventually needs to be transpiled again.

There is one big problem: The dependencies might have different compiler options.
So it would be nice if compiler options could be specified on a per file basis.

The most stupid implementation could be s.th like

tsconfig.json be optionally a list containing many tsconfig configurations.
Then include/exclude could be used.

Example: tsconfig.json's contents

[[{
  "include": "src/my-lib",
  "compilerOptions": { strict : true}
},{
 "include": "src/other-lib",
  "compilerOptions": { strict : false}
}]

Maybe there are more solutions to this. Thus opening this issue to see how many more uses case might exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    SuggestionAn idea for TypeScriptToo ComplexAn issue which adding support for may be too complex for the value it adds

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions