diff --git a/.changeset/blue-readers-decide.md b/.changeset/blue-readers-decide.md new file mode 100644 index 0000000000..2b47498996 --- /dev/null +++ b/.changeset/blue-readers-decide.md @@ -0,0 +1,5 @@ +--- +"@justeattakeaway/eslint-config-pie": minor +--- + +[Added] - `@typescript-eslint/consistent-type-imports` rule diff --git a/.changeset/heavy-phones-talk.md b/.changeset/heavy-phones-talk.md new file mode 100644 index 0000000000..039ac1870e --- /dev/null +++ b/.changeset/heavy-phones-talk.md @@ -0,0 +1,27 @@ +--- +"@justeattakeaway/generator-pie-component": patch +"@justeattakeaway/pie-assistive-text": patch +"@justeattakeaway/pie-button": patch +"@justeattakeaway/pie-card": patch +"@justeattakeaway/pie-checkbox": patch +"@justeattakeaway/pie-checkbox-group": patch +"@justeattakeaway/pie-chip": patch +"@justeattakeaway/pie-css": patch +"@justeattakeaway/pie-form-label": patch +"@justeattakeaway/pie-icon-button": patch +"@justeattakeaway/pie-icons-react": patch +"@justeattakeaway/pie-lottie-player": patch +"@justeattakeaway/pie-modal": patch +"@justeattakeaway/pie-notification": patch +"@justeattakeaway/pie-switch": patch +"@justeattakeaway/pie-textarea": patch +"@justeattakeaway/pie-toast": patch +"@justeattakeaway/pie-webc-core": patch +"@justeattakeaway/pie-webc-testing": patch +"@justeattakeaway/pie-wrapper-react": patch +"pie-docs": patch +"pie-storybook": patch +--- + +[Fixed] - Imports to align with new linting rule +[Removed] - Empty lines at the start of some files diff --git a/apps/examples/wc-next10/package.json b/apps/examples/wc-next10/package.json index df78f92f6c..707a5828eb 100644 --- a/apps/examples/wc-next10/package.json +++ b/apps/examples/wc-next10/package.json @@ -24,7 +24,7 @@ "@babel/preset-env": "7.24.5", "@babel/preset-react": "7.24.1", "babel-loader": "8", - "eslint": "8.37.0", + "eslint": "8.57.0", "eslint-config-next": "13.2.4" }, "engines": { diff --git a/apps/examples/wc-vue3/tsconfig.json b/apps/examples/wc-vue3/tsconfig.json index 67fd783b1e..ac92bf4b9a 100644 --- a/apps/examples/wc-vue3/tsconfig.json +++ b/apps/examples/wc-vue3/tsconfig.json @@ -4,7 +4,11 @@ "compilerOptions": { "allowJs": true, // allow JavaScript files to be imported "baseUrl": ".", - "ignoreDeprecations": "5.0", + // workaround for https://github.com/vuejs/tsconfig/issues/6 + "preserveValueImports": false, + "importsNotUsedAsValues": "remove", + "verbatimModuleSyntax": true, + // end workaround "paths": { "@/*": ["./src/*"] } diff --git a/apps/pie-docs/src/_11ty/shortcodes/componentStatusTable.js b/apps/pie-docs/src/_11ty/shortcodes/componentStatusTable.js index b90554af75..17e2823c30 100644 --- a/apps/pie-docs/src/_11ty/shortcodes/componentStatusTable.js +++ b/apps/pie-docs/src/_11ty/shortcodes/componentStatusTable.js @@ -13,9 +13,7 @@ const buildRow = (cells, headings) => cells.map((cell) => { headings.map((heading) => { if ('componentName' in cell) { content = `${cell.componentName}`; - } else - - if (heading.title === cell.resource) { + } else if (heading.title === cell.resource) { const { bgColor, status } = statusSettings[cell.status]; content = `${status}`; } diff --git a/apps/pie-storybook/data/tag-variants-to-statuses-map.ts b/apps/pie-storybook/data/tag-variants-to-statuses-map.ts index f74e1059ed..13ff8f6892 100644 --- a/apps/pie-storybook/data/tag-variants-to-statuses-map.ts +++ b/apps/pie-storybook/data/tag-variants-to-statuses-map.ts @@ -1,4 +1,4 @@ -import { TagVariantToStatusMap } from '../interfaces/tag-variant-to-status-map'; +import { type TagVariantToStatusMap } from '../interfaces/tag-variant-to-status-map'; export const tagVariantToStatusMap: TagVariantToStatusMap = { alpha: 'yellow', diff --git a/apps/pie-storybook/decorators/component-status.ts b/apps/pie-storybook/decorators/component-status.ts index ba32858b3c..83e4e5172a 100644 --- a/apps/pie-storybook/decorators/component-status.ts +++ b/apps/pie-storybook/decorators/component-status.ts @@ -1,9 +1,9 @@ -import { TemplateResult, html } from 'lit'; +import { type TemplateResult, html } from 'lit'; import '@justeattakeaway/pie-tag'; import '@justeattakeaway/pie-icons-webc/dist/IconHelpCircle.js'; import componentStatusesJson from '../component-statuses.json'; -import { StorybookContext } from '../interfaces/storybook-context'; -import { ComponentStatuses } from '../interfaces/component-status'; +import { type StorybookContext } from '../interfaces/storybook-context'; +import { type ComponentStatuses } from '../interfaces/component-status'; import { tagVariantToStatusMap } from '../data/tag-variants-to-statuses-map'; const componentStatuses: ComponentStatuses = componentStatusesJson; diff --git a/apps/pie-storybook/decorators/writing-direction.ts b/apps/pie-storybook/decorators/writing-direction.ts index cf2701e117..85df7f9aff 100644 --- a/apps/pie-storybook/decorators/writing-direction.ts +++ b/apps/pie-storybook/decorators/writing-direction.ts @@ -1,5 +1,5 @@ -import { TemplateResult } from 'lit'; -import { StorybookContext } from '../interfaces/storybook-context'; +import { type TemplateResult } from 'lit'; +import { type StorybookContext } from '../interfaces/storybook-context'; export const WritingDirection = (story: () => TemplateResult, storybookContext: StorybookContext) => { const { globals } = storybookContext; diff --git a/apps/pie-storybook/stories/pie-checkbox-group.stories.ts b/apps/pie-storybook/stories/pie-checkbox-group.stories.ts index 011348164b..d304166da5 100644 --- a/apps/pie-storybook/stories/pie-checkbox-group.stories.ts +++ b/apps/pie-storybook/stories/pie-checkbox-group.stories.ts @@ -3,7 +3,7 @@ import { ifDefined } from 'lit/directives/if-defined.js'; import { type Meta } from '@storybook/web-components'; import '@justeattakeaway/pie-checkbox-group'; -import { type CheckboxGroupProps as CheckboxGroupBase, defaultProps, statusTypes } from '@justeattakeaway/pie-checkbox-group'; +import { type CheckboxGroupProps as CheckboxGroupPropsBase, defaultProps, statusTypes } from '@justeattakeaway/pie-checkbox-group'; import '@justeattakeaway/pie-link'; import '@justeattakeaway/pie-checkbox'; import '@justeattakeaway/pie-form-label'; @@ -11,7 +11,7 @@ import '@justeattakeaway/pie-form-label'; import { createStory } from '../utilities'; // Extending the props type definition to include storybook specific properties for controls -type CheckboxGroupProps = CheckboxGroupBase & { +type CheckboxGroupProps = CheckboxGroupPropsBase & { labelSlot: keyof typeof labelSlotOptions; }; diff --git a/apps/pie-storybook/stories/pie-form-label.stories.ts b/apps/pie-storybook/stories/pie-form-label.stories.ts index 0a2bbc2534..295e68b285 100644 --- a/apps/pie-storybook/stories/pie-form-label.stories.ts +++ b/apps/pie-storybook/stories/pie-form-label.stories.ts @@ -65,7 +65,7 @@ const Template: TemplateFunction = ({ ...props }) => html` ${sanitizeAndRenderHTML(slot)} diff --git a/apps/pie-storybook/stories/pie-lottie-player.stories.ts b/apps/pie-storybook/stories/pie-lottie-player.stories.ts index d134397bd7..bbbecb3656 100644 --- a/apps/pie-storybook/stories/pie-lottie-player.stories.ts +++ b/apps/pie-storybook/stories/pie-lottie-player.stories.ts @@ -3,7 +3,7 @@ import { type Meta } from '@storybook/web-components'; import '@justeattakeaway/pie-lottie-player'; import { - type LottiePlayerProps as LottiePlayerBaseProps, PieLottiePlayer, defaultProps, directions, + type LottiePlayerProps as LottiePlayerBaseProps, type PieLottiePlayer, defaultProps, directions, } from '@justeattakeaway/pie-lottie-player'; import { createStory } from '../utilities'; diff --git a/apps/pie-storybook/utilities/index.ts b/apps/pie-storybook/utilities/index.ts index ef687b7fd7..e535a868d2 100644 --- a/apps/pie-storybook/utilities/index.ts +++ b/apps/pie-storybook/utilities/index.ts @@ -1,7 +1,7 @@ -import { TemplateResult } from 'lit'; +import { type TemplateResult } from 'lit'; import DOMPurify from 'dompurify'; import { unsafeHTML } from 'lit/directives/unsafe-html.js'; -import { StoryOptions } from '../types/StoryOptions'; +import { type StoryOptions } from '../types/StoryOptions'; export type TemplateFunction = (props: T) => TemplateResult; diff --git a/package.json b/package.json index d6cb64d964..18ca0dce66 100644 --- a/package.json +++ b/package.json @@ -99,7 +99,7 @@ "cz-customizable": "7.2.1", "danger": "11.3.0", "dree": "3.4.5", - "eslint": "8.37.0", + "eslint": "8.57.0", "eslint-plugin-import": "2.27.5", "eslint-plugin-json-format": "2.0.1", "eslint-plugin-vitest": "0.3.22", diff --git a/packages/components/pie-assistive-text/src/defs-react.ts b/packages/components/pie-assistive-text/src/defs-react.ts index 97258f7d24..2714b9afa2 100644 --- a/packages/components/pie-assistive-text/src/defs-react.ts +++ b/packages/components/pie-assistive-text/src/defs-react.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import type React from 'react'; /** * TODO: Verify if ReactBaseType can be set as a more specific React interface * Use the React IntrinsicElements interface to find how to map standard HTML elements to existing React Interfaces diff --git a/packages/components/pie-assistive-text/src/index.ts b/packages/components/pie-assistive-text/src/index.ts index 28d0595e06..da3b09c034 100644 --- a/packages/components/pie-assistive-text/src/index.ts +++ b/packages/components/pie-assistive-text/src/index.ts @@ -1,5 +1,5 @@ import { - LitElement, html, unsafeCSS, nothing, TemplateResult, + LitElement, html, unsafeCSS, nothing, type TemplateResult, } from 'lit'; import { property } from 'lit/decorators.js'; @@ -9,7 +9,7 @@ import '@justeattakeaway/pie-icons-webc/dist/IconAlertCircle.js'; import '@justeattakeaway/pie-icons-webc/dist/IconCheckCircle.js'; import styles from './assistive-text.scss?inline'; -import { AssistiveTextProps, variants, defaultProps } from './defs'; +import { type AssistiveTextProps, variants, defaultProps } from './defs'; // Valid values available to consumers export * from './defs'; diff --git a/packages/components/pie-assistive-text/test/accessibility/pie-assistive-text.spec.ts b/packages/components/pie-assistive-text/test/accessibility/pie-assistive-text.spec.ts index 435bc12821..00e863e283 100644 --- a/packages/components/pie-assistive-text/test/accessibility/pie-assistive-text.spec.ts +++ b/packages/components/pie-assistive-text/test/accessibility/pie-assistive-text.spec.ts @@ -1,5 +1,5 @@ import { test, expect } from '@justeattakeaway/pie-webc-testing/src/playwright/webc-fixtures.ts'; -import { PieAssistiveText, AssistiveTextProps } from '../../src/index.ts'; +import { PieAssistiveText, type AssistiveTextProps } from '../../src/index.ts'; import { variants } from '../../src/defs.ts'; test.describe('PieAssistiveText - Accessibility tests', () => { diff --git a/packages/components/pie-button/src/defs-react.ts b/packages/components/pie-button/src/defs-react.ts index 19e2118376..ff16599649 100644 --- a/packages/components/pie-button/src/defs-react.ts +++ b/packages/components/pie-button/src/defs-react.ts @@ -1,3 +1,3 @@ -import React from 'react'; +import type React from 'react'; export type ReactBaseType = React.ButtonHTMLAttributes diff --git a/packages/components/pie-button/test/visual/pie-button.spec.ts b/packages/components/pie-button/test/visual/pie-button.spec.ts index 87a9077604..6b837bb453 100644 --- a/packages/components/pie-button/test/visual/pie-button.spec.ts +++ b/packages/components/pie-button/test/visual/pie-button.spec.ts @@ -1,7 +1,7 @@ import { test } from '@sand4rt/experimental-ct-web'; import percySnapshot from '@percy/playwright'; import { - type PropObject, WebComponentPropValues, WebComponentTestInput, + type PropObject, type WebComponentPropValues, type WebComponentTestInput, } from '@justeattakeaway/pie-webc-testing/src/helpers/defs.ts'; import { getAllPropCombinations, splitCombinationsByPropertyValue, diff --git a/packages/components/pie-card/src/defs-react.ts b/packages/components/pie-card/src/defs-react.ts index f44318b24b..4a387f4797 100644 --- a/packages/components/pie-card/src/defs-react.ts +++ b/packages/components/pie-card/src/defs-react.ts @@ -1,3 +1,3 @@ -import React from 'react'; +import type React from 'react'; export type ReactBaseType = React.AnchorHTMLAttributes & React.ButtonHTMLAttributes diff --git a/packages/components/pie-card/src/index.ts b/packages/components/pie-card/src/index.ts index 99fa387745..a4a5493af6 100644 --- a/packages/components/pie-card/src/index.ts +++ b/packages/components/pie-card/src/index.ts @@ -1,5 +1,5 @@ import { - html, LitElement, unsafeCSS, nothing, TemplateResult, type PropertyValues, + html, LitElement, unsafeCSS, nothing, type TemplateResult, type PropertyValues, } from 'lit'; import { classMap, type ClassInfo } from 'lit/directives/class-map.js'; import { ifDefined } from 'lit/directives/if-defined.js'; @@ -9,7 +9,7 @@ import styles from './card.scss?inline'; import { variants, tags, - CardProps, + type CardProps, defaultProps, paddingValues, } from './defs'; diff --git a/packages/components/pie-card/test/accessibility/pie-card.spec.ts b/packages/components/pie-card/test/accessibility/pie-card.spec.ts index ba975bb8f8..515a38c6a9 100644 --- a/packages/components/pie-card/test/accessibility/pie-card.spec.ts +++ b/packages/components/pie-card/test/accessibility/pie-card.spec.ts @@ -1,6 +1,5 @@ - import { test, expect } from '@justeattakeaway/pie-webc-testing/src/playwright/webc-fixtures.ts'; -import { PieCard, CardProps } from '../../src/index.ts'; +import { PieCard, type CardProps } from '../../src/index.ts'; import { tags } from '../../src/defs.ts'; test.describe('PieCard - Accessibility tests', () => { diff --git a/packages/components/pie-card/test/component/pie-card.spec.ts b/packages/components/pie-card/test/component/pie-card.spec.ts index 6f214fcdf0..65ee22f1fd 100644 --- a/packages/components/pie-card/test/component/pie-card.spec.ts +++ b/packages/components/pie-card/test/component/pie-card.spec.ts @@ -1,6 +1,5 @@ - import { test, expect } from '@sand4rt/experimental-ct-web'; -import { PieCard, CardProps } from '../../src/index.ts'; +import { PieCard, type CardProps } from '../../src/index.ts'; import { tags, paddingValues } from '../../src/defs.ts'; const componentSelector = '[data-test-id="pie-card"]'; diff --git a/packages/components/pie-checkbox-group/src/defs-react.ts b/packages/components/pie-checkbox-group/src/defs-react.ts index 3f39c4cc6b..dda858c02f 100644 --- a/packages/components/pie-checkbox-group/src/defs-react.ts +++ b/packages/components/pie-checkbox-group/src/defs-react.ts @@ -1,3 +1,3 @@ -import React from 'react'; +import type React from 'react'; export type ReactBaseType = React.FieldsetHTMLAttributes diff --git a/packages/components/pie-checkbox-group/src/index.ts b/packages/components/pie-checkbox-group/src/index.ts index 307807559f..cb392fc8f4 100644 --- a/packages/components/pie-checkbox-group/src/index.ts +++ b/packages/components/pie-checkbox-group/src/index.ts @@ -1,5 +1,5 @@ import { - LitElement, html, unsafeCSS, PropertyValues, nothing, type TemplateResult, + LitElement, html, unsafeCSS, type PropertyValues, type nothing, type TemplateResult, } from 'lit'; import { property, queryAssignedElements, state } from 'lit/decorators.js'; import { @@ -14,7 +14,7 @@ import styles from './checkbox-group.scss?inline'; import { ON_CHECKBOX_GROUP_DISABLED, ON_CHECKBOX_GROUP_ERROR, - CheckboxGroupProps, + type CheckboxGroupProps, defaultProps, statusTypes, } from './defs'; diff --git a/packages/components/pie-checkbox-group/test/accessibility/pie-checkbox-group.spec.ts b/packages/components/pie-checkbox-group/test/accessibility/pie-checkbox-group.spec.ts index 6ba0f358f2..c49de2e67b 100644 --- a/packages/components/pie-checkbox-group/test/accessibility/pie-checkbox-group.spec.ts +++ b/packages/components/pie-checkbox-group/test/accessibility/pie-checkbox-group.spec.ts @@ -1,6 +1,5 @@ - import { test, expect } from '@justeattakeaway/pie-webc-testing/src/playwright/webc-fixtures.ts'; -import { PieCheckboxGroup, CheckboxGroupProps } from '../../src/index.ts'; +import { PieCheckboxGroup, type CheckboxGroupProps } from '../../src/index.ts'; test.describe('PieCheckboxGroup - Accessibility tests', () => { test('a11y - should test the PieCheckboxGroup component WCAG compliance', async ({ makeAxeBuilder, mount }) => { diff --git a/packages/components/pie-checkbox-group/test/component/pie-checkbox-group.spec.ts b/packages/components/pie-checkbox-group/test/component/pie-checkbox-group.spec.ts index f7572a06dd..e7ebed3e3e 100644 --- a/packages/components/pie-checkbox-group/test/component/pie-checkbox-group.spec.ts +++ b/packages/components/pie-checkbox-group/test/component/pie-checkbox-group.spec.ts @@ -1,8 +1,7 @@ - import { test, expect } from '@sand4rt/experimental-ct-web'; import { PieAssistiveText } from '@justeattakeaway/pie-assistive-text'; import { PieCheckbox } from '@justeattakeaway/pie-checkbox'; -import { PieCheckboxGroup, CheckboxGroupProps } from '../../src/index.ts'; +import { PieCheckboxGroup, type CheckboxGroupProps } from '../../src/index.ts'; import { statusTypes } from '../../src/defs.ts'; const componentSelector = '[data-test-id="pie-checkbox-group"]'; diff --git a/packages/components/pie-checkbox-group/test/visual/pie-checkbox-group.spec.ts b/packages/components/pie-checkbox-group/test/visual/pie-checkbox-group.spec.ts index 37c8cc6e02..49ef36cc35 100644 --- a/packages/components/pie-checkbox-group/test/visual/pie-checkbox-group.spec.ts +++ b/packages/components/pie-checkbox-group/test/visual/pie-checkbox-group.spec.ts @@ -1,8 +1,7 @@ - import { test } from '@sand4rt/experimental-ct-web'; import percySnapshot from '@percy/playwright'; -import type { - PropObject, WebComponentPropValues, WebComponentTestInput, +import { + type PropObject, type WebComponentPropValues, type WebComponentTestInput, } from '@justeattakeaway/pie-webc-testing/src/helpers/defs.ts'; import { getAllPropCombinations, splitCombinationsByPropertyValue, diff --git a/packages/components/pie-checkbox/src/defs-react.ts b/packages/components/pie-checkbox/src/defs-react.ts index 2cbcb3a6d7..f4a0d157f6 100644 --- a/packages/components/pie-checkbox/src/defs-react.ts +++ b/packages/components/pie-checkbox/src/defs-react.ts @@ -1,3 +1,3 @@ -import React from 'react'; +import type React from 'react'; export type ReactBaseType = React.InputHTMLAttributes diff --git a/packages/components/pie-checkbox/src/index.ts b/packages/components/pie-checkbox/src/index.ts index e90427e504..3e43bd2546 100644 --- a/packages/components/pie-checkbox/src/index.ts +++ b/packages/components/pie-checkbox/src/index.ts @@ -16,7 +16,7 @@ import { import '@justeattakeaway/pie-assistive-text'; import styles from './checkbox.scss?inline'; -import { CheckboxProps, defaultProps, statusTypes } from './defs'; +import { type CheckboxProps, defaultProps, statusTypes } from './defs'; // Valid values available to consumers export * from './defs'; diff --git a/packages/components/pie-checkbox/test/visual/pie-checkbox.spec.ts b/packages/components/pie-checkbox/test/visual/pie-checkbox.spec.ts index 31fe4c3916..c871a26604 100644 --- a/packages/components/pie-checkbox/test/visual/pie-checkbox.spec.ts +++ b/packages/components/pie-checkbox/test/visual/pie-checkbox.spec.ts @@ -1,7 +1,7 @@ import { test } from '@sand4rt/experimental-ct-web'; import percySnapshot from '@percy/playwright'; -import type { - PropObject, WebComponentPropValues, WebComponentTestInput, +import { + type PropObject, type WebComponentPropValues, type WebComponentTestInput, } from '@justeattakeaway/pie-webc-testing/src/helpers/defs.ts'; import { getAllPropCombinations, splitCombinationsByPropertyValue, @@ -18,11 +18,11 @@ import { setRTL } from '@justeattakeaway/pie-webc-testing/src/helpers/set-rtl-di import { PieAssistiveText } from '@justeattakeaway/pie-assistive-text'; import { PieCheckbox } from '../../src/index.ts'; -import { statusTypes } from '../../src/defs.ts'; +import { type CheckboxProps, statusTypes } from '../../src/defs.ts'; const readingDirections = ['LTR', 'RTL']; -const props: PropObject = { +const props: PropObject = { status: statusTypes, checked: [true, false], disabled: [true, false], diff --git a/packages/components/pie-chip/src/defs-react.ts b/packages/components/pie-chip/src/defs-react.ts index 97258f7d24..2714b9afa2 100644 --- a/packages/components/pie-chip/src/defs-react.ts +++ b/packages/components/pie-chip/src/defs-react.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import type React from 'react'; /** * TODO: Verify if ReactBaseType can be set as a more specific React interface * Use the React IntrinsicElements interface to find how to map standard HTML elements to existing React Interfaces diff --git a/packages/components/pie-chip/src/index.ts b/packages/components/pie-chip/src/index.ts index 76fc4b0458..5c6ef9aea9 100644 --- a/packages/components/pie-chip/src/index.ts +++ b/packages/components/pie-chip/src/index.ts @@ -1,5 +1,5 @@ import { - LitElement, html, unsafeCSS, TemplateResult, nothing, + LitElement, html, unsafeCSS, type TemplateResult, nothing, } from 'lit'; import { property } from 'lit/decorators.js'; import { ifDefined } from 'lit/directives/if-defined.js'; @@ -10,7 +10,7 @@ import { } from '@justeattakeaway/pie-webc-core'; import styles from './chip.scss?inline'; import { - ChipProps, variants, ON_CHIP_CLOSE_EVENT, defaultProps, + type ChipProps, variants, ON_CHIP_CLOSE_EVENT, defaultProps, } from './defs'; import '@justeattakeaway/pie-icons-webc/dist/IconCloseCircleFilled.js'; import '@justeattakeaway/pie-spinner'; diff --git a/packages/components/pie-chip/test/accessibility/pie-chip.spec.ts b/packages/components/pie-chip/test/accessibility/pie-chip.spec.ts index 71bdd5f129..cfa86b036a 100644 --- a/packages/components/pie-chip/test/accessibility/pie-chip.spec.ts +++ b/packages/components/pie-chip/test/accessibility/pie-chip.spec.ts @@ -1,6 +1,5 @@ - import { test, expect } from '@justeattakeaway/pie-webc-testing/src/playwright/webc-fixtures.ts'; -import { PieChip, ChipProps } from '../../src/index.ts'; +import { PieChip, type ChipProps } from '../../src/index.ts'; test.describe('PieChip - Accessibility tests', () => { test('a11y - should test the PieChip component WCAG compliance', async ({ makeAxeBuilder, mount }) => { diff --git a/packages/components/pie-chip/test/component/pie-chip.spec.ts b/packages/components/pie-chip/test/component/pie-chip.spec.ts index 91c58e1687..2911f7c646 100644 --- a/packages/components/pie-chip/test/component/pie-chip.spec.ts +++ b/packages/components/pie-chip/test/component/pie-chip.spec.ts @@ -1,6 +1,5 @@ - import { test, expect } from '@sand4rt/experimental-ct-web'; -import { PieChip, ChipProps } from '../../src/index.ts'; +import { PieChip, type ChipProps } from '../../src/index.ts'; import { ON_CHIP_CLOSE_EVENT } from '../../src/defs.ts'; const componentSelector = '[data-test-id="pie-chip"]'; diff --git a/packages/components/pie-cookie-banner/test/helpers/page-object/pie-cookie-banner.page.ts b/packages/components/pie-cookie-banner/test/helpers/page-object/pie-cookie-banner.page.ts index 472407b180..50fa367a71 100644 --- a/packages/components/pie-cookie-banner/test/helpers/page-object/pie-cookie-banner.page.ts +++ b/packages/components/pie-cookie-banner/test/helpers/page-object/pie-cookie-banner.page.ts @@ -1,6 +1,5 @@ import { type Locator, type Page } from '@playwright/test'; import { BasePage } from '@justeattakeaway/pie-webc-testing/src/helpers/page-object/base-page.ts'; - import { cookieBanner } from './selectors.ts'; import { type PreferenceIds } from '../../../src/defs.ts'; diff --git a/packages/components/pie-divider/test/accessibility/pie-divider.spec.ts b/packages/components/pie-divider/test/accessibility/pie-divider.spec.ts index 9aa4d50550..be8bab5fad 100644 --- a/packages/components/pie-divider/test/accessibility/pie-divider.spec.ts +++ b/packages/components/pie-divider/test/accessibility/pie-divider.spec.ts @@ -1,4 +1,3 @@ - import { test, expect } from '@justeattakeaway/pie-webc-testing/src/playwright/webc-fixtures.ts'; import { PieDivider } from '../../src/index.ts'; diff --git a/packages/components/pie-divider/test/component/pie-divider.spec.ts b/packages/components/pie-divider/test/component/pie-divider.spec.ts index 3882e21d45..d294f1454d 100644 --- a/packages/components/pie-divider/test/component/pie-divider.spec.ts +++ b/packages/components/pie-divider/test/component/pie-divider.spec.ts @@ -1,4 +1,3 @@ - import { test, expect } from '@sand4rt/experimental-ct-web'; import { PieDivider, type DividerProps } from '../../src/index.ts'; @@ -48,4 +47,3 @@ test.describe('PieDivider - Component tests', () => { expect(label).not.toBeVisible(); }); }); - diff --git a/packages/components/pie-divider/test/visual/pie-divider.spec.ts b/packages/components/pie-divider/test/visual/pie-divider.spec.ts index 197e8a5ee1..3afff5cef4 100644 --- a/packages/components/pie-divider/test/visual/pie-divider.spec.ts +++ b/packages/components/pie-divider/test/visual/pie-divider.spec.ts @@ -1,4 +1,3 @@ - import { test } from '@sand4rt/experimental-ct-web'; import percySnapshot from '@percy/playwright'; import { diff --git a/packages/components/pie-form-label/src/defs-react.ts b/packages/components/pie-form-label/src/defs-react.ts index 1ee7736e03..71af56ea6e 100644 --- a/packages/components/pie-form-label/src/defs-react.ts +++ b/packages/components/pie-form-label/src/defs-react.ts @@ -1,3 +1,3 @@ -import React from 'react'; +import type React from 'react'; export type ReactBaseType = React.LabelHTMLAttributes diff --git a/packages/components/pie-form-label/src/index.ts b/packages/components/pie-form-label/src/index.ts index 4bfc5ef527..b3a1ac2d8e 100644 --- a/packages/components/pie-form-label/src/index.ts +++ b/packages/components/pie-form-label/src/index.ts @@ -1,11 +1,11 @@ import { - LitElement, TemplateResult, html, nothing, unsafeCSS, + LitElement, type TemplateResult, html, nothing, unsafeCSS, } from 'lit'; import { ifDefined } from 'lit/directives/if-defined.js'; -import { RtlMixin, defineCustomElement, PIEInputElement } from '@justeattakeaway/pie-webc-core'; +import { RtlMixin, defineCustomElement, type PIEInputElement } from '@justeattakeaway/pie-webc-core'; import { property } from 'lit/decorators.js'; import styles from './form-label.scss?inline'; -import { FormLabelProps } from './defs'; +import { type FormLabelProps } from './defs'; // Valid values available to consumers export * from './defs'; diff --git a/packages/components/pie-form-label/test/accessibility/pie-form-label.spec.ts b/packages/components/pie-form-label/test/accessibility/pie-form-label.spec.ts index 2d629b8a27..039c7c10f1 100644 --- a/packages/components/pie-form-label/test/accessibility/pie-form-label.spec.ts +++ b/packages/components/pie-form-label/test/accessibility/pie-form-label.spec.ts @@ -1,6 +1,5 @@ - import { test, expect } from '@justeattakeaway/pie-webc-testing/src/playwright/webc-fixtures.ts'; -import { PieFormLabel, FormLabelProps } from '../../src/index.ts'; +import { PieFormLabel, type FormLabelProps } from '../../src/index.ts'; test.describe('PieFormLabel - Accessibility tests', () => { test('a11y - should test the PieFormLabel component WCAG compliance', async ({ makeAxeBuilder, mount }) => { diff --git a/packages/components/pie-form-label/test/component/pie-form-label.spec.ts b/packages/components/pie-form-label/test/component/pie-form-label.spec.ts index 54c2ed81ff..3d14436887 100644 --- a/packages/components/pie-form-label/test/component/pie-form-label.spec.ts +++ b/packages/components/pie-form-label/test/component/pie-form-label.spec.ts @@ -1,7 +1,7 @@ -import { test, expect, MountOptions } from '@sand4rt/experimental-ct-web'; +import { test, expect, type MountOptions } from '@sand4rt/experimental-ct-web'; import { PieTextInput } from '@justeattakeaway/pie-text-input'; import { PieSwitch } from '@justeattakeaway/pie-switch'; -import { PieFormLabel, FormLabelProps } from '../../src/index.ts'; +import { PieFormLabel, type FormLabelProps } from '../../src/index.ts'; const componentSelector = '[data-test-id="pie-form-label"]'; diff --git a/packages/components/pie-form-label/test/visual/pie-form-label.spec.ts b/packages/components/pie-form-label/test/visual/pie-form-label.spec.ts index b7bbd8d74e..59093e9cc9 100644 --- a/packages/components/pie-form-label/test/visual/pie-form-label.spec.ts +++ b/packages/components/pie-form-label/test/visual/pie-form-label.spec.ts @@ -1,4 +1,3 @@ - import { test } from '@sand4rt/experimental-ct-web'; import percySnapshot from '@percy/playwright'; import { percyWidths } from '@justeattakeaway/pie-webc-testing/src/percy/breakpoints.ts'; @@ -12,7 +11,7 @@ import { createTestWebComponent, } from '@justeattakeaway/pie-webc-testing/src/helpers/rendering.ts'; import { PieFormLabel } from '../../src/index.ts'; -import { FormLabelProps } from '../../src/defs.ts'; +import { type FormLabelProps } from '../../src/defs.ts'; const renderTestPieDivider = (propVals: WebComponentPropValues) => `Label`; diff --git a/packages/components/pie-icon-button/src/defs-react.ts b/packages/components/pie-icon-button/src/defs-react.ts index 19e2118376..ff16599649 100644 --- a/packages/components/pie-icon-button/src/defs-react.ts +++ b/packages/components/pie-icon-button/src/defs-react.ts @@ -1,3 +1,3 @@ -import React from 'react'; +import type React from 'react'; export type ReactBaseType = React.ButtonHTMLAttributes diff --git a/packages/components/pie-icon-button/src/index.ts b/packages/components/pie-icon-button/src/index.ts index c52b392a91..a71ea5c6b5 100644 --- a/packages/components/pie-icon-button/src/index.ts +++ b/packages/components/pie-icon-button/src/index.ts @@ -1,11 +1,11 @@ import { - LitElement, TemplateResult, html, unsafeCSS, + LitElement, html, unsafeCSS, } from 'lit'; import { property } from 'lit/decorators.js'; import { validPropertyValues, defineCustomElement } from '@justeattakeaway/pie-webc-core'; import styles from './iconButton.scss?inline'; import { - IconButtonProps, sizes, variants, defaultProps, + type IconButtonProps, sizes, variants, defaultProps, } from './defs'; import '@justeattakeaway/pie-spinner'; @@ -37,7 +37,7 @@ export class PieIconButton extends LitElement implements IconButtonProps { * * @private */ - private renderSpinner (): TemplateResult { + private renderSpinner () { const { variant, size, disabled } = this; const spinnerSize = size === 'xsmall' ? 'small' : 'medium'; let spinnerVariant = 'brand'; diff --git a/packages/components/pie-lottie-player/declaration.d.ts b/packages/components/pie-lottie-player/declaration.d.ts index c1932ceed6..0e4057bb47 100644 --- a/packages/components/pie-lottie-player/declaration.d.ts +++ b/packages/components/pie-lottie-player/declaration.d.ts @@ -1,4 +1,3 @@ - declare module '*.scss' { const content: Record; export default content; @@ -10,7 +9,7 @@ declare module '*.scss?inline' { } declare module 'lottie-web/build/player/lottie_light_canvas.min.js' { - import { LottiePlayer } from 'lottie-web'; + import { type LottiePlayer } from 'lottie-web'; const lottie: LottiePlayer; export default lottie; diff --git a/packages/components/pie-lottie-player/src/defs-react.ts b/packages/components/pie-lottie-player/src/defs-react.ts index f2a5d513eb..b5fe4ecfa0 100644 --- a/packages/components/pie-lottie-player/src/defs-react.ts +++ b/packages/components/pie-lottie-player/src/defs-react.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import type React from 'react'; /** * Use the React IntrinsicElements interface to find how to map standard HTML elements to existing React Interfaces diff --git a/packages/components/pie-lottie-player/src/index.ts b/packages/components/pie-lottie-player/src/index.ts index 82152f2cc1..9a72360caa 100644 --- a/packages/components/pie-lottie-player/src/index.ts +++ b/packages/components/pie-lottie-player/src/index.ts @@ -2,10 +2,10 @@ import { LitElement, html, isServer, unsafeCSS, } from 'lit'; import { property, query } from 'lit/decorators.js'; -import { LottiePlayer, AnimationItem } from 'lottie-web'; +import { type LottiePlayer, type AnimationItem } from 'lottie-web'; import { defineCustomElement } from '@justeattakeaway/pie-webc-core'; -import { LottiePlayerProps, defaultProps } from './defs'; +import { type LottiePlayerProps, defaultProps } from './defs'; // Valid values available to consumers export * from './defs'; diff --git a/packages/components/pie-lottie-player/test/accessibility/pie-lottie-player.spec.ts b/packages/components/pie-lottie-player/test/accessibility/pie-lottie-player.spec.ts index 555e83d9f4..63fc4bcd04 100644 --- a/packages/components/pie-lottie-player/test/accessibility/pie-lottie-player.spec.ts +++ b/packages/components/pie-lottie-player/test/accessibility/pie-lottie-player.spec.ts @@ -1,6 +1,6 @@ import { readFile } from 'fs/promises'; import { test, expect } from '@justeattakeaway/pie-webc-testing/src/playwright/webc-fixtures.ts'; -import { PieLottiePlayer, LottiePlayerProps } from '../../src/index.ts'; +import { PieLottiePlayer, type LottiePlayerProps } from '../../src/index.ts'; const animationData = JSON.parse(await readFile(new URL('../courier.json', import.meta.url), { encoding: 'utf-8' })); diff --git a/packages/components/pie-lottie-player/test/component/pie-lottie-player.spec.ts b/packages/components/pie-lottie-player/test/component/pie-lottie-player.spec.ts index 16b7c85335..bfbdf1008a 100644 --- a/packages/components/pie-lottie-player/test/component/pie-lottie-player.spec.ts +++ b/packages/components/pie-lottie-player/test/component/pie-lottie-player.spec.ts @@ -1,7 +1,6 @@ - import { readFile } from 'fs/promises'; import { test, expect } from '@sand4rt/experimental-ct-web'; -import { PieLottiePlayer, LottiePlayerProps } from '../../src/index.ts'; +import { PieLottiePlayer, type LottiePlayerProps } from '../../src/index.ts'; const animationData = JSON.parse(await readFile(new URL('../courier.json', import.meta.url), { encoding: 'utf-8' })); diff --git a/packages/components/pie-modal/src/defs-react.ts b/packages/components/pie-modal/src/defs-react.ts index c4ea8bb179..4cbb7074b1 100644 --- a/packages/components/pie-modal/src/defs-react.ts +++ b/packages/components/pie-modal/src/defs-react.ts @@ -1,3 +1,3 @@ -import React from 'react'; +import type React from 'react'; export type ReactBaseType = React.DialogHTMLAttributes diff --git a/packages/components/pie-modal/test/helpers/index.ts b/packages/components/pie-modal/test/helpers/index.ts index c48a655877..e8ae0c9d53 100644 --- a/packages/components/pie-modal/test/helpers/index.ts +++ b/packages/components/pie-modal/test/helpers/index.ts @@ -1,4 +1,4 @@ -import { ModalProps } from '../../src/defs.ts'; +import { type ModalProps } from '../../src/defs.ts'; // Renders a HTML string with the given prop values export const renderTestPieModal = ({ diff --git a/packages/components/pie-modal/test/visual/pie-modal.spec.ts b/packages/components/pie-modal/test/visual/pie-modal.spec.ts index 8279c054f2..a5f6abc1f7 100644 --- a/packages/components/pie-modal/test/visual/pie-modal.spec.ts +++ b/packages/components/pie-modal/test/visual/pie-modal.spec.ts @@ -2,7 +2,7 @@ import { test, expect } from '@sand4rt/experimental-ct-web'; import { percyWidths } from '@justeattakeaway/pie-webc-testing/src/percy/breakpoints.ts'; import percySnapshot from '@percy/playwright'; import { PieModal } from '../../src/index.ts'; -import { ModalProps, sizes, positions } from '../../src/defs.ts'; +import { type ModalProps, sizes, positions } from '../../src/defs.ts'; const componentSelector = '[data-test-id="pie-modal"]'; const componentFooterSelector = '[data-test-id="pie-modal-footer"]'; diff --git a/packages/components/pie-notification/src/defs-react.ts b/packages/components/pie-notification/src/defs-react.ts index 27b43e5caa..9eaa52f9c4 100644 --- a/packages/components/pie-notification/src/defs-react.ts +++ b/packages/components/pie-notification/src/defs-react.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import type React from 'react'; /** * TODO: Update the React base type as soon as the notification component markup is defined * Use the React IntrinsicElements interface to find how to map standard HTML elements to existing React Interfaces diff --git a/packages/components/pie-notification/test/accessibility/pie-notification.spec.ts b/packages/components/pie-notification/test/accessibility/pie-notification.spec.ts index 9308bc8f67..0176036f2f 100644 --- a/packages/components/pie-notification/test/accessibility/pie-notification.spec.ts +++ b/packages/components/pie-notification/test/accessibility/pie-notification.spec.ts @@ -1,6 +1,5 @@ - import { test, expect } from '@justeattakeaway/pie-webc-testing/src/playwright/webc-fixtures.ts'; -import { PieNotification, NotificationProps } from '../../src/index.ts'; +import { PieNotification, type NotificationProps } from '../../src/index.ts'; test.describe('PieNotification - Accessibility tests', () => { test('a11y - should test the PieNotification component WCAG compliance', async ({ makeAxeBuilder, mount }) => { diff --git a/packages/components/pie-notification/test/component/pie-notification.spec.ts b/packages/components/pie-notification/test/component/pie-notification.spec.ts index 298c5cb4f5..b3a0c919c3 100644 --- a/packages/components/pie-notification/test/component/pie-notification.spec.ts +++ b/packages/components/pie-notification/test/component/pie-notification.spec.ts @@ -1,11 +1,6 @@ - import { test, expect } from '@sand4rt/experimental-ct-web'; import { PieNotification } from '../../src/index.ts'; -import { - variants, - headingLevels, - type NotificationProps, -} from '../../src/defs.ts'; +import { type NotificationProps, headingLevels, variants } from '../../src/defs.ts'; const rootSelector = 'pie-notification'; const componentSelector = `[data-test-id="${rootSelector}"]`; @@ -161,7 +156,7 @@ test.describe('PieNotification - Component tests', () => { test('should render the header when heading is provided', async ({ mount, page }) => { // Arrange await mount(PieNotification, { - props: { heading: 'Title' }, + props: { heading: 'Title' } as NotificationProps, }); // Act @@ -184,7 +179,7 @@ test.describe('PieNotification - Component tests', () => { props: { headingLevel, heading: `Title using ${headingLevel}`, - }, + } as NotificationProps, }); // Act diff --git a/packages/components/pie-spinner/test/accessibility/pie-spinner.spec.ts b/packages/components/pie-spinner/test/accessibility/pie-spinner.spec.ts index 74954e299f..d82fecb9b7 100644 --- a/packages/components/pie-spinner/test/accessibility/pie-spinner.spec.ts +++ b/packages/components/pie-spinner/test/accessibility/pie-spinner.spec.ts @@ -1,4 +1,3 @@ - import { test, expect } from '@justeattakeaway/pie-webc-testing/src/playwright/webc-fixtures.ts'; import { PieSpinner } from '../../src/index.ts'; diff --git a/packages/components/pie-spinner/test/component/pie-spinner.spec.ts b/packages/components/pie-spinner/test/component/pie-spinner.spec.ts index cd122de25a..de383c438b 100644 --- a/packages/components/pie-spinner/test/component/pie-spinner.spec.ts +++ b/packages/components/pie-spinner/test/component/pie-spinner.spec.ts @@ -1,4 +1,3 @@ - import { test, expect } from '@sand4rt/experimental-ct-web'; import { PieSpinner, type SpinnerProps } from '../../src/index.ts'; diff --git a/packages/components/pie-spinner/test/visual/pie-spinner.spec.ts b/packages/components/pie-spinner/test/visual/pie-spinner.spec.ts index e2d62f3907..096b6ffdc2 100644 --- a/packages/components/pie-spinner/test/visual/pie-spinner.spec.ts +++ b/packages/components/pie-spinner/test/visual/pie-spinner.spec.ts @@ -1,8 +1,6 @@ import { test } from '@sand4rt/experimental-ct-web'; import percySnapshot from '@percy/playwright'; -import { - type PropObject, WebComponentPropValues, -} from '@justeattakeaway/pie-webc-testing/src/helpers/defs.ts'; +import { type PropObject, type WebComponentPropValues } from '@justeattakeaway/pie-webc-testing/src/helpers/defs.ts'; import { getAllPropCombinations, splitCombinationsByPropertyValue, } from '@justeattakeaway/pie-webc-testing/src/helpers/get-all-prop-combos.ts'; diff --git a/packages/components/pie-tag/test/accessibility/pie-tag.spec.ts b/packages/components/pie-tag/test/accessibility/pie-tag.spec.ts index ca2f0bde3a..ebadda9431 100644 --- a/packages/components/pie-tag/test/accessibility/pie-tag.spec.ts +++ b/packages/components/pie-tag/test/accessibility/pie-tag.spec.ts @@ -1,4 +1,3 @@ - import { test, expect } from '@justeattakeaway/pie-webc-testing/src/playwright/webc-fixtures.ts'; import { getAllPropCombinations, splitCombinationsByPropertyValue } from '@justeattakeaway/pie-webc-testing/src/helpers/get-all-prop-combos.ts'; import { type PropObject, type WebComponentPropValues } from '@justeattakeaway/pie-webc-testing/src/helpers/defs.ts'; diff --git a/packages/components/pie-text-input/test/component/pie-text-input.spec.ts b/packages/components/pie-text-input/test/component/pie-text-input.spec.ts index 4f1b8a9287..ed8843ac5d 100644 --- a/packages/components/pie-text-input/test/component/pie-text-input.spec.ts +++ b/packages/components/pie-text-input/test/component/pie-text-input.spec.ts @@ -1,4 +1,3 @@ - import { setupFormDataExtraction, getFormDataObject } from '@justeattakeaway/pie-webc-testing/src/helpers/form-helpers.ts'; import { test, expect } from '@sand4rt/experimental-ct-web'; import { IconPlaceholder } from '@justeattakeaway/pie-icons-webc/dist/IconPlaceholder'; diff --git a/packages/components/pie-textarea/src/defs-react.ts b/packages/components/pie-textarea/src/defs-react.ts index 6d056d4cc9..41e2f5d491 100644 --- a/packages/components/pie-textarea/src/defs-react.ts +++ b/packages/components/pie-textarea/src/defs-react.ts @@ -1,3 +1,3 @@ -import React from 'react'; +import type React from 'react'; export type ReactBaseType = React.HTMLAttributes diff --git a/packages/components/pie-textarea/test/accessibility/pie-textarea.spec.ts b/packages/components/pie-textarea/test/accessibility/pie-textarea.spec.ts index c9c0cbd124..a351afdd15 100644 --- a/packages/components/pie-textarea/test/accessibility/pie-textarea.spec.ts +++ b/packages/components/pie-textarea/test/accessibility/pie-textarea.spec.ts @@ -1,6 +1,5 @@ - import { test, expect } from '@justeattakeaway/pie-webc-testing/src/playwright/webc-fixtures.ts'; -import { PieTextarea, TextareaProps } from '../../src/index.ts'; +import { PieTextarea, type TextareaProps } from '../../src/index.ts'; test.describe('PieTextarea - Accessibility tests', () => { test('a11y - should test the PieTextarea component WCAG compliance', async ({ makeAxeBuilder, mount }) => { diff --git a/packages/components/pie-toast/src/defs-react.ts b/packages/components/pie-toast/src/defs-react.ts index 97258f7d24..2714b9afa2 100644 --- a/packages/components/pie-toast/src/defs-react.ts +++ b/packages/components/pie-toast/src/defs-react.ts @@ -1,4 +1,4 @@ -import React from 'react'; +import type React from 'react'; /** * TODO: Verify if ReactBaseType can be set as a more specific React interface * Use the React IntrinsicElements interface to find how to map standard HTML elements to existing React Interfaces diff --git a/packages/components/pie-toast/src/index.ts b/packages/components/pie-toast/src/index.ts index b1dbcd5d82..c73459ed56 100644 --- a/packages/components/pie-toast/src/index.ts +++ b/packages/components/pie-toast/src/index.ts @@ -24,10 +24,10 @@ import '@justeattakeaway/pie-button'; import styles from './toast.scss?inline'; import { - ToastProps, + type ToastProps, componentSelector, componentClass, - ActionProps, + type ActionProps, ON_TOAST_CLOSE_EVENT, ON_TOAST_OPEN_EVENT, ON_TOAST_LEADING_ACTION_CLICK_EVENT, @@ -308,7 +308,7 @@ export class PieToast extends RtlMixin(LitElement) implements ToastProps {
${this.variantHasIcon(variant) ? this.getVariantIcon() : nothing} - ${message === '' ? nothing : this.renderMessage(message, _messageAreaMaxWidth)} + ${message === '' ? nothing : this.renderMessage(message, _messageAreaMaxWidth)}
${!isMultiline && leadingAction?.text ? this.renderActionButton(leadingAction) : nothing} diff --git a/packages/components/pie-toast/test/accessibility/pie-toast.spec.ts b/packages/components/pie-toast/test/accessibility/pie-toast.spec.ts index 7d561baad6..c3e91acbc5 100644 --- a/packages/components/pie-toast/test/accessibility/pie-toast.spec.ts +++ b/packages/components/pie-toast/test/accessibility/pie-toast.spec.ts @@ -1,6 +1,5 @@ - import { test, expect } from '@justeattakeaway/pie-webc-testing/src/playwright/webc-fixtures.ts'; -import { PieToast, ToastProps } from '../../src/index.ts'; +import { PieToast, type ToastProps } from '../../src/index.ts'; test.describe('PieToast - Accessibility tests', () => { test('a11y - should test the PieToast component WCAG compliance', async ({ makeAxeBuilder, mount }) => { diff --git a/packages/components/pie-toast/test/component/pie-toast.spec.ts b/packages/components/pie-toast/test/component/pie-toast.spec.ts index 4f6c07d768..931333023e 100644 --- a/packages/components/pie-toast/test/component/pie-toast.spec.ts +++ b/packages/components/pie-toast/test/component/pie-toast.spec.ts @@ -1,4 +1,3 @@ - import { test, expect } from '@sand4rt/experimental-ct-web'; import { PieToast } from '../../src/index.ts'; import { type ToastProps, variants } from '../../src/defs.ts'; diff --git a/packages/components/pie-toast/test/visual/pie-toast.spec.ts b/packages/components/pie-toast/test/visual/pie-toast.spec.ts index 168fdb8844..4ea4cf07d3 100644 --- a/packages/components/pie-toast/test/visual/pie-toast.spec.ts +++ b/packages/components/pie-toast/test/visual/pie-toast.spec.ts @@ -15,7 +15,7 @@ import { } from '@justeattakeaway/pie-webc-testing/src/helpers/components/web-component-test-wrapper/WebComponentTestWrapper.ts'; import { variants } from '../../src/defs.ts'; -import { PieToast, ToastProps } from '../../src/index.ts'; +import { PieToast, type ToastProps } from '../../src/index.ts'; test.describe('PieToast - Visual tests`', () => { test('should display the PieToast component successfully', async ({ page, mount }) => { diff --git a/packages/components/pie-webc-core/src/mixins/rtl/rtlMixin.ts b/packages/components/pie-webc-core/src/mixins/rtl/rtlMixin.ts index 010d45d607..0c6c5a4231 100644 --- a/packages/components/pie-webc-core/src/mixins/rtl/rtlMixin.ts +++ b/packages/components/pie-webc-core/src/mixins/rtl/rtlMixin.ts @@ -1,6 +1,5 @@ -/* eslint-disable max-classes-per-file */ -import { LitElement, isServer } from 'lit'; -import type { GenericConstructor } from '../types/GenericConstructor'; +import { type LitElement, isServer } from 'lit'; +import { type GenericConstructor } from '../types/GenericConstructor'; /** * An interface representing the structure of RTL related class. diff --git a/packages/components/pie-webc-testing/src/helpers/get-all-prop-combos.ts b/packages/components/pie-webc-testing/src/helpers/get-all-prop-combos.ts index 7cee508180..e62905f3e5 100644 --- a/packages/components/pie-webc-testing/src/helpers/get-all-prop-combos.ts +++ b/packages/components/pie-webc-testing/src/helpers/get-all-prop-combos.ts @@ -1,4 +1,4 @@ -import { PropObject, WebComponentPropValues } from './defs'; +import { type PropObject, type WebComponentPropValues } from './defs'; /** * Generate all possible combinations of properties for a given object. diff --git a/packages/components/pie-webc-testing/src/helpers/rendering.ts b/packages/components/pie-webc-testing/src/helpers/rendering.ts index 032f9ebd95..c55a83c833 100644 --- a/packages/components/pie-webc-testing/src/helpers/rendering.ts +++ b/packages/components/pie-webc-testing/src/helpers/rendering.ts @@ -1,4 +1,4 @@ -import { WebComponentPropValues, WebComponentTestInput, WebComponentRenderFn } from './defs'; +import { type WebComponentPropValues, type WebComponentTestInput, type WebComponentRenderFn } from './defs'; export function createTestWebComponent (propVals: WebComponentPropValues, componentRenderFn: WebComponentRenderFn): WebComponentTestInput { const testComponent: WebComponentTestInput = { diff --git a/packages/tools/eslint-config-pie/strict/rules/imports.js b/packages/tools/eslint-config-pie/strict/rules/imports.js index ff068ec425..3799d47037 100755 --- a/packages/tools/eslint-config-pie/strict/rules/imports.js +++ b/packages/tools/eslint-config-pie/strict/rules/imports.js @@ -1,5 +1,6 @@ module.exports = { rules: { 'import/prefer-default-export': 'off', + '@typescript-eslint/consistent-type-imports': ['error', { prefer: 'type-imports', fixStyle: 'inline-type-imports' }], }, }; diff --git a/packages/tools/generator-pie-component/src/app/types.ts b/packages/tools/generator-pie-component/src/app/types.ts index 0cfd4f570a..a1aed3434f 100644 --- a/packages/tools/generator-pie-component/src/app/types.ts +++ b/packages/tools/generator-pie-component/src/app/types.ts @@ -1,4 +1,4 @@ -import { Answers } from 'yeoman-generator'; +import { type Answers } from 'yeoman-generator'; export type TransformedName = { componentName: string; diff --git a/packages/tools/generator-pie-component/src/app/utils.ts b/packages/tools/generator-pie-component/src/app/utils.ts index 35a5187d6d..7e3a15c214 100644 --- a/packages/tools/generator-pie-component/src/app/utils.ts +++ b/packages/tools/generator-pie-component/src/app/utils.ts @@ -1,5 +1,5 @@ import { startCase, snakeCase, camelCase } from 'lodash'; -import { TransformedName } from './types'; +import { type TransformedName } from './types'; function trim (str: string) { return str.replace(/\s/g, ''); diff --git a/packages/tools/pie-css/buildCss.ts b/packages/tools/pie-css/buildCss.ts index 1991cfd237..f3718a5535 100644 --- a/packages/tools/pie-css/buildCss.ts +++ b/packages/tools/pie-css/buildCss.ts @@ -1,6 +1,6 @@ import fs from 'fs/promises'; import path from 'path'; -import postcss, { Result } from 'postcss'; +import postcss, { type Result } from 'postcss'; import atImport from 'postcss-import'; const cssInputFilePath = 'css/input.css'; diff --git a/packages/tools/pie-icons-react/types.ts b/packages/tools/pie-icons-react/types.ts index 7489c4aba9..c229c48126 100644 --- a/packages/tools/pie-icons-react/types.ts +++ b/packages/tools/pie-icons-react/types.ts @@ -1,4 +1,4 @@ -import { SVGProps } from 'react'; +import { type SVGProps } from 'react'; export interface LargeIconProps extends SVGProps { className?: string; diff --git a/packages/tools/pie-icons-vue/.gitignore b/packages/tools/pie-icons-vue/.gitignore index d02fe863c7..b133a451cf 100644 --- a/packages/tools/pie-icons-vue/.gitignore +++ b/packages/tools/pie-icons-vue/.gitignore @@ -1,2 +1,2 @@ -generated/* -icons/* +generated +icons diff --git a/packages/tools/pie-icons-vue/package.json b/packages/tools/pie-icons-vue/package.json index 7a9eb42b39..60166cdbe0 100644 --- a/packages/tools/pie-icons-vue/package.json +++ b/packages/tools/pie-icons-vue/package.json @@ -60,7 +60,7 @@ "@rollup/plugin-commonjs": "25.0.8", "@vue/babel-preset-jsx": "1.4.0", "@vue/test-utils": "1.1.3", - "eslint": "8.37.0", + "eslint": "8.57.0", "eslint-plugin-vue": "^9.9.0", "fs-extra": "9.1.0", "lodash.kebabcase": "4.1.1", diff --git a/packages/tools/pie-wrapper-react/README.md b/packages/tools/pie-wrapper-react/README.md index 88d8730f79..efd79940e7 100644 --- a/packages/tools/pie-wrapper-react/README.md +++ b/packages/tools/pie-wrapper-react/README.md @@ -105,7 +105,7 @@ With this package, the below code (example of `pie-button`) is automatically gen import * as React from 'react'; import { createComponent } from '@lit/react'; import { PieButton as PieButtonLit } from './index'; -import { ButtonProps } from './defs'; +import { type ButtonProps } from './defs'; const PieButtonReact = createComponent({ displayName: 'PieButton', diff --git a/packages/tools/pie-wrapper-react/__tests__/__snapshots__/wrapper.test.js.snap b/packages/tools/pie-wrapper-react/__tests__/__snapshots__/wrapper.test.js.snap index 439a68bae5..3d5fe2da32 100644 --- a/packages/tools/pie-wrapper-react/__tests__/__snapshots__/wrapper.test.js.snap +++ b/packages/tools/pie-wrapper-react/__tests__/__snapshots__/wrapper.test.js.snap @@ -2,9 +2,9 @@ exports[`React Wrapper > should be added from mock custom elements JSON 1`] = ` "import * as React from 'react'; -import { createComponent, EventName } from '@lit/react'; +import { createComponent, type EventName } from '@lit/react'; import { MockComponent as MockComponentLit } from './index'; -import { MockComponentProps } from './defs'; +import { type MockComponentProps } from './defs'; export * from './defs'; @@ -33,7 +33,7 @@ exports[`React Wrapper > should be named the same as the component itself 1`] = "import * as React from 'react'; import { createComponent } from '@lit/react'; import { ButtonComponent as ButtonComponentLit } from './index'; -import { ButtonComponentProps } from './defs'; +import { type ButtonComponentProps } from './defs'; export * from './defs'; @@ -54,7 +54,7 @@ exports[`React Wrapper > should leave the events object empty if the component c "import * as React from 'react'; import { createComponent } from '@lit/react'; import { MockComponent as MockComponentLit } from './index'; -import { MockComponentProps } from './defs'; +import { type MockComponentProps } from './defs'; export * from './defs'; diff --git a/packages/tools/pie-wrapper-react/scripts/add-react-wrapper.js b/packages/tools/pie-wrapper-react/scripts/add-react-wrapper.js index d0313b25d4..c13d61cf71 100755 --- a/packages/tools/pie-wrapper-react/scripts/add-react-wrapper.js +++ b/packages/tools/pie-wrapper-react/scripts/add-react-wrapper.js @@ -188,9 +188,9 @@ export function addReactWrapper (customElementsObject) { // Create the main source code componentSrc = `import * as React from 'react'; -import { createComponent${component.class.events?.length > 0 ? ', EventName' : ''} } from '@lit/react'; +import { createComponent${component.class.events?.length > 0 ? ', type EventName' : ''} } from '@lit/react'; import { ${component.class.name} as ${component.class.name}Lit } from './index'; -import { ${componentPropsExportName} } from './defs'; +import { type ${componentPropsExportName} } from './defs'; export * from './defs'; diff --git a/yarn.lock b/yarn.lock index b0cc553718..cd29a26fed 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4898,7 +4898,7 @@ __metadata: languageName: node linkType: hard -"@eslint/eslintrc@npm:^2.0.2, @eslint/eslintrc@npm:^2.1.4": +"@eslint/eslintrc@npm:^2.1.4": version: 2.1.4 resolution: "@eslint/eslintrc@npm:2.1.4" dependencies: @@ -4915,13 +4915,6 @@ __metadata: languageName: node linkType: hard -"@eslint/js@npm:8.37.0": - version: 8.37.0 - resolution: "@eslint/js@npm:8.37.0" - checksum: 7a07fb085c94ce1538949012c292fd3a6cd734f149bc03af6157dfbd8a7477678899ef57b4a27e15b36470a997389ad79a0533d5880c71e67720ae1a7de7c62d - languageName: node - linkType: hard - "@eslint/js@npm:8.57.0": version: 8.57.0 resolution: "@eslint/js@npm:8.57.0" @@ -5042,7 +5035,7 @@ __metadata: languageName: node linkType: hard -"@humanwhocodes/config-array@npm:^0.11.14, @humanwhocodes/config-array@npm:^0.11.8": +"@humanwhocodes/config-array@npm:^0.11.14": version: 0.11.14 resolution: "@humanwhocodes/config-array@npm:0.11.14" dependencies: @@ -5458,7 +5451,7 @@ __metadata: "@vue/babel-helper-vue-jsx-merge-props": 1.4.0 "@vue/babel-preset-jsx": 1.4.0 "@vue/test-utils": 1.1.3 - eslint: 8.37.0 + eslint: 8.57.0 eslint-plugin-vue: ^9.9.0 fs-extra: 9.1.0 lodash.kebabcase: 4.1.1 @@ -11508,7 +11501,7 @@ __metadata: languageName: node linkType: hard -"ajv@npm:^6.1.0, ajv@npm:^6.10.0, ajv@npm:^6.10.2, ajv@npm:^6.12.4, ajv@npm:^6.12.5": +"ajv@npm:^6.1.0, ajv@npm:^6.10.2, ajv@npm:^6.12.4, ajv@npm:^6.12.5": version: 6.12.6 resolution: "ajv@npm:6.12.6" dependencies: @@ -17551,63 +17544,13 @@ __metadata: languageName: node linkType: hard -"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3": +"eslint-visitor-keys@npm:^3.3.0, eslint-visitor-keys@npm:^3.4.1, eslint-visitor-keys@npm:^3.4.3": version: 3.4.3 resolution: "eslint-visitor-keys@npm:3.4.3" checksum: 36e9ef87fca698b6fd7ca5ca35d7b2b6eeaaf106572e2f7fd31c12d3bfdaccdb587bba6d3621067e5aece31c8c3a348b93922ab8f7b2cbc6aaab5e1d89040c60 languageName: node linkType: hard -"eslint@npm:8.37.0": - version: 8.37.0 - resolution: "eslint@npm:8.37.0" - dependencies: - "@eslint-community/eslint-utils": ^4.2.0 - "@eslint-community/regexpp": ^4.4.0 - "@eslint/eslintrc": ^2.0.2 - "@eslint/js": 8.37.0 - "@humanwhocodes/config-array": ^0.11.8 - "@humanwhocodes/module-importer": ^1.0.1 - "@nodelib/fs.walk": ^1.2.8 - ajv: ^6.10.0 - chalk: ^4.0.0 - cross-spawn: ^7.0.2 - debug: ^4.3.2 - doctrine: ^3.0.0 - escape-string-regexp: ^4.0.0 - eslint-scope: ^7.1.1 - eslint-visitor-keys: ^3.4.0 - espree: ^9.5.1 - esquery: ^1.4.2 - esutils: ^2.0.2 - fast-deep-equal: ^3.1.3 - file-entry-cache: ^6.0.1 - find-up: ^5.0.0 - glob-parent: ^6.0.2 - globals: ^13.19.0 - grapheme-splitter: ^1.0.4 - ignore: ^5.2.0 - import-fresh: ^3.0.0 - imurmurhash: ^0.1.4 - is-glob: ^4.0.0 - is-path-inside: ^3.0.3 - js-sdsl: ^4.1.4 - js-yaml: ^4.1.0 - json-stable-stringify-without-jsonify: ^1.0.1 - levn: ^0.4.1 - lodash.merge: ^4.6.2 - minimatch: ^3.1.2 - natural-compare: ^1.4.0 - optionator: ^0.9.1 - strip-ansi: ^6.0.1 - strip-json-comments: ^3.1.0 - text-table: ^0.2.0 - bin: - eslint: bin/eslint.js - checksum: 80f3d5cdce2d671f4794e392d234a78d039c347673defb0596268bd481e8f30a53d93c01ff4f66a546c87d97ab4122c0e9cafe1371f87cb03cee6b7d5aa97595 - languageName: node - linkType: hard - "eslint@npm:8.57.0": version: 8.57.0 resolution: "eslint@npm:8.57.0" @@ -17656,7 +17599,7 @@ __metadata: languageName: node linkType: hard -"espree@npm:^9.3.1, espree@npm:^9.5.1, espree@npm:^9.6.0, espree@npm:^9.6.1": +"espree@npm:^9.3.1, espree@npm:^9.6.0, espree@npm:^9.6.1": version: 9.6.1 resolution: "espree@npm:9.6.1" dependencies: @@ -21464,13 +21407,6 @@ __metadata: languageName: node linkType: hard -"js-sdsl@npm:^4.1.4": - version: 4.4.2 - resolution: "js-sdsl@npm:4.4.2" - checksum: ba705adc1788bf3c6f6c8e5077824f2bb4f0acab5a984420ce5cc492c7fff3daddc26335ad2c9a67d4f5e3241ec790f9e5b72a625adcf20cf321d2fd85e62b8b - languageName: node - linkType: hard - "js-stringify@npm:^1.0.2": version: 1.0.2 resolution: "js-stringify@npm:1.0.2" @@ -25246,7 +25182,7 @@ __metadata: languageName: node linkType: hard -"optionator@npm:^0.9.1, optionator@npm:^0.9.3": +"optionator@npm:^0.9.3": version: 0.9.4 resolution: "optionator@npm:0.9.4" dependencies: @@ -26034,7 +25970,7 @@ __metadata: cz-customizable: 7.2.1 danger: 11.3.0 dree: 3.4.5 - eslint: 8.37.0 + eslint: 8.57.0 eslint-plugin-import: 2.27.5 eslint-plugin-json-format: 2.0.1 eslint-plugin-vitest: 0.3.22 @@ -31057,7 +30993,7 @@ __metadata: languageName: node linkType: hard -"strip-json-comments@npm:3.1.1, strip-json-comments@npm:^3.1.0, strip-json-comments@npm:^3.1.1, strip-json-comments@npm:~3.1.1": +"strip-json-comments@npm:3.1.1, strip-json-comments@npm:^3.1.1, strip-json-comments@npm:~3.1.1": version: 3.1.1 resolution: "strip-json-comments@npm:3.1.1" checksum: 492f73e27268f9b1c122733f28ecb0e7e8d8a531a6662efbd08e22cccb3f9475e90a1b82cab06a392f6afae6d2de636f977e231296400d0ec5304ba70f166443 @@ -33958,7 +33894,7 @@ __metadata: "@justeattakeaway/pie-webc": 0.5.38 "@lit/react": 1.0.2 babel-loader: 8 - eslint: 8.37.0 + eslint: 8.57.0 eslint-config-next: 13.2.4 next: 10.2.3 next-transpile-modules: 4.1.0