From 6df1b1fe928dab9c050945848241e058525d042f Mon Sep 17 00:00:00 2001 From: Natalie Martin Date: Tue, 5 Mar 2024 15:20:15 -0700 Subject: [PATCH 1/2] Enable storybook/prefer-pascal-case lint rule This linting rule is enabled to warn by default, but warnings are pretty much useless for our CI pipeline. Set this to throw an error when violated. Lint rule: storybook/prefer-pascal-case --- .eslintrc.js | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.js b/.eslintrc.js index 74c35683b..6ed70e81c 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -173,6 +173,7 @@ module.exports = { 'import/no-default-export': 'off', 'import/no-extraneous-dependencies': 'off', '@angular-eslint/component-selector': 'off', + 'storybook/prefer-pascal-case': 'error', }, }, ], From 8c6708c0cb86c157569a46cea79c2f64662d1b1b Mon Sep 17 00:00:00 2001 From: Natalie Martin Date: Tue, 5 Mar 2024 15:21:34 -0700 Subject: [PATCH 2/2] Fix storybook/prefer-pascal-case lint errors --- .../components/button/button.stories.ts | 18 +++++++++--------- .../form-input/form-input.stories.ts | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/app/component-library/components/button/button.stories.ts b/src/app/component-library/components/button/button.stories.ts index 0eaf18f13..46c7e7fe6 100644 --- a/src/app/component-library/components/button/button.stories.ts +++ b/src/app/component-library/components/button/button.stories.ts @@ -66,44 +66,44 @@ const meta: Meta = { export default meta; type ButtonStory = StoryObj; -export const primaryMedium: ButtonStory = { +export const PrimaryMedium: ButtonStory = { args: { variant: 'primary', text: 'Primary' }, }; -export const secondaryMedium: ButtonStory = { +export const SecondaryMedium: ButtonStory = { args: { variant: 'secondary', text: 'Secondary' }, }; -export const primaryLarge: ButtonStory = { +export const PrimaryLarge: ButtonStory = { args: { variant: 'primary', text: 'Primary', height: 'large' }, }; -export const secondaryLarge: ButtonStory = { +export const SecondaryLarge: ButtonStory = { args: { variant: 'secondary', text: 'Secondary', height: 'large' }, }; -export const primaryFill: ButtonStory = { +export const PrimaryFill: ButtonStory = { args: { variant: 'primary', text: 'Primary', size: 'fill' }, }; -export const secondaryFill: ButtonStory = { +export const SecondaryFill: ButtonStory = { args: { variant: 'secondary', text: 'Secondary', size: 'fill' }, }; -export const darkModePrimary: ButtonStory = { +export const DarkModePrimary: ButtonStory = { args: { variant: 'primary', text: 'Primary', mode: 'dark' }, parameters: { backgrounds, }, }; -export const darkModeSecondary: ButtonStory = { +export const DarkModeSecondary: ButtonStory = { args: { variant: 'secondary', text: 'Secondary', mode: 'dark' }, parameters: { backgrounds, }, }; -export const tertiaryButton: ButtonStory = { +export const TertiaryButton: ButtonStory = { args: { variant: 'tertiary', text: 'Tertiary' }, }; diff --git a/src/app/component-library/components/form-input/form-input.stories.ts b/src/app/component-library/components/form-input/form-input.stories.ts index dbc994fc2..2addbeb2b 100644 --- a/src/app/component-library/components/form-input/form-input.stories.ts +++ b/src/app/component-library/components/form-input/form-input.stories.ts @@ -74,15 +74,15 @@ const meta: Meta = { export default meta; type FormInputStory = StoryObj; -export const light: FormInputStory = { +export const Light: FormInputStory = { args: { type: 'text', placeholder: 'Text', variant: 'light' }, }; -export const lightDarkBackground: FormInputStory = { +export const LightDarkBackground: FormInputStory = { args: { type: 'text', placeholder: 'Text', variant: 'light' }, parameters: { backgrounds }, }; -export const dark = { +export const Dark = { args: { type: 'text', placeholder: 'Text', variant: 'dark' }, };