microsoft / TypeScript

TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
https://www.typescriptlang.org
Apache License 2.0
101.2k stars 12.51k forks source link

capitalization of es2017 in error message does not match capitalization of ES2017 autocomplete suggestion #43000

Open hamirmahal opened 3 years ago

hamirmahal commented 3 years ago

If the maintainers of this repository think this issue is worth considering, I would like to contribute the fix for it.

Bug Report

πŸ”Ž Search Terms

"capital ES" "capitalization ES"

πŸ•— Version & Regression Information

⏯ Playground Link

Playground link with relevant code

πŸ’» Code

const myObj = {};
Object.values(myObj);

with "Target:" set to a pre-ES2017 example, like ES5.

πŸ™ Actual behavior

On hover, the error message says, "Property 'values' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the lib compiler option to 'es2017' or later.(2550)"

The capitalization in this error message does not match the auto-generated capital "ES2017" suggestion in VSCode when filling out the lib compiler option.

πŸ™‚ Expected behavior

For consistency, I think the error message should say, "Property 'values' does not exist on type 'ObjectConstructor'. Do you need to change your target library? Try changing the lib compiler option to 'ES2017' or later.(2550)", instead.

Here, the capital "ES2017" matches the suggested "ES2017" that appears when typing in a tsconfig.json file in VSCode.

DanielRosenwasser commented 3 years ago

The change would either be to our error messages, or to the schemastore config: https://github.com/SchemaStore/schemastore/blob/master/src/schemas/json/tsconfig.json

Either capitalization works - but I'm split on which would be "better" πŸ˜„

hamirmahal commented 3 years ago

Ha, either capitalization works for me, too.

I have a fix for this issue, but I think this issue has to have the "backlog" milestone before I can create a pull request for it.

RyanCavanaugh commented 3 years ago

Happy to take a PR on this one. Thanks!

hamirmahal commented 3 years ago

You're welcome!