mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
docs(linter): add docs for consistent-indexed-object-style (#3409)
I forgot to update the docs in #3126.
This commit is contained in:
parent
74b06a71da
commit
5c7041bd2a
1 changed files with 17 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue