Skip to content

Commit

Permalink
docs(linter): add docs for consistent-indexed-object-style (#3409)
Browse files Browse the repository at this point in the history
I forgot to update the docs in #3126.
  • Loading branch information
mysteryven committed May 25, 2024
1 parent 74b06a7 commit 5c7041b
Showing 1 changed file with 17 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 5c7041b

Please sign in to comment.