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

tsconfig schema: disallow additional properties? #3731

Open
OliverJAsh opened this issue Apr 23, 2024 · 1 comment
Open

tsconfig schema: disallow additional properties? #3731

OliverJAsh opened this issue Apr 23, 2024 · 1 comment
Labels
help wanted issue:bug Report errors or unexpected behavior (auto-generated by issue forms)

Comments

@OliverJAsh
Copy link

OliverJAsh commented Apr 23, 2024

Area with issue?

JSON Schema

✔️ Expected Behavior

This should fail validation due to the typo: includes should be include.

tsconfig.json:

{
    "includes": ["foo.ts"]
}

❌ Actual Behavior

This does not fail validation, presumably because include is optional and includes is considered an additional property which is allowed.

Could we disallow additional properties to make it easier to catch typo mistakes like this?

YAML or JSON file that does not work.

See above.

IDE or code editor.

Visual Studio Code

Are you making a PR for this?

Yes, I will create a PR, once I understand more.

@OliverJAsh OliverJAsh added the issue:bug Report errors or unexpected behavior (auto-generated by issue forms) label Apr 23, 2024
@hyperupcall
Copy link
Member

I'm not opposed to this change. I think it's possible to keep the semantics of the existing schema with requires on all the subschemas that are a child of allOf. (the allOf and anyOf probably need to be removed to play well with additionalProperties: false. The exact same changes need to be made to the jsconfig.json schemas as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted issue:bug Report errors or unexpected behavior (auto-generated by issue forms)
Projects
None yet
Development

No branches or pull requests

2 participants