From 48e334155ed5989da35744f635c551886261476e Mon Sep 17 00:00:00 2001 From: Ryan Wilson-Perkin Date: Tue, 2 Apr 2024 15:05:58 -0400 Subject: [PATCH] Fix lint formatting --- polaris-for-vscode/src/server.ts | 2 +- polaris-icons/tests/validate-svg-content.test.js | 1 - polaris-react/postcss-mixins/no-focus-ring.css | 2 +- polaris-react/src/components/Avatar/Avatar.stories.tsx | 2 +- .../src/components/ThemeProvider/ThemeProvider.tsx | 2 +- .../utilities/tests/use-index-resource-state.test.tsx | 10 +++++----- polaris-tokens/src/themes/base/breakpoints.ts | 2 +- polaris-tokens/src/themes/types.ts | 2 +- 8 files changed, 11 insertions(+), 12 deletions(-) diff --git a/polaris-for-vscode/src/server.ts b/polaris-for-vscode/src/server.ts index 5009c9a1f82..ca1f36ac751 100644 --- a/polaris-for-vscode/src/server.ts +++ b/polaris-for-vscode/src/server.ts @@ -20,7 +20,7 @@ import {TextDocument} from 'vscode-languageserver-textdocument'; const excludedTokenGroupNames = [] as const; -type ExcludedTokenGroupName = typeof excludedTokenGroupNames[number]; +type ExcludedTokenGroupName = (typeof excludedTokenGroupNames)[number]; type TokenGroupName = Exclude; diff --git a/polaris-icons/tests/validate-svg-content.test.js b/polaris-icons/tests/validate-svg-content.test.js index e6311d09a7f..442103661ac 100644 --- a/polaris-icons/tests/validate-svg-content.test.js +++ b/polaris-icons/tests/validate-svg-content.test.js @@ -1,7 +1,6 @@ const fs = require('fs'); const path = require('path'); -// eslint-disable-next-line import/no-extraneous-dependencies const svgo = require('svgo'); const globby = require('globby'); const unified = require('unified'); diff --git a/polaris-react/postcss-mixins/no-focus-ring.css b/polaris-react/postcss-mixins/no-focus-ring.css index aed4070fe38..2e4fdb944b3 100644 --- a/polaris-react/postcss-mixins/no-focus-ring.css +++ b/polaris-react/postcss-mixins/no-focus-ring.css @@ -2,4 +2,4 @@ &::after { content: none; } -} ; +} diff --git a/polaris-react/src/components/Avatar/Avatar.stories.tsx b/polaris-react/src/components/Avatar/Avatar.stories.tsx index 9061a501e2b..d2d3b255fcc 100644 --- a/polaris-react/src/components/Avatar/Avatar.stories.tsx +++ b/polaris-react/src/components/Avatar/Avatar.stories.tsx @@ -28,7 +28,7 @@ const sizes: NonNullable[] = [ 'xs', ]; -type Style = typeof STYLE_CLASSES[number]; +type Style = (typeof STYLE_CLASSES)[number]; const styleInitialsDefault: { [S in Style]: string; diff --git a/polaris-react/src/components/ThemeProvider/ThemeProvider.tsx b/polaris-react/src/components/ThemeProvider/ThemeProvider.tsx index 2284b403942..ddfc0bb3cc5 100644 --- a/polaris-react/src/components/ThemeProvider/ThemeProvider.tsx +++ b/polaris-react/src/components/ThemeProvider/ThemeProvider.tsx @@ -16,7 +16,7 @@ import styles from './ThemeProvider.module.css'; */ export const themeNamesLocal = ['light', 'dark-experimental'] as const; -type ThemeNameLocal = typeof themeNamesLocal[number]; +type ThemeNameLocal = (typeof themeNamesLocal)[number]; export const isThemeNameLocal = (name: string): name is ThemeNameLocal => themeNamesLocal.includes(name as any); diff --git a/polaris-react/src/utilities/tests/use-index-resource-state.test.tsx b/polaris-react/src/utilities/tests/use-index-resource-state.test.tsx index fd25d7847c1..bbfdaba3993 100644 --- a/polaris-react/src/utilities/tests/use-index-resource-state.test.tsx +++ b/polaris-react/src/utilities/tests/use-index-resource-state.test.tsx @@ -187,7 +187,7 @@ describe('useIndexResourceState', () => { it('accepts a custom resource filter', () => { const selectedID = '1'; const resources = [{id: selectedID}, {id: '2'}]; - const customResoureFilter = (item: typeof resources[0]) => { + const customResoureFilter = (item: (typeof resources)[0]) => { return item.id === selectedID; }; const mockComponent = mountWithApp( @@ -293,7 +293,7 @@ describe('useIndexResourceState', () => { const idOne = '1'; const idTwo = '2'; const resources = [{id: idOne}, {id: idTwo}]; - const customResoureFilter = (item: typeof resources[0]) => { + const customResoureFilter = (item: (typeof resources)[0]) => { return item.id === idOne; }; const mockComponent = mountWithApp( @@ -357,7 +357,7 @@ describe('useIndexResourceState', () => { const idOne = '1'; const idTwo = '2'; const resources = [{id: idOne}, {id: idTwo}]; - const customResoureFilter = (item: typeof resources[0]) => { + const customResoureFilter = (item: (typeof resources)[0]) => { return item.id === idOne; }; const mockComponent = mountWithApp( @@ -422,7 +422,7 @@ describe('useIndexResourceState', () => { const idTwo = '2'; const idThree = '3'; const resources = [{id: idOne}, {id: idTwo}, {id: idThree}]; - const customResoureFilter = (item: typeof resources[0]) => { + const customResoureFilter = (item: (typeof resources)[0]) => { return item.id === idOne; }; const mockComponent = mountWithApp( @@ -504,7 +504,7 @@ describe('useIndexResourceState', () => { const idTwo = '2'; const idThree = '3'; const resources = [{id: idOne}, {id: idTwo}, {id: idThree}]; - const customResoureFilter = (item: typeof resources[0]) => { + const customResoureFilter = (item: (typeof resources)[0]) => { return item.id !== idOne; }; const mockComponent = mountWithApp( diff --git a/polaris-tokens/src/themes/base/breakpoints.ts b/polaris-tokens/src/themes/base/breakpoints.ts index 4dd3b2d96d8..7974796a920 100644 --- a/polaris-tokens/src/themes/base/breakpoints.ts +++ b/polaris-tokens/src/themes/base/breakpoints.ts @@ -5,7 +5,7 @@ import type {MetaTokenProperties} from '../types'; export const breakpointsAliases = ['xs', 'sm', 'md', 'lg', 'xl'] as const; // Convert the Tuple to a union -export type BreakpointsAlias = typeof breakpointsAliases[number]; +export type BreakpointsAlias = (typeof breakpointsAliases)[number]; export type BreakpointsTokenName = `breakpoints-${BreakpointsAlias}`; diff --git a/polaris-tokens/src/themes/types.ts b/polaris-tokens/src/themes/types.ts index 1a96ca1b823..08bb81d5847 100644 --- a/polaris-tokens/src/themes/types.ts +++ b/polaris-tokens/src/themes/types.ts @@ -4,7 +4,7 @@ import type {themeNames} from './constants'; export type MetaThemeBase = typeof metaThemeBase; export type MetaTheme = MetaThemeBase; -export type ThemeName = typeof themeNames[number]; +export type ThemeName = (typeof themeNames)[number]; export type ThemeBase = ExtractMetaThemeValues; export type Theme = ExtractMetaThemeValues;