From 97c09c7c0f9f94170963118ef3efb7685878398c Mon Sep 17 00:00:00 2001 From: Emily Date: Mon, 23 Jul 2018 16:06:55 -0700 Subject: [PATCH] fix linting issues --- examples/component-examples/Avatar.js | 20 ++++++++--- examples/component-examples/Block.js | 5 ++- examples/component-examples/Box.js | 5 ++- examples/component-examples/BranchName.js | 10 +++--- examples/component-examples/Buttons.js | 36 +++++++++++++------- examples/component-examples/Caret.js | 12 +++---- examples/component-examples/CaretBox.js | 9 +++-- examples/component-examples/CircleBadge.js | 9 ++--- examples/component-examples/CircleOcticon.js | 5 ++- examples/component-examples/CounterLabel.js | 6 ++-- examples/component-examples/Details.js | 10 +++--- examples/component-examples/DonutChart.js | 9 ++--- examples/component-examples/Dropdown.js | 12 +++---- examples/component-examples/Flash.js | 10 +++--- examples/component-examples/Flex.js | 11 +++--- examples/component-examples/Heading.js | 6 +++- examples/component-examples/Label.js | 12 +++---- examples/component-examples/Link.js | 8 ++--- examples/component-examples/MergeStatus.js | 8 ++--- examples/component-examples/StateLabel.js | 15 +++----- examples/component-examples/Text.js | 12 +++---- examples/component-examples/TextInput.js | 10 +++--- examples/component-examples/Tooltip.js | 31 ++++++++--------- examples/component-examples/UnderlineNav.js | 9 ++--- 24 files changed, 143 insertions(+), 137 deletions(-) diff --git a/examples/component-examples/Avatar.js b/examples/component-examples/Avatar.js index eca77f9de78..723ea4f3b7e 100644 --- a/examples/component-examples/Avatar.js +++ b/examples/component-examples/Avatar.js @@ -7,16 +7,28 @@ const AvatarExample = { element: (
- `} scope={{Avatar}} /> + `} + scope={{Avatar}} + /> - `} scope={{Avatar}} /> + `} + scope={{Avatar}} + /> - `} scope={{Avatar}}/> + `} + scope={{Avatar}} + /> - `} scope={{Avatar}}/> + `} + scope={{Avatar}} + />
) diff --git a/examples/component-examples/Block.js b/examples/component-examples/Block.js index 7d0621b66a4..73f51c338b5 100644 --- a/examples/component-examples/Block.js +++ b/examples/component-examples/Block.js @@ -58,7 +58,10 @@ const BlockExample = { Code Example - white`} scope={{Block}} /> + white`} + scope={{Block}} + /> ) } diff --git a/examples/component-examples/Box.js b/examples/component-examples/Box.js index bb320ecbb65..437d831e0e4 100644 --- a/examples/component-examples/Box.js +++ b/examples/component-examples/Box.js @@ -22,7 +22,10 @@ const BoxExample = { This is a box with a large shadow.`} scope={{Box}} /> - This is a box with an extra-large shadow.`} scope={{Box}} /> + This is a box with an extra-large shadow.`} + scope={{Box}} + /> This is a box with a green border.`} scope={{Box}} /> diff --git a/examples/component-examples/BranchName.js b/examples/component-examples/BranchName.js index 32c1740c2b4..d6c0ccb9547 100644 --- a/examples/component-examples/BranchName.js +++ b/examples/component-examples/BranchName.js @@ -4,13 +4,11 @@ import {Detail, LiveEditor} from '@compositor/kit' import ExampleHeading from '../doc-components/ExampleHeading' import {BranchName} from '../../src' -const linkedBranch = -` +const linkedBranch = ` a_new_feature_branch ` -const branchOcticon = -` +const branchOcticon = ` a_new_feature_branch ` @@ -19,12 +17,12 @@ const BranchNameExample = { name: 'BranchName', element: (
- a_new_feature_branch`} scope={{BranchName}}/> + a_new_feature_branch`} scope={{BranchName}} /> Linked BranchName BranchName with Octicon - +
) diff --git a/examples/component-examples/Buttons.js b/examples/component-examples/Buttons.js index 4c6f0b76ba7..91aa000ee22 100644 --- a/examples/component-examples/Buttons.js +++ b/examples/component-examples/Buttons.js @@ -9,38 +9,50 @@ const ButtonExample = { element: (
- Button `} scope={{Button}}/> + Button `} scope={{Button}} /> - Button small `} scope={{Button}}/> + Button small `} scope={{Button}} /> - Button large `} scope={{Button}}/> + Button large `} scope={{Button}} /> - ButtonDanger `} scope={{ButtonDanger}}/> + ButtonDanger `} scope={{ButtonDanger}} /> - ButtonPrimary `} scope={{ButtonPrimary}}/> + ButtonPrimary `} scope={{ButtonPrimary}} /> - ButtonOutline `} scope={{ButtonOutline}}/> + ButtonOutline `} scope={{ButtonOutline}} /> - Button block `} scope={{Button}}/> + Button block `} scope={{Button}} /> - Button linkStyle `} scope={{Button}}/> + Button linkStyle `} scope={{Button}} /> - This is an {''} styled as a button`} scope={{ButtonLink}}/> + This is an {''} styled as a button`} + scope={{ButtonLink}} + /> Octicon Buttons - alert('edit')} mr={3} />`} scope={{OcticonButton, Pencil}}/> - alert('close')} mr={3} />`} scope={{OcticonButton, Text, X}}/> + alert('edit')} mr={3} />`} + scope={{OcticonButton, Pencil}} + /> + alert('close')} mr={3} />`} + scope={{OcticonButton, Text, X}} + /> - alert('beep boop')} />`} scope={{OcticonButton, Hubot}}/> + alert('beep boop')} />`} + scope={{OcticonButton, Hubot}} + />
diff --git a/examples/component-examples/Caret.js b/examples/component-examples/Caret.js index 43d8032e4bb..03db316e86f 100644 --- a/examples/component-examples/Caret.js +++ b/examples/component-examples/Caret.js @@ -2,21 +2,19 @@ import React from 'react' import {LiveEditor} from '@compositor/kit' import {Caret, Text, Box, Block} from '../../src' -const example = (loc) => -` +const example = loc => + ` - location='{loc}' + location='${loc}' - + ` const CaretExample = { name: 'Caret', element: ( - {Caret.locations.map(loc => ( - - ))} + {Caret.locations.map(loc => )} ) } diff --git a/examples/component-examples/CaretBox.js b/examples/component-examples/CaretBox.js index a917498fdc7..47258ccec07 100644 --- a/examples/component-examples/CaretBox.js +++ b/examples/component-examples/CaretBox.js @@ -1,10 +1,9 @@ import React from 'react' -import {PropsForm, LiveEditor} from '@compositor/kit' -import {Caret, CaretBox, theme} from '../../src' +import {LiveEditor} from '@compositor/kit' +import {CaretBox} from '../../src' import ExampleHeading from '../doc-components/ExampleHeading' -const example = -` +const example = ` CaretBox ` @@ -13,7 +12,7 @@ const CaretBoxExample = { element: (
CaretBox - +
) } diff --git a/examples/component-examples/CircleBadge.js b/examples/component-examples/CircleBadge.js index cd5fc6c84a3..a78546553c0 100644 --- a/examples/component-examples/CircleBadge.js +++ b/examples/component-examples/CircleBadge.js @@ -3,16 +3,13 @@ import Octicon, {Zap} from '@githubprimer/octicons-react' import {LiveEditor} from '@compositor/kit' import {Block, CircleBadge, Heading} from '../../src' -const octicon = -` +const octicon = ` ` -const image = -`` +const image = `` -const sizes = -` +const sizes = ` ` diff --git a/examples/component-examples/CircleOcticon.js b/examples/component-examples/CircleOcticon.js index 3ca3e07a9ca..93c99385ea6 100644 --- a/examples/component-examples/CircleOcticon.js +++ b/examples/component-examples/CircleOcticon.js @@ -7,7 +7,10 @@ const CircleOcticonExample = { name: 'CircleOcticon', element: (
- `} scope={{CircleOcticon, Check}} /> + `} + scope={{CircleOcticon, Check}} + />
) } diff --git a/examples/component-examples/CounterLabel.js b/examples/component-examples/CounterLabel.js index 13c19acfb1d..8ea9d2e1240 100644 --- a/examples/component-examples/CounterLabel.js +++ b/examples/component-examples/CounterLabel.js @@ -6,9 +6,9 @@ const CounterLabelExample = { name: 'CounterLabel', element: (
- 12`} scope={{CounterLabel}}/> - 13`} scope={{CounterLabel}}/> - 13`} scope={{CounterLabel}}/> + 12`} scope={{CounterLabel}} /> + 13`} scope={{CounterLabel}} /> + 13`} scope={{CounterLabel}} />
) } diff --git a/examples/component-examples/Details.js b/examples/component-examples/Details.js index fd58abc60b2..38f18dd8e95 100644 --- a/examples/component-examples/Details.js +++ b/examples/component-examples/Details.js @@ -4,15 +4,13 @@ import {LiveEditor} from '@compositor/kit' import {Block, Details} from '../../src' import ExampleHeading from '../doc-components/ExampleHeading' -const example1 = -`
+const example1 = `
Click me

This should show and hide

` -const example2 = -`
+const example2 = `
{({open, toggle}) => ( @@ -30,11 +28,11 @@ const DetailsExample = {
With static children - + With children as a function - + With render prop diff --git a/examples/component-examples/DonutChart.js b/examples/component-examples/DonutChart.js index 6265087531f..b3e06b4ee13 100644 --- a/examples/component-examples/DonutChart.js +++ b/examples/component-examples/DonutChart.js @@ -3,16 +3,14 @@ import {LiveEditor} from '@compositor/kit' import {Block, DonutChart, Text, DonutSlice, theme} from '../../src' import ExampleHeading from '../doc-components/ExampleHeading' -const dataPropExample = -` +const dataPropExample = ` ` -const donutSliceExample = -` +const donutSliceExample = ` @@ -43,8 +41,7 @@ const donutSliceExample = ` -const customColorsExample = -` +const customColorsExample = ` diff --git a/examples/component-examples/Dropdown.js b/examples/component-examples/Dropdown.js index dad2ff9a812..95e62a074a0 100644 --- a/examples/component-examples/Dropdown.js +++ b/examples/component-examples/Dropdown.js @@ -3,8 +3,7 @@ import {LiveEditor} from '@compositor/kit' import {Block, Dropdown} from '../../src' import ExampleHeading from '../doc-components/ExampleHeading' -const dropdownPrimary = -` +const dropdownPrimary = `
  • Item 1
  • Item 2
  • @@ -12,8 +11,7 @@ const dropdownPrimary =
` -const dropdown = -` +const dropdown = `
  • Item 1
  • Item 2
  • @@ -21,8 +19,7 @@ const dropdown =
