microsoft / microsoft/typespec

tspconfig.yml vs tspconfig.yaml

Open
#2,257 2 comments 0 reactions 0 assignees View on GitHub
triaged:core
Dominant language
Java
Stars
5.9k
Forks
394
Avg merge
1d 23h
Merged PRs (30d)
104

Description

If a spec author accidentally names the config file `tspconfig.yml` instead of `tspconfig.yaml`, it can be hard to diagnose. The file is silently ignored, so there is no compiler error, only a warning `no emitter was configured` which can be easy to miss.

```
$ npx tsp compile .
TypeSpec compiler v0.46.0

Compilation completed successfully.

No emitter was configured, no output was generated. Use `--emit `
to pick emitter or specify it in the typespec config.
```

This happened in a PR, and it took me a while to diagnose:

https://github.com/Azure/azure-rest-api-specs-pr/pull/14001

For now, I will be adding a check in TypeSpecValidation to fail if it detects any file named `tspconfig.yml`:

https://github.com/Azure/azure-rest-api-specs/issues/25122

Options for `@typespec/compiler`:

1. Treats `tspconfig.yml` as equivalent to `tspconfig.yaml`
2. Throw error if it detects file named `tspconfig.yml`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.