docs(linter): add docs for consistent-indexed-object-style (#3409)

I forgot to update the docs in #3126.
This commit is contained in:
Wang Wenzhe 2024-05-25 18:34:11 +08:00 committed by GitHub
parent 74b06a71da
commit 5c7041bd2a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -33,10 +33,26 @@ declare_oxc_lint!(
/// Require or disallow the `Record` type.
///
/// ### Why is this bad?
///
/// Inconsistent style for indexed object types can harm readability in a project.
///
/// ### Example
/// With "record":
///
/// ```javascript
/// // bad
/// interface Foo {
/// [key: string]: unknown;
///}
/// type Foo = {
/// [key: string]: unknown;
///};
/// ```
///
/// With "index-signature":
///
/// ```javascript
/// // bad
/// type Foo = Record<string, unknown>;
/// ```
ConsistentIndexedObjectStyle,
style