` -const dropdownTitle = -` +const dropdownTitle = `
  • Item 1
  • Item 2
  • @@ -30,7 +27,6 @@ const dropdownTitle =
` - const DropdownExample = { name: 'Dropdown', element: ( @@ -45,7 +41,7 @@ const DropdownExample = {
Dropdown with title - +
) diff --git a/examples/component-examples/Flash.js b/examples/component-examples/Flash.js index 086440f2755..3fa1c8ffdb7 100644 --- a/examples/component-examples/Flash.js +++ b/examples/component-examples/Flash.js @@ -7,19 +7,19 @@ const FlashExample = { element: (
- Flash `} scope={{Flash}}/> + Flash `} scope={{Flash}} /> - Flash yellow `} scope={{Flash}}/> + Flash yellow `} scope={{Flash}} /> - Flash red `} scope={{Flash}}/> + Flash red `} scope={{Flash}} /> - Flash green `} scope={{Flash}}/> + Flash green `} scope={{Flash}} /> - Flash full `} scope={{Flash}}/> + Flash full `} scope={{Flash}} />
) diff --git a/examples/component-examples/Flex.js b/examples/component-examples/Flex.js index e1da2ad9b42..6ec257d4a0d 100644 --- a/examples/component-examples/Flex.js +++ b/examples/component-examples/Flex.js @@ -11,8 +11,7 @@ const propObj = { alignContent: ['start', 'end', 'center', 'between', 'around', 'stretch'] } -const example1 = -` +const example1 = ` Item 1 @@ -30,8 +29,7 @@ const example1 = ` -const example2 = -` +const example2 = ` Item 1 @@ -49,8 +47,7 @@ const example2 = ` -const example3 = -` +const example3 = ` Item 1 @@ -110,7 +107,7 @@ const FlexExample = { ))} FlexContainer + FlexItems set to flexAuto - + FlexContainer + FlexItems with first item set to alignSelf='center' FlexContainer + FlexItems using tag prop set to "p" diff --git a/examples/component-examples/Heading.js b/examples/component-examples/Heading.js index f9c0f67539d..b39bac3d4e4 100644 --- a/examples/component-examples/Heading.js +++ b/examples/component-examples/Heading.js @@ -8,7 +8,11 @@ const HeadingExample = {
Default Heading {[0, 1, 2, 3, 4, 5, /* 6, 7, */ '00-light', '0-light', '1-light', '2-light', '3-light'].map(fontSize => ( - With fontSize={fontSize}`} scope={{Heading, fontSize}}/> + With fontSize={"${fontSize}"}`} + scope={{Heading, fontSize}} + /> ))}
) diff --git a/examples/component-examples/Label.js b/examples/component-examples/Label.js index b19e5d7a82b..d88092e081c 100644 --- a/examples/component-examples/Label.js +++ b/examples/component-examples/Label.js @@ -8,14 +8,14 @@ const LabelExample = { element: (
- Default label`} scope={{Label}}/> - Darker gray label`} scope={{Label}}/> - Orange label`} scope={{Label}}/> - Green label`} scope={{Label}}/> + Default label`} scope={{Label}} /> + Darker gray label`} scope={{Label}} /> + Orange label`} scope={{Label}} /> + Green label`} scope={{Label}} /> - Default outline label`} scope={{Label}}/> - Green outline label`} scope={{Label}}/> + Default outline label`} scope={{Label}} /> + Green outline label`} scope={{Label}} />
) diff --git a/examples/component-examples/Link.js b/examples/component-examples/Link.js index 2ae2e3e645f..d5e2b7ed9d4 100644 --- a/examples/component-examples/Link.js +++ b/examples/component-examples/Link.js @@ -7,16 +7,16 @@ const LinkExample = { element: (
- Link`} scope={{Link}}/> + Link`} scope={{Link}} /> - Link muted`} scope={{Link}}/> + Link muted`} scope={{Link}} /> - Link gray`} scope={{Link}}/> + Link gray`} scope={{Link}} /> - Link gray-dark`} scope={{Link}}/> + Link gray-dark`} scope={{Link}} />
) diff --git a/examples/component-examples/MergeStatus.js b/examples/component-examples/MergeStatus.js index b648163d2c7..c2a7255a7f7 100644 --- a/examples/component-examples/MergeStatus.js +++ b/examples/component-examples/MergeStatus.js @@ -7,16 +7,16 @@ const MergeStatusExample = { element: (
- `} scope={{MergeStatus}}/> + `} scope={{MergeStatus}} /> - `} scope={{MergeStatus}}/> + `} scope={{MergeStatus}} /> - `} scope={{MergeStatus}}/> + `} scope={{MergeStatus}} /> - `} scope={{MergeStatus}}/> + `} scope={{MergeStatus}} />
) diff --git a/examples/component-examples/StateLabel.js b/examples/component-examples/StateLabel.js index 36af393844f..95d20bf13a7 100644 --- a/examples/component-examples/StateLabel.js +++ b/examples/component-examples/StateLabel.js @@ -4,8 +4,7 @@ import {LiveEditor} from '@compositor/kit' import {Block, StateLabel} from '../../src' import ExampleHeading from '../doc-components/ExampleHeading' -const example1 = -` +const example1 = ` Open @@ -15,8 +14,7 @@ const example1 = Merged ` -const example2 = -` +const example2 = ` Unknown @@ -33,8 +31,7 @@ const example2 = ` -const example3 = -` +const example3 = ` Invalid @@ -47,8 +44,7 @@ const example3 = Purple ` -const example4 = -` +const example4 = ` Unknown @@ -74,8 +70,7 @@ const example4 = ` -const example5 = -` +const example5 = ` Invalid diff --git a/examples/component-examples/Text.js b/examples/component-examples/Text.js index 4683dfdeb21..5b04c697fa3 100644 --- a/examples/component-examples/Text.js +++ b/examples/component-examples/Text.js @@ -6,12 +6,12 @@ const TextExample = { name: 'Text', element: (
- Text`} scope={{Text}}/> - Text bold`} scope={{Text}}/> - Text green`} scope={{Text}}/> - Text lineHeight 'condensed'`} scope={{Text}}/> - Text fontSize 4`} scope={{Text}}/> - Text padding 4`} scope={{Text}}/> + Text`} scope={{Text}} /> + Text bold`} scope={{Text}} /> + Text green`} scope={{Text}} /> + Text lineHeight 'condensed'`} scope={{Text}} /> + Text fontSize 4`} scope={{Text}} /> + Text padding 4`} scope={{Text}} />
) } diff --git a/examples/component-examples/TextInput.js b/examples/component-examples/TextInput.js index f3aac46b211..854b3ef2859 100644 --- a/examples/component-examples/TextInput.js +++ b/examples/component-examples/TextInput.js @@ -1,6 +1,6 @@ import React from 'react' import {LiveEditor} from '@compositor/kit' -import {TextInput, Block} from '../../src' +import {TextInput} from '../../src' import ExampleHeading from '../doc-components/ExampleHeading' const TextInputExample = { @@ -8,12 +8,12 @@ const TextInputExample = { element: (
Text Input - `} scope={{TextInput}}/> + `} scope={{TextInput}} /> Text Input Sizes - `} scope={{TextInput}}/> - `} scope={{TextInput}}/> + `} scope={{TextInput}} /> + `} scope={{TextInput}} /> Text Input - Block - `} scope={{TextInput}}/> + `} scope={{TextInput}} />
) } diff --git a/examples/component-examples/Tooltip.js b/examples/component-examples/Tooltip.js index 0cae9618c9a..761b9a2cbd3 100644 --- a/examples/component-examples/Tooltip.js +++ b/examples/component-examples/Tooltip.js @@ -3,21 +3,19 @@ import {LiveEditor} from '@compositor/kit' import {Box, Block, Tooltip} from '../../src' import ExampleHeading from '../doc-components/ExampleHeading' -const basicExample = -` +const basicExample = ` Text with a tooltip ` -const directionExample = (dir) => -` - - Tooltip direction={dir} +const directionExample = dir => + ` + + Tooltip direction="${dir}" ` -const wrapExample = -` +const wrapExample = ` ` -const alignmentExample = (align) => -` - - Tooltip align={align} +const alignmentExample = align => + ` + + Tooltip align="${align}" ` -const noDelayExample = -` +const noDelayExample = ` Text with a tooltip @@ -47,15 +44,15 @@ const TooltipExample = { element: (
Basic Tooltip - + Directions {Tooltip.directions.map(dir => ( - + ))} Alignment {Tooltip.alignments.map(align => ( - + ))} Word wrap diff --git a/examples/component-examples/UnderlineNav.js b/examples/component-examples/UnderlineNav.js index e87fdfdd9ad..8ea3cc9c85e 100644 --- a/examples/component-examples/UnderlineNav.js +++ b/examples/component-examples/UnderlineNav.js @@ -5,8 +5,7 @@ import {NavLink} from 'react-router-dom' import ExampleHeading from '../doc-components/ExampleHeading' import {Block, Text, UnderlineNav, UnderlineNavLink} from '../../src' -const underlineNavLinkExample = -` +const underlineNavLinkExample = ` Selected @@ -14,8 +13,7 @@ const underlineNavLinkExample = Baz ` -const linkTagExample = -` +const linkTagExample = ` Foo Selected @@ -23,8 +21,7 @@ const linkTagExample = Baz ` -const navLinkExample = -` +const navLinkExample = ` Foo Two Selected