Skip to content

Commit

Permalink
Merge pull request #409 from Shopify/jaddleman/use-record
Browse files Browse the repository at this point in the history
Use Record instead of index signatures
  • Loading branch information
jas7457 committed Dec 4, 2023
2 parents 19c8d94 + 4fd9e99 commit a31814e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 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
2 changes: 1 addition & 1 deletion packages/images/optimize.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export function svgOptions(): {[key: string]: unknown};
export function svgOptions(): Record<string, unknown>;
4 changes: 2 additions & 2 deletions packages/typescript-configs/definitions/styles.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
declare module '*.scss' {
const classNames: {[key: string]: string};
const classNames: Record<string, string>;
export default classNames;
}

declare module '*.css' {
const classNames: {[key: string]: string};
const classNames: Record<string, string>;
export default classNames;
}

0 comments on commit a31814e

Please sign in to comment.