Skip to content

Commit

Permalink
docs: deprecate badges defined in READMEs
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish committed Nov 5, 2023
1 parent 94c7e8f commit f126e90
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ There's also a `postprocess` option that's only available via a [config file](#c
| Name | Description | Default |
| :-- | :-- | :-- |
| `--check` | Whether to check for and fail if there is a diff. Any diff will be displayed but no output will be written to files. Typically used during CI. | `false` |
| `--config-emoji` | Custom emoji to use for a config. Format is `config-name,emoji`. Option can be repeated. | Default emojis are provided for [common configs](./lib/emojis.ts). To remove a default emoji and rely on a [badge](#badges) instead, provide the config name without an emoji. |
| `--config-emoji` | Custom emoji to use for a config. Format is `config-name,emoji`. Option can be repeated. | Default emojis are provided for [common configs](./lib/emojis.ts). See [Badges](#badges) for an alternative to emojis. |
| `--config-format` | The format to use for config names. See choices in below [table](#--config-format). | `name` |
| `--ignore-config` | Config to ignore from being displayed. Often used for an `all` config. Option can be repeated. | |
| `--ignore-deprecated-rules` | Whether to ignore deprecated rules from being checked, displayed, or updated. | `false` |
Expand Down Expand Up @@ -305,19 +305,17 @@ module.exports = config;

### Badges

While config emojis are the recommended representations of configs that a rule belongs to (see [`--config-emoji`](#configuration-options)), you can alternatively define badges for configs at the bottom of your `README.md`.
While emojis are the recommended representations of configs that a rule belongs to, you can alternatively use a text/image/icon badge for configs by supplying the following markdown for the emoji using the [`--config-emoji`](#configuration-options) option.

Here's a badge for a custom `fun` config that displays in blue:
For example, here's a text badge for a custom `fun` config that displays in blue:

```md
[badge-fun]: https://img.shields.io/badge/-fun-blue.svg
![fun config badge](https://img.shields.io/badge/-fun-blue.svg)
```

And how it looks:

![badge-fun][]

[badge-fun]: https://img.shields.io/badge/-fun-blue.svg
![fun config logo](https://img.shields.io/badge/-fun-blue.svg)

## Compatibility

Expand Down
2 changes: 1 addition & 1 deletion lib/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ export async function run(
)
.option(
'--config-emoji <config-emoji>',
'(optional) Custom emoji to use for a config. Format is `config-name,emoji`. Default emojis are provided for common configs. To remove a default emoji and rely on a badge instead, provide the config name without an emoji. Option can be repeated.',
'(optional) Custom emoji to use for a config. Format is `config-name,emoji`. Default emojis are provided for common configs. Option can be repeated.',
collectCSVNested,
[]
)
Expand Down
2 changes: 1 addition & 1 deletion lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ export type GenerateOptions = {
* List of configs and their associated emojis.
* Array of `[configName, emoji]`.
* Default emojis are provided for common configs.
* To remove a default emoji and rely on a badge instead, provide the config name without an emoji.
* To use a text/image/icon badge, supply the corresponding markdown as the emoji.
*/
readonly configEmoji?: readonly (
| [configName: string, emoji: string]
Expand Down

0 comments on commit f126e90

Please sign in to comment.