-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Normalize error message grammar (TS/JS) #25269
Comments
Adds a section to the style guide that explains how to write error messages for the TypeScript / JavaScript parts of the Deno codebase. This style guide was used in the `std` and seems to be a good fit for the runtime as well. It can be updated as we refactor the existing error messages. denoland/deno#25269
Adds a section to the style guide that explains how to write error messages for the TypeScript / JavaScript parts of the Deno codebase. This style guide was used in the `std` and seems to be a good fit for the runtime as well. It can be updated as we refactor the existing error messages. denoland/deno#25269
I wrote a small Deno script to scan the directories of the deno/deno project and determine which folders have JS/TS files and which of those files
Script: https://gist.github.com/irbull/a16232d1a96ee3023501baf48b17a7e9 |
I'd say something like https://github.com/denoland/std/blob/main/.github/CONTRIBUTING.md#error-messages would be a nice addition to the Deno Style Guide! Good job on the Standard Library, @irbull! |
Thanks for the kind words @oles. I've proposed a PR to the deno style guide with the same formatting used in the I'm putting together a few change-sets that update the JS/TS code in the runtime so we can see how we feel about that here too. |
Aligns the error messages in the cron extension to be in-line with the Deno style guide. denoland#25269
Aligns the error messages in the console extension to be in-line with the Deno style guide. denoland#25269
Aligns the error messages in the console extension to be in-line with the Deno style guide. This change-set aligns the messages in: - ext/cache - ext/canvas - ext/ffi denoland#25269
Aligns the error messages in the console extension to be in-line with the Deno style guide. #25269
Aligns the error messages in the ext/fetch folder to be in-line with the Deno style guide. denoland#25269
Aligns the error messages in the cli/js folder to be in-line with the Deno style guide. denoland#25269
Aligns the error messages in the cli/js folder to be in-line with the Deno style guide. denoland#25269
Aligns the error messages in the ext/fs folder to be in-line with the Deno style guide. denoland#25269
Aligns the error messages in the ext/fetch folder to be in-line with the Deno style guide. #25269
Aligns the error messages in the ext/crypto folder to be in-line with the Deno style guide. denoland#25269
Aligns the error messages in the ext/crypto folder to be in-line with the Deno style guide. #25269
Aligns the error messages in the cron extension to be in-line with the Deno style guide. #25269
Aligns the error messages in the ext/http and a few messages in the ext/fetch folder to be in-line with the Deno style guide. This change-set also removes some unnecessary checks in the 00_serve.ts. These options were recently removed, so it doesn't make sense to check for them anymore. denoland#25269
Aligns the error messages in the ext/http and a few messages in the ext/fetch folder to be in-line with the Deno style guide. denoland#25269
Aligns the error messages in the ext/kv folder to be in-line with the Deno style guide. denoland#25269
Aligns the error messages in the runtime folder to be in-line with the Deno style guide. denoland#25269
Aligns the error messages in the runtime folder to be in-line with the Deno style guide. #25269
Aligns the error messages in the ext/websocket folder to be in-line with the Deno style guide. denoland#25269
Aligns the error messages in the ext/webidl folder to be in-line with the Deno style guide. denoland#25269
Aligns the error messages in the ext/websocket folder to be in-line with the Deno style guide. #25269
Aligns the error messages in the ext/http and a few messages in the ext/fetch folder to be in-line with the Deno style guide. This change-set also removes some unnecessary checks in the 00_serve.ts. These options were recently removed, so it doesn't make sense to check for them anymore. #25269
Aligns the error messages in the ext/webgpu folder to be in-line with the Deno style guide. denoland#25269
Aligns the error messages in the ext/webgpu folder to be in-line with the Deno style guide. #25269
Aligns the error messages in the ext/web folder to be in-line with the Deno style guide. denoland#25269
Aligns the error messages in the ext folder to be in-line with the Deno style guide. denoland#25269
Aligns the error messages in the ext/node folder to be in-line with the Deno style guide. denoland#25269
Aligns the error messages in the ext folder to be in-line with the Deno style guide. #25269 <!-- Before submitting a PR, please read https://docs.deno.com/runtime/manual/references/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. 7. Open as a draft PR if your work is still in progress. The CI won't run all steps, but you can add '[ci]' to a commit message to force it to. 8. If you would like to run the benchmarks on the CI, add the 'ci-bench' label. -->
There are a variety of different ways errors in Deno's TS/JS layer are raised. Some are sentence case, others not. Some end with a period, others do not. Some provide the current state of the system, others do not.
Without a standard error guide, it makes it hard for new contributors to determine how to format error message. Furthermore, without a standard error guide, it makes it hard for users to know what to expect.
We just went through the
std
and normalized the errors there. We should do the same with the JavaScript / TypeScript code in the cli / runtime. There is an issue about improving error messages in the cli [1] which is orthogonal to this.I think we should start with the Error Guide used in the
std
and see if that's a good fit for the JavaScript / TypeScript code in the cli [2].[1] #24699
[2] denoland/std#5574
The text was updated successfully, but these errors were encountered: