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

docs: clarify underscore guidance in README #4385

Merged
merged 2 commits into from
Feb 25, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,25 @@ Check out the documentation [here](https://deno.land/std?doc).
import * as fs from "https://deno.land/std@$STD_VERSION/fs/mod.ts";
```

1. Do not import symbols with an underscore in the name.
1. Do not import symbols with a name _prefixed_ by an underscore (they're not
intended for public use).

Bad:
```ts
import { _format } from "https://deno.land/std@$STD_VERSION/path/_common/format.ts";
```

1. Do not import modules with an underscore in the path.
1. Do not import modules with a directory or filename _prefixed_ by an
underscore (they're not intended for public use).

Bad:
```ts
import { filterInPlace } from "https://deno.land/std@$STD_VERSION/collections/_utils.ts";
import { createLPS } from "https://deno.land/std@$STD_VERSION/streams/_common.ts";
```

Good:
```ts
import { TextLineStream } from "https://deno.land/std@$STD_VERSION/streams/text_line_stream.ts";
```

1. Do not import test modules or test data.
Expand Down