Skip to content

Do not use index.ts #248382

Closed
Closed
@aeschli

Description

@aeschli

https://github.com/Microsoft/vscode/blob/8a221b0bf4fb7d53703e7a45982d229c19fcadd0/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/languageFeatures/index.ts
https://github.com/Microsoft/vscode/blob/8a221b0bf4fb7d53703e7a45982d229c19fcadd0/src/vs/workbench/contrib/chat/common/promptSyntax/contributions/index.ts

In the VS Code code base we have avoided using index.ts

  • it will lead to a large number of 'index.ts' in the project, making the navigation and understanding more difficult
  • if you want an entry point to a contribution or package, name it as your package. e.g. folding.contribution.ts
  • index.ts. is more common in CommonJS where you can require a folder which then is resolved to the index file in that folder.
    The VS Code code base is ESM, so this might be confusing

Metadata

Metadata

Labels

debtCode quality issues

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions