Skip to content

Commit

Permalink
Fix lint formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanwilsonperkin committed Apr 2, 2024
1 parent f630899 commit 48e3341
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 12 deletions.
2 changes: 1 addition & 1 deletion polaris-for-vscode/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<keyof MetaTheme, ExcludedTokenGroupName>;

Expand Down
1 change: 0 additions & 1 deletion polaris-icons/tests/validate-svg-content.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
const fs = require('fs');
const path = require('path');

// eslint-disable-next-line import/no-extraneous-dependencies
const svgo = require('svgo');

Check failure on line 4 in polaris-icons/tests/validate-svg-content.test.js

View workflow job for this annotation

GitHub Actions / Lint & type check

'svgo' should be listed in the project's dependencies. Run 'npm i -S svgo' to add it
const globby = require('globby');
const unified = require('unified');
Expand Down
2 changes: 1 addition & 1 deletion polaris-react/postcss-mixins/no-focus-ring.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
&::after {
content: none;
}
} ;
}
2 changes: 1 addition & 1 deletion polaris-react/src/components/Avatar/Avatar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const sizes: NonNullable<AvatarProps['size']>[] = [
'xs',
];

type Style = typeof STYLE_CLASSES[number];
type Style = (typeof STYLE_CLASSES)[number];

const styleInitialsDefault: {
[S in Style]: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion polaris-tokens/src/themes/base/breakpoints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;

Expand Down
2 changes: 1 addition & 1 deletion polaris-tokens/src/themes/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<MetaThemeBase>;
export type Theme = ExtractMetaThemeValues<MetaTheme>;

Expand Down

0 comments on commit 48e3341

Please sign in to comment.