Skip to content

Commit

Permalink
Use Record instead of index signatures
Browse files Browse the repository at this point in the history
  • Loading branch information
jas7457 committed Dec 4, 2023
1 parent 19c8d94 commit 8720143
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .changeset/kind-monkeys-refuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@shopify/eslint-plugin': major
---

Change the @typescript-eslint/consistent-indexed-object-style rule to use default error settings, aka Record over index signature
5 changes: 1 addition & 4 deletions packages/eslint-plugin/lib/config/typescript.js
Original file line number Diff line number Diff line change
Expand Up @@ -264,10 +264,7 @@ module.exports = {
// Requires that private members are marked as readonly if they're never modified outside of the constructor
'@typescript-eslint/prefer-readonly': 'off',
// This rule enforces a consistent way to define records.
'@typescript-eslint/consistent-indexed-object-style': [
'error',
'index-signature',
],
'@typescript-eslint/consistent-indexed-object-style': 'error',
// Disallows unnecessary constraints on generic types
'@typescript-eslint/no-unnecessary-type-constraint': 'error',

Expand Down

0 comments on commit 8720143

Please sign in to comment.