diff --git a/.eslintignore b/.eslintignore index 045ab4f..15374d2 100644 --- a/.eslintignore +++ b/.eslintignore @@ -4,3 +4,5 @@ node_modules/ storybook-static/ .snapshots/ *.min.js +# See https://github.com/eslint/eslint/issues/12348#issuecomment-536946429 +!.storybook diff --git a/.storybook/typings.d.ts b/.storybook/typings.d.ts index 9b9c211..f98b3ea 100644 --- a/.storybook/typings.d.ts +++ b/.storybook/typings.d.ts @@ -1,4 +1,3 @@ - interface SvgrComponent extends React.StatelessComponent> {} diff --git a/.storybook/utils.ts b/.storybook/utils.ts index 751f6ab..ce9cc93 100644 --- a/.storybook/utils.ts +++ b/.storybook/utils.ts @@ -1,8 +1,14 @@ import { StoryFn, Annotations, Args } from '@storybook/addons'; -type OptionalStoryInterface = Annotations & { storyName?: string }; +type OptionalStoryInterface = Annotations< + Args, + ReturnType +> & { storyName?: string }; -export function withDescription & OptionalStoryInterface, R>(storyDescription: string, story: T): T & OptionalStoryInterface { +export function withDescription< + T extends StoryFn & OptionalStoryInterface, + R +>(storyDescription: string, story: T): T & OptionalStoryInterface { story.parameters = { ...story.parameters, docs: { diff --git a/package.json b/package.json index 85a0ca5..14147d2 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "build": "tsc --noEmit false", "test": "run-s test:lint test:build test:unit", "test:build": "tsc --noEmit -p tsconfig.test.json", - "test:lint": "eslint '*/**/*.{js,ts,tsx}' '.storybook/stories/**/*.{js,ts,tsx}'", + "test:lint": "eslint '*/**/*.{js,ts,tsx}'", "test:unit": "cross-env CI=1 SKIP_PREFLIGHT_CHECK=true react-scripts test --env=jsdom --passWithNoTests", "test:watch": "cross-env SKIP_PREFLIGHT_CHECK=true react-scripts test --env=jsdom", "predeploy": "run-s storybook:build",