Skip to content

Commit

Permalink
FIX linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Apr 4, 2020
1 parent ccb45f8 commit 8ca6e76
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion addons/docs/src/blocks/Description.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ${extractComponentDescription(target) || ''}
}
};

const DescriptionContainer: FunctionComponent<DescriptionProps> = props => {
const DescriptionContainer: FunctionComponent<DescriptionProps> = (props) => {
const context = useContext(DocsContext);
const { markdown } = getDescriptionProps(props, context);
return markdown ? <Description markdown={markdown} /> : null;
Expand Down
2 changes: 1 addition & 1 deletion addons/docs/src/blocks/Primary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const Primary: FC<PrimaryProps> = ({ name }) => {
const componentStories = getDocsStories(context);
let story;
if (componentStories) {
story = name ? componentStories.find(s => s.name === name) : componentStories[0];
story = name ? componentStories.find((s) => s.name === name) : componentStories[0];
}
return story ? <DocsStory {...story} expanded={false} withToolbar /> : null;
};
4 changes: 2 additions & 2 deletions addons/docs/src/blocks/Props.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export const getComponentProps = (
if (rows) {
props = { rows: filterRows(rows, exclude) };
} else if (sections) {
Object.keys(sections).forEach(section => {
Object.keys(sections).forEach((section) => {
sections[section] = filterRows(sections[section], exclude);
});
}
Expand All @@ -91,7 +91,7 @@ export const getComponent = (props: PropsProps = {}, context: DocsContextProps):
return target;
};

const PropsContainer: FunctionComponent<PropsProps> = props => {
const PropsContainer: FunctionComponent<PropsProps> = (props) => {
const context = useContext(DocsContext);
const { components } = props;
const {
Expand Down
6 changes: 3 additions & 3 deletions addons/docs/src/blocks/Source.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const getSourceProps = (
const targetId = singleProps.id === CURRENT_SELECTION ? currentId : singleProps.id;
const targetIds = multiProps.ids || [targetId];
source = targetIds
.map(sourceId => {
.map((sourceId) => {
const data = storyStore.fromId(sourceId);
return data?.parameters?.docs?.source?.code || '';
})
Expand All @@ -53,9 +53,9 @@ export const getSourceProps = (
* or the source for a story if `storyId` is provided, or
* the source for the current story if nothing is provided.
*/
const SourceContainer: FunctionComponent<SourceProps> = props => (
const SourceContainer: FunctionComponent<SourceProps> = (props) => (
<DocsContext.Consumer>
{context => {
{(context) => {
const sourceProps = getSourceProps(props, context);
return <Source {...sourceProps} />;
}}
Expand Down
2 changes: 1 addition & 1 deletion addons/docs/src/blocks/Stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const Stories: FunctionComponent<StoriesProps> = ({ title, includePrimary
return (
<>
<Heading>{title}</Heading>
{stories.map(story => story && <DocsStory key={story.id} {...story} expanded />)}
{stories.map((story) => story && <DocsStory key={story.id} {...story} expanded />)}
</>
);
};
Expand Down
6 changes: 3 additions & 3 deletions addons/docs/src/blocks/Story.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { DocsContext, DocsContextProps } from './DocsContext';
export const storyBlockIdFromId = (storyId: string) => `story--${storyId}`;

const resetComponents: Record<string, ElementType> = {};
Object.keys(docsComponents).forEach(key => {
Object.keys(docsComponents).forEach((key) => {
resetComponents[key] = (props: any) => createElement(key, props);
});

Expand Down Expand Up @@ -87,9 +87,9 @@ export const getStoryProps = (
};
};

const StoryContainer: FunctionComponent<StoryProps> = props => (
const StoryContainer: FunctionComponent<StoryProps> = (props) => (
<DocsContext.Consumer>
{context => {
{(context) => {
const storyProps = getStoryProps(props, context);
if (!storyProps) {
return null;
Expand Down
2 changes: 1 addition & 1 deletion addons/docs/src/blocks/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const getDocsStories = (context: DocsContextProps): StoryData[] => {
const titleCase = (str: string): string =>
str
.split('-')
.map(part => part.charAt(0).toUpperCase() + part.slice(1))
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
.join('');

export const getComponentName = (component: Component): string => {
Expand Down
2 changes: 2 additions & 0 deletions examples/cra-ts-essentials/src/App.test.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* eslint-disable no-undef */
/* eslint-disable jest/expect-expect */
import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
Expand Down

0 comments on commit 8ca6e76

Please sign in to comment.