From acc053d0f7994f0f73e1a4162b102914de0d9ab0 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Fri, 14 Apr 2017 09:26:27 +0200 Subject: [PATCH] CHANGE listing so trailing commas are always present && FIX linting --- .eslintrc => .eslintrc.js | 19 ++++--- package.json | 8 +-- .../src/components/ActionLogger/index.js | 4 +- .../src/components/ActionLogger/style.js | 16 +++--- .../src/containers/ActionLogger/index.js | 2 +- packages/addon-actions/src/manager.js | 2 +- packages/addon-actions/src/preview.js | 2 +- packages/addon-comments/src/index.js | 4 +- .../manager/components/CommentForm/index.js | 4 +- .../manager/components/CommentForm/style.js | 10 ++-- .../manager/components/CommentItem/index.js | 2 +- .../manager/components/CommentItem/style.js | 22 ++++---- .../manager/components/CommentList/index.js | 2 +- .../manager/components/CommentList/style.js | 6 +-- .../manager/components/CommentsPanel/index.js | 2 +- .../manager/components/CommentsPanel/style.js | 8 +-- .../containers/CommentsPanel/dataStore.js | 10 ++-- .../manager/containers/CommentsPanel/index.js | 8 +-- packages/addon-comments/src/manager/index.js | 2 +- packages/addon-comments/src/stories/index.js | 18 +++---- .../addon-comments/src/tests/dataStore.js | 14 ++--- packages/addon-graphql/demo/index.js | 14 ++--- .../src/components/FullScreen/style.js | 4 +- packages/addon-graphql/src/preview.js | 2 +- packages/addon-info/example/Button.js | 4 +- packages/addon-info/example/story.js | 22 ++++---- packages/addon-info/src/components/Node.js | 8 +-- .../addon-info/src/components/PropTable.js | 6 +-- packages/addon-info/src/components/PropVal.js | 18 +++---- packages/addon-info/src/components/Props.js | 6 +-- packages/addon-info/src/components/Story.js | 42 +++++++-------- .../src/components/markdown/code.js | 8 +-- .../src/components/markdown/htags.js | 12 ++--- .../src/components/markdown/text.js | 8 +-- packages/addon-info/src/components/theme.js | 2 +- packages/addon-info/src/index.js | 10 ++-- packages/addon-knobs/example/stories/index.js | 4 +- packages/addon-knobs/src/KnobManager.js | 4 +- packages/addon-knobs/src/components/Panel.js | 14 ++--- .../addon-knobs/src/components/PropField.js | 12 ++--- .../addon-knobs/src/components/PropForm.js | 6 +-- .../addon-knobs/src/components/WrapStory.js | 2 +- .../addon-knobs/src/components/tests/Array.js | 2 +- .../addon-knobs/src/components/tests/Panel.js | 34 ++++++------ .../addon-knobs/src/components/types/Array.js | 4 +- .../src/components/types/Boolean.js | 4 +- .../addon-knobs/src/components/types/Color.js | 18 +++---- .../src/components/types/Date/index.js | 2 +- .../src/components/types/Number.js | 4 +- .../src/components/types/Object.js | 6 +-- .../src/components/types/Select.js | 6 +-- .../addon-knobs/src/components/types/Text.js | 4 +- .../addon-knobs/src/components/types/index.js | 2 +- packages/addon-knobs/src/index.js | 4 +- packages/addon-knobs/src/register.js | 2 +- packages/addon-knobs/src/tests/KnobManager.js | 18 +++---- packages/addon-knobs/src/tests/typescript.js | 2 +- packages/channel/src/__tests__/index.js | 6 +-- packages/decorator-centered/src/index.js | 2 +- packages/getstorybook/bin/generate.js | 6 +-- .../getstorybook/generators/METEOR/index.js | 2 +- .../REACT/template/stories/Button.js | 4 +- .../REACT/template/stories/Welcome.js | 10 ++-- .../template/storybook/index.android.js | 2 +- .../template/storybook/index.ios.js | 2 +- .../storybook/stories/CenterView/style.js | 4 +- .../storybook/stories/Welcome/index.js | 8 +-- .../template/src/stories/Button.js | 4 +- .../template/src/stories/Welcome.js | 12 ++--- .../WEBPACK_REACT/template/stories/Button.js | 4 +- .../WEBPACK_REACT/template/stories/Welcome.js | 12 ++--- packages/getstorybook/lib/project_types.js | 2 +- .../src/components/Docs/Container/index.js | 4 +- .../src/components/Docs/Content/index.js | 4 +- .../src/components/Docs/Nav/dropdown.js | 2 +- .../src/components/Docs/Nav/index.js | 2 +- .../src/components/Docs/Navigation/index.js | 4 +- .../src/components/Docs/Navigation/styles.js | 14 ++--- .../src/components/Docs/index.js | 4 +- .../src/components/Homepage/Featured/index.js | 2 +- .../src/components/Homepage/Header/index.js | 4 +- .../src/components/Homepage/index.js | 16 +++--- .../getstorybookio/src/containers/Docs.js | 4 +- packages/getstorybookio/src/docs/index.js | 8 +-- .../react-storybook/addons/addon-gallery.js | 2 +- .../src/docs/react-storybook/addons/api.js | 2 +- .../react-storybook/addons/introduction.js | 4 +- .../react-storybook/addons/using-addons.js | 4 +- .../react-storybook/addons/writing-addons.js | 4 +- .../basics/exporting-storybook.js | 2 +- .../src/docs/react-storybook/basics/faq.js | 2 +- .../react-storybook/basics/introduction.js | 4 +- .../basics/quick-start-guide.js | 2 +- .../basics/slow-start-guide.js | 4 +- .../react-storybook/basics/writing-stories.js | 4 +- .../configurations/add-custom-head-tags.js | 2 +- .../configurations/cli-options.js | 2 +- .../configurations/custom-babel-config.js | 2 +- .../configurations/custom-webpack-config.js | 2 +- .../configurations/default-config.js | 2 +- .../configurations/env-vars.js | 2 +- .../configurations/serving-static-files.js | 2 +- .../src/docs/react-storybook/index.js | 18 +++---- .../testing/css-style-testing.js | 2 +- .../testing/interaction-testing.js | 2 +- .../react-storybook/testing/manual-testing.js | 2 +- .../testing/react-ui-testing.js | 2 +- .../testing/structural-testing.js | 2 +- .../src/docs/storybook-hub/basics/comments.js | 2 +- .../storybook-hub/basics/getting-started.js | 2 +- .../basics/github-pr-integration.js | 2 +- .../basics/private-or-public-apps.js | 2 +- .../src/docs/storybook-hub/basics/security.js | 2 +- .../src/docs/storybook-hub/index.js | 10 ++-- .../management-features/env-variables.js | 2 +- .../private-npm-packages.js | 2 +- .../management-features/sharing-storybooks.js | 2 +- .../management-features/workspaces.js | 2 +- packages/getstorybookio/src/index.js | 2 +- packages/getstorybookio/src/lib/highlight.js | 2 +- packages/getstorybookio/src/stories/data.js | 34 ++++++------ .../getstorybookio/src/stories/designs.js | 26 +++++----- .../src/stories/implementations.js | 2 +- .../getstorybookio/src/stories/with_design.js | 18 +++---- .../src/bin/storybook-start.js | 6 +-- .../src/preview/components/StoryView/style.js | 6 +-- .../src/preview/story_kind.js | 2 +- .../src/preview/story_store.js | 4 +- .../src/server/config.js | 4 +- .../src/server/config/babel.js | 10 ++-- .../src/server/config/babel.prod.js | 10 ++-- .../server/config/defaults/webpack.config.js | 24 ++++----- .../src/server/config/webpack.config.js | 14 ++--- .../src/server/config/webpack.config.prod.js | 22 ++++---- .../src/server/middleware.js | 6 +-- .../demo/src/stories/Button.js | 4 +- .../demo/src/stories/Welcome.js | 12 ++--- .../react-storybook/scripts/mocha_runner.js | 2 +- .../src/client/manager/preview.js | 4 +- .../src/client/manager/provider.js | 2 +- .../client/preview/__tests__/client_api.js | 32 ++++++------ .../src/client/preview/actions.js | 10 ++-- .../src/client/preview/client_api.js | 6 +-- .../src/client/preview/error_display.js | 8 +-- .../src/client/preview/reducer.js | 6 +-- .../src/client/preview/render.js | 6 +-- .../src/client/preview/story_store.js | 4 +- .../src/server/__tests__/utils.js | 6 +-- .../src/server/babel_config.js | 2 +- packages/react-storybook/src/server/build.js | 8 +-- packages/react-storybook/src/server/config.js | 8 +-- .../src/server/config/babel.js | 2 +- .../src/server/config/babel.prod.js | 2 +- .../server/config/defaults/webpack.config.js | 28 +++++----- .../src/server/config/utils.js | 4 +- .../src/server/config/webpack.config.js | 18 +++---- .../src/server/config/webpack.config.prod.js | 22 ++++---- .../react-storybook/src/server/iframe.html.js | 6 +-- .../react-storybook/src/server/index.html.js | 6 +-- packages/react-storybook/src/server/index.js | 12 ++--- .../react-storybook/src/server/middleware.js | 2 +- .../react-storybook/src/server/track_usage.js | 6 +-- .../storybook-ui/example/client/preview.js | 6 +-- .../storybook-ui/example/client/provider.js | 22 ++++---- packages/storybook-ui/example/server.js | 2 +- .../storybook-ui/example/webpack.config.js | 12 ++--- packages/storybook-ui/src/compose.js | 4 +- packages/storybook-ui/src/context.js | 2 +- packages/storybook-ui/src/index.js | 2 +- packages/storybook-ui/src/libs/key_events.js | 2 +- .../src/modules/api/actions/__tests__/api.js | 52 +++++++++---------- .../src/modules/api/actions/api.js | 12 ++--- .../src/modules/api/actions/index.js | 2 +- .../modules/api/configs/__tests__/init_api.js | 36 ++++++------- .../src/modules/api/configs/init_api.js | 2 +- .../storybook-ui/src/modules/api/index.js | 6 +-- .../shortcuts/actions/__tests__/shortcuts.js | 8 +-- .../src/modules/shortcuts/actions/index.js | 2 +- .../modules/shortcuts/actions/shortcuts.js | 10 ++-- .../src/modules/shortcuts/index.js | 6 +-- .../src/modules/ui/actions/__tests__/ui.js | 6 +-- .../src/modules/ui/actions/index.js | 2 +- .../storybook-ui/src/modules/ui/actions/ui.js | 2 +- .../components/down_panel/__tests__/index.js | 14 ++--- .../modules/ui/components/down_panel/index.js | 2 +- .../modules/ui/components/down_panel/style.js | 14 ++--- .../ui/components/layout/__tests__/index.js | 8 +-- .../ui/components/layout/dimensions.js | 14 ++--- .../modules/ui/components/layout/hsplit.js | 4 +- .../src/modules/ui/components/layout/index.js | 28 +++++----- .../modules/ui/components/layout/vsplit.js | 4 +- .../components/left_panel/__tests__/index.js | 6 +-- .../left_panel/__tests__/stories.js | 14 ++++- .../ui/components/left_panel/header.js | 10 ++-- .../modules/ui/components/left_panel/index.js | 6 +-- .../ui/components/left_panel/stories.js | 12 ++--- .../ui/components/left_panel/text_filter.js | 12 ++--- .../src/modules/ui/components/search_box.js | 8 +-- .../modules/ui/components/shortcuts_help.js | 20 +++---- .../src/modules/ui/components/theme.js | 2 +- .../ui/configs/__tests__/handle_keyevents.js | 24 ++++----- .../ui/configs/__tests__/handle_routing.js | 24 ++++----- .../ui/configs/__tests__/init_panels.js | 8 +-- .../src/modules/ui/configs/handle_routing.js | 12 ++--- .../ui/containers/__tests__/down_panel.js | 14 ++--- .../modules/ui/containers/__tests__/layout.js | 4 +- .../ui/containers/__tests__/left_panel.js | 44 ++++++++-------- .../ui/containers/__tests__/shortcuts_help.js | 8 +-- .../src/modules/ui/containers/down_panel.js | 2 +- .../src/modules/ui/containers/left_panel.js | 2 +- .../src/modules/ui/containers/search_box.js | 2 +- .../modules/ui/containers/shortcuts_help.js | 2 +- packages/storybook-ui/src/modules/ui/index.js | 4 +- .../src/modules/ui/libs/__tests__/filters.js | 6 +-- .../ui/libs/__tests__/gen_podda_loader.js | 10 ++-- packages/storyshots/src/index.js | 4 +- .../storyshots/src/storybook-channel-mock.js | 2 +- .../stories/directly_required/Button.js | 4 +- .../stories/required_with_context/Button.js | 4 +- .../stories/required_with_context/Welcome.js | 10 ++-- 220 files changed, 866 insertions(+), 857 deletions(-) rename .eslintrc => .eslintrc.js (54%) diff --git a/.eslintrc b/.eslintrc.js similarity index 54% rename from .eslintrc rename to .eslintrc.js index a8be29392b99..857240134656 100644 --- a/.eslintrc +++ b/.eslintrc.js @@ -1,17 +1,17 @@ -{ +module.exports = { "extends": [ - "./node_modules/eslint-config-airbnb-base/rules/es6.js" + "./node_modules/eslint-config-airbnb-base/rules/es6.js", ], "plugins": [ - "prettier" + "prettier", ], "parser": "babel-eslint", "parserOptions": { - "sourceType": "module" + "sourceType": "module", }, "env": { "es6": true, - "node": true + "node": true, }, "rules": { "strict": 0, @@ -19,11 +19,10 @@ "printWidth": 100, "tabWidth": 2, "bracketSpacing": true, - # "trailingComma": "es5", - "singleQuote": true + "trailingComma": "all", + "singleQuote": true, }], "quotes": ["warn", "single"], - "arrow-parens": ["warn", "as-needed"] - # "comma-dangle": ["warn", "always"] - } + "arrow-parens": ["warn", "as-needed"], + }, } diff --git a/package.json b/package.json index 9e97e82e8ecb..c9cff6725965 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,13 @@ { "name": "storybook", "devDependencies": { - "babel-eslint": "^7.2.1", + "babel-eslint": "^7.2.2", "eslint": "^3.19.0", - "eslint-config-airbnb-base": "^11.1.2", + "eslint-config-airbnb-base": "^11.1.3", "eslint-plugin-import": "^2.2.0", "eslint-plugin-prettier": "^2.0.1", - "lerna": "2.0.0-rc.1", - "prettier": "^0.22.0" + "lerna": "2.0.0-rc.2", + "prettier": "^1.1.0" }, "scripts": { "postinstall": "lerna bootstrap", diff --git a/packages/addon-actions/src/components/ActionLogger/index.js b/packages/addon-actions/src/components/ActionLogger/index.js index 4ecfd31ad1a5..18790dcafa2b 100644 --- a/packages/addon-actions/src/components/ActionLogger/index.js +++ b/packages/addon-actions/src/components/ActionLogger/index.js @@ -13,7 +13,7 @@ class ActionLogger extends Component { () => { latest.style.borderLeft = borderLeft; }, - 300 + 300, ); } } @@ -53,7 +53,7 @@ class ActionLogger extends Component { ActionLogger.propTypes = { onClear: PropTypes.func, - actions: PropTypes.array + actions: PropTypes.array, }; export default ActionLogger; diff --git a/packages/addon-actions/src/components/ActionLogger/style.js b/packages/addon-actions/src/components/ActionLogger/style.js index d370a9b8c31f..d82497e1adad 100644 --- a/packages/addon-actions/src/components/ActionLogger/style.js +++ b/packages/addon-actions/src/components/ActionLogger/style.js @@ -2,14 +2,14 @@ export default { wrapper: { flex: 1, display: 'flex', - position: 'relative' + position: 'relative', }, actions: { flex: 1, margin: 0, padding: '8px 2px 20px 0', overflowY: 'auto', - color: '#666' + color: '#666', }, action: { display: 'flex', @@ -17,21 +17,21 @@ export default { borderLeft: '5px solid white', borderBottom: '1px solid #fafafa', transition: 'all 0.1s', - alignItems: 'center' + alignItems: 'center', }, countwrap: { - paddingBottom: 2 + paddingBottom: 2, }, counter: { margin: '0 5px 0 5px', backgroundColor: '#777777', color: '#ffffff', padding: '1px 5px', - borderRadius: '20px' + borderRadius: '20px', }, inspector: { flex: 1, - padding: '0 0 0 5px' + padding: '0 0 0 5px', }, button: { position: 'absolute', @@ -44,6 +44,6 @@ export default { padding: '5px 10px', borderRadius: '4px 0 0 0', color: 'rgba(0, 0, 0, 0.5)', - outline: 'none' - } + outline: 'none', + }, }; diff --git a/packages/addon-actions/src/containers/ActionLogger/index.js b/packages/addon-actions/src/containers/ActionLogger/index.js index 49c70ef1b1a2..a4668784b059 100644 --- a/packages/addon-actions/src/containers/ActionLogger/index.js +++ b/packages/addon-actions/src/containers/ActionLogger/index.js @@ -38,7 +38,7 @@ export default class ActionLogger extends React.Component { render() { const props = { actions: this.state.actions, - onClear: () => this.clearActions() + onClear: () => this.clearActions(), }; return ; } diff --git a/packages/addon-actions/src/manager.js b/packages/addon-actions/src/manager.js index 14c80cc4fff4..4728e7ac6d3d 100644 --- a/packages/addon-actions/src/manager.js +++ b/packages/addon-actions/src/manager.js @@ -8,7 +8,7 @@ export function register() { const channel = addons.getChannel(); addons.addPanel(PANEL_ID, { title: 'Action Logger', - render: () => + render: () => , }); }); } diff --git a/packages/addon-actions/src/preview.js b/packages/addon-actions/src/preview.js index 963ab29d28b8..a2dfd1b31a0f 100644 --- a/packages/addon-actions/src/preview.js +++ b/packages/addon-actions/src/preview.js @@ -16,7 +16,7 @@ export function action(name) { const randomId = Math.random().toString(16).slice(2); channel.emit(EVENT_ID, { id: randomId, - data: { name, args } + data: { name, args }, }); }; diff --git a/packages/addon-comments/src/index.js b/packages/addon-comments/src/index.js index 99555c12786d..4a7863a01254 100644 --- a/packages/addon-comments/src/index.js +++ b/packages/addon-comments/src/index.js @@ -7,7 +7,7 @@ const buttonStyles = { backgroundColor: '#FFFFFF', cursor: 'pointer', fontSize: 15, - padding: '3px 10px' + padding: '3px 10px', }; const Button = ({ children, onClick, style = {} }) => ( @@ -19,7 +19,7 @@ const Button = ({ children, onClick, style = {} }) => ( Button.propTypes = { children: PropTypes.string.isRequired, onClick: PropTypes.func, - style: PropTypes.object + style: PropTypes.object, }; export default Button; diff --git a/packages/addon-comments/src/manager/components/CommentForm/index.js b/packages/addon-comments/src/manager/components/CommentForm/index.js index 9eda02fe05f6..c2259db8fdcb 100644 --- a/packages/addon-comments/src/manager/components/CommentForm/index.js +++ b/packages/addon-comments/src/manager/components/CommentForm/index.js @@ -17,7 +17,7 @@ marked.setOptions({ pedantic: false, sanitize: true, smartLists: true, - smartypants: false + smartypants: false, }); export default class CommentForm extends Component { @@ -85,5 +85,5 @@ export default class CommentForm extends Component { } CommentForm.propTypes = { - addComment: PropTypes.func + addComment: PropTypes.func, }; diff --git a/packages/addon-comments/src/manager/components/CommentForm/style.js b/packages/addon-comments/src/manager/components/CommentForm/style.js index 3efb44b649f6..99ec998e9ff4 100644 --- a/packages/addon-comments/src/manager/components/CommentForm/style.js +++ b/packages/addon-comments/src/manager/components/CommentForm/style.js @@ -7,19 +7,19 @@ const button = { padding: '7px 15px', fontSize: 12, lineHeight: 1, - color: 'rgba(0, 0, 0, 0.5)' + color: 'rgba(0, 0, 0, 0.5)', }; export default { wrapper: { display: 'flex', alignItems: 'center', - borderTop: '1px solid rgb(234, 234, 234)' + borderTop: '1px solid rgb(234, 234, 234)', }, submitButton: { ...button, cursor: 'pointer', - borderRadius: '0 0 4px 0' + borderRadius: '0 0 4px 0', }, input: { flex: 1, @@ -34,6 +34,6 @@ export default { lineHeight: 1.6, color: 'rgba(0, 0, 0, 0.8)', fontFamily: 'sans-serif', - resize: 'none' - } + resize: 'none', + }, }; diff --git a/packages/addon-comments/src/manager/components/CommentItem/index.js b/packages/addon-comments/src/manager/components/CommentItem/index.js index 88cc0122b7f6..023c451eb9ea 100644 --- a/packages/addon-comments/src/manager/components/CommentItem/index.js +++ b/packages/addon-comments/src/manager/components/CommentItem/index.js @@ -74,5 +74,5 @@ export default class CommentItem extends Component { CommentItem.propTypes = { deleteComment: PropTypes.func, comment: PropTypes.object, - ownComment: PropTypes.bool + ownComment: PropTypes.bool, }; diff --git a/packages/addon-comments/src/manager/components/CommentItem/style.js b/packages/addon-comments/src/manager/components/CommentItem/style.js index fd3388d98e2f..b27c4942e3af 100644 --- a/packages/addon-comments/src/manager/components/CommentItem/style.js +++ b/packages/addon-comments/src/manager/components/CommentItem/style.js @@ -2,28 +2,28 @@ const commentItem = { display: 'flex', paddingBottom: '5px', WebkitFontSmoothing: 'antialiased', - transition: 'opacity 0.5s' + transition: 'opacity 0.5s', }; export default { commentItem: { - ...commentItem + ...commentItem, }, commentItemloading: { ...commentItem, - opacity: 0.25 + opacity: 0.25, }, commentAside: { - margin: '5px 10px 0 0' + margin: '5px 10px 0 0', }, commentAvatar: { width: 32, height: 32, - borderRadius: 5 + borderRadius: 5, }, commentContent: { position: 'relative', - flex: 1 + flex: 1, }, commentHead: { // @@ -33,19 +33,19 @@ export default { fontSize: 13, lineHeight: 1, fontWeight: 'bold', - marginRight: 5 + marginRight: 5, }, commentTime: { fontFamily: 'sans-serif', fontSize: 11, lineHeight: 1, - color: 'rgb(150, 150, 150)' + color: 'rgb(150, 150, 150)', }, commentText: { fontFamily: 'sans-serif', fontSize: 13, lineHeight: 1.7, - maxWidth: 650 + maxWidth: 650, }, commentDelete: { fontFamily: 'sans-serif', @@ -53,6 +53,6 @@ export default { top: 2, right: 0, fontSize: 11, - color: 'rgb(200, 200, 200)' - } + color: 'rgb(200, 200, 200)', + }, }; diff --git a/packages/addon-comments/src/manager/components/CommentList/index.js b/packages/addon-comments/src/manager/components/CommentList/index.js index b122369052e4..790c659153a5 100644 --- a/packages/addon-comments/src/manager/components/CommentList/index.js +++ b/packages/addon-comments/src/manager/components/CommentList/index.js @@ -53,5 +53,5 @@ export default class CommentList extends Component { CommentList.propTypes = { comments: PropTypes.array, user: PropTypes.object, - deleteComment: PropTypes.func + deleteComment: PropTypes.func, }; diff --git a/packages/addon-comments/src/manager/components/CommentList/style.js b/packages/addon-comments/src/manager/components/CommentList/style.js index e502e4654f04..8b9aab9d0af1 100644 --- a/packages/addon-comments/src/manager/components/CommentList/style.js +++ b/packages/addon-comments/src/manager/components/CommentList/style.js @@ -2,11 +2,11 @@ export default { wrapper: { flex: 1, overflow: 'auto', - padding: '7px 15px' + padding: '7px 15px', }, noComments: { fontFamily: 'sans-serif', fontSize: 13, - padding: '10px 0' - } + padding: '10px 0', + }, }; diff --git a/packages/addon-comments/src/manager/components/CommentsPanel/index.js b/packages/addon-comments/src/manager/components/CommentsPanel/index.js index f5832a58838c..0c09975c852f 100644 --- a/packages/addon-comments/src/manager/components/CommentsPanel/index.js +++ b/packages/addon-comments/src/manager/components/CommentsPanel/index.js @@ -39,5 +39,5 @@ export default class CommentsPanel extends Component { CommentsPanel.propTypes = { loading: PropTypes.bool, user: PropTypes.object, - appNotAvailable: PropTypes.bool + appNotAvailable: PropTypes.bool, }; diff --git a/packages/addon-comments/src/manager/components/CommentsPanel/style.js b/packages/addon-comments/src/manager/components/CommentsPanel/style.js index 6f92dfce5ecf..00ca94c7ae17 100644 --- a/packages/addon-comments/src/manager/components/CommentsPanel/style.js +++ b/packages/addon-comments/src/manager/components/CommentsPanel/style.js @@ -3,7 +3,7 @@ export default { flex: 1, display: 'flex', flexDirection: 'column', - position: 'relative' + position: 'relative', }, message: { flex: 1, @@ -15,7 +15,7 @@ export default { fontSize: 11, letterSpacing: 1, textDecoration: 'none', - textTransform: 'uppercase' + textTransform: 'uppercase', }, button: { textDecoration: 'none', @@ -24,6 +24,6 @@ export default { background: 'rgb(240, 240, 240)', borderRadius: 5, textTransform: 'none', - fontSize: 12 - } + fontSize: 12, + }, }; diff --git a/packages/addon-comments/src/manager/containers/CommentsPanel/dataStore.js b/packages/addon-comments/src/manager/containers/CommentsPanel/dataStore.js index 7c0523f2ef29..ce21a583dcf5 100644 --- a/packages/addon-comments/src/manager/containers/CommentsPanel/dataStore.js +++ b/packages/addon-comments/src/manager/containers/CommentsPanel/dataStore.js @@ -19,7 +19,7 @@ export default class DataStore { const key = this._getStoryKey(currentStory); this.cache[key] = { comments, - addedAt: Date.now() + addedAt: Date.now(), }; } @@ -50,7 +50,7 @@ export default class DataStore { () => { this._loadUsers().then(() => this._loadComments()); }, - 1000 * 60 // Reload for every minute + 1000 * 60, // Reload for every minute ); } @@ -97,12 +97,12 @@ export default class DataStore { this.users = users.reduce( (newUsers, user) => { const usersObj = { - ...newUsers + ...newUsers, }; usersObj[user.id] = user; return usersObj; }, - {} + {}, ); }); }); @@ -193,7 +193,7 @@ export default class DataStore { const doc = { ...comment, ...this.currentStory, - sbProtected: true + sbProtected: true, }; return this.db.getCollection('comments').set(doc); diff --git a/packages/addon-comments/src/manager/containers/CommentsPanel/index.js b/packages/addon-comments/src/manager/containers/CommentsPanel/index.js index 703a68cd36db..dcb5ef8d23de 100644 --- a/packages/addon-comments/src/manager/containers/CommentsPanel/index.js +++ b/packages/addon-comments/src/manager/containers/CommentsPanel/index.js @@ -14,7 +14,7 @@ export default class Container extends Component { user: null, users: [], comments: [], - loading: true + loading: true, }; } @@ -86,7 +86,7 @@ export default class Container extends Component { const comment = { text, time, - userId: user.id + userId: user.id, }; this.store.addComment(comment); @@ -103,7 +103,7 @@ export default class Container extends Component { loading: this.state.loading, appNotAvailable: this.state.appNotAvailable, deleteComment: commentId => this.deleteComment(commentId), - addComment: text => this.addComment(text) + addComment: text => this.addComment(text), }; return ; @@ -111,5 +111,5 @@ export default class Container extends Component { } Container.propTypes = { - api: PropTypes.object + api: PropTypes.object, }; diff --git a/packages/addon-comments/src/manager/index.js b/packages/addon-comments/src/manager/index.js index 207bfacdc63f..574d224494c0 100644 --- a/packages/addon-comments/src/manager/index.js +++ b/packages/addon-comments/src/manager/index.js @@ -10,7 +10,7 @@ export function init() { // add 'Comments' panel addons.addPanel(PANEL_ID, { title: 'Comments', - render: () => + render: () => , }); }); } diff --git a/packages/addon-comments/src/stories/index.js b/packages/addon-comments/src/stories/index.js index 245ebe2741a2..98a7783dfe2c 100644 --- a/packages/addon-comments/src/stories/index.js +++ b/packages/addon-comments/src/stories/index.js @@ -7,7 +7,7 @@ import CommentsPanel from '../manager/components/CommentsPanel'; const userObj = { avatar: 'http://www.gravatar.com/avatar/?d=identicon', - name: 'User A' + name: 'User A', }; const commentsList = [ @@ -15,29 +15,29 @@ const commentsList = [ loading: false, user: { avatar: 'http://www.gravatar.com/avatar/?d=identicon', - name: 'User A' + name: 'User A', }, time: 'Wed Oct 12 2016 13:36:59 GMT+0530 (IST)', - text: 'Lorem ipsum dolor sit amet,
Ut odio massa, rutrum et purus id.
' + text: 'Lorem ipsum dolor sit amet,
Ut odio massa, rutrum et purus id.
', }, { loading: false, user: { avatar: 'http://www.gravatar.com/avatar/?d=identicon', - name: 'User B' + name: 'User B', }, time: 'Wed Oct 12 2016 13:38:46 GMT+0530 (IST)', - text: 'Vivamus tortor nisi, efficitur in rutrum ac, tempor et mauris. In et rutrum enim' + text: 'Vivamus tortor nisi, efficitur in rutrum ac, tempor et mauris. In et rutrum enim', }, { loading: true, user: { avatar: 'http://www.gravatar.com/avatar/?d=identicon', - name: 'User C' + name: 'User C', }, time: 'Wed Oct 12 2016 13:38:55 GMT+0530 (IST)', - text: 'sample comment 3' - } + text: 'sample comment 3', + }, ]; storiesOf('Button', module) @@ -47,7 +47,7 @@ storiesOf('Button', module) const style = { fontSize: 20, textTransform: 'uppercase', - color: '#FF8833' + color: '#FF8833', }; return ; }); diff --git a/packages/addon-comments/src/tests/dataStore.js b/packages/addon-comments/src/tests/dataStore.js index d2e9fce6fb44..110de0afed7d 100644 --- a/packages/addon-comments/src/tests/dataStore.js +++ b/packages/addon-comments/src/tests/dataStore.js @@ -17,14 +17,14 @@ const myDb = { }, set() { return new Promise(dbSetPromiseReturn); - } + }, }; }, persister: { _getAppInfo() { return Promise.resolve(true); - } - } + }, + }, }; addons.setDatabase(myDb); @@ -38,14 +38,14 @@ describe('DataStore', () => { expect(dbGetPromiseReturn.called).to.equal(false); expect(theStore.currentStory).to.deep.equal({ sbKind: 'Components', - sbStory: 'CommentList - No Comments' + sbStory: 'CommentList - No Comments', }); }); it('set current user', () => { theStore.setCurrentUser({ id: 'user-id', - name: 'user-name' + name: 'user-name', }); expect(theStore.user).to.deep.equal({ id: 'user-id', name: 'user-name' }); @@ -57,7 +57,7 @@ describe('DataStore', () => { expect(dbGetPromiseReturn.called).to.equal(true); expect(theStore.currentStory).to.deep.equal({ sbKind: 'Components', - sbStory: 'CommentList - No Comments' + sbStory: 'CommentList - No Comments', }); }); @@ -65,7 +65,7 @@ describe('DataStore', () => { const comment = { text: 'sample comment', time: 1476435982029, - userId: 'user-id' + userId: 'user-id', }; theStore.addComment(comment); diff --git a/packages/addon-graphql/demo/index.js b/packages/addon-graphql/demo/index.js index b3852a0f68c7..debae1bb27e0 100644 --- a/packages/addon-graphql/demo/index.js +++ b/packages/addon-graphql/demo/index.js @@ -14,8 +14,8 @@ const userType = new graphql.GraphQLObjectType({ name: 'User', fields: { id: { type: graphql.GraphQLString }, - name: { type: graphql.GraphQLString } - } + name: { type: graphql.GraphQLString }, + }, }); // Define the schema with one top-level field, `user`, that @@ -30,7 +30,7 @@ const schema = new graphql.GraphQLSchema({ type: userType, // `args` describes the arguments that the `user` query accepts args: { - id: { type: graphql.GraphQLString } + id: { type: graphql.GraphQLString }, }, // The resolve function describes how to "resolve" or fulfill // the incoming query. @@ -38,10 +38,10 @@ const schema = new graphql.GraphQLSchema({ // to get the User from `data` resolve(_, args) { return data[args.id]; - } - } - } - }) + }, + }, + }, + }), }); express().use(cors()).use('/graphql', graphqlHTTP({ schema, pretty: true })).listen(3000); diff --git a/packages/addon-graphql/src/components/FullScreen/style.js b/packages/addon-graphql/src/components/FullScreen/style.js index 5001a7e1f9cc..9d36b5a767d9 100644 --- a/packages/addon-graphql/src/components/FullScreen/style.js +++ b/packages/addon-graphql/src/components/FullScreen/style.js @@ -4,6 +4,6 @@ export default { top: 0, right: 0, bottom: 0, - left: 0 - } + left: 0, + }, }; diff --git a/packages/addon-graphql/src/preview.js b/packages/addon-graphql/src/preview.js index cda20a3ae1e0..54807c35c078 100644 --- a/packages/addon-graphql/src/preview.js +++ b/packages/addon-graphql/src/preview.js @@ -5,7 +5,7 @@ import 'graphiql/graphiql.css'; const FETCH_OPTIONS = { method: 'post', - headers: { 'Content-Type': 'application/json' } + headers: { 'Content-Type': 'application/json' }, }; function getDefautlFetcher(url) { diff --git a/packages/addon-info/example/Button.js b/packages/addon-info/example/Button.js index 1fd1c16b38ca..df7c34c01288 100644 --- a/packages/addon-info/example/Button.js +++ b/packages/addon-info/example/Button.js @@ -13,8 +13,8 @@ Object.assign(Button, { label: PropTypes.string.isRequired, style: PropTypes.object, disabled: PropTypes.bool, - onClick: PropTypes.func - } + onClick: PropTypes.func, + }, }); export default Button; diff --git a/packages/addon-info/example/story.js b/packages/addon-info/example/story.js index 4021b96fdb7c..e24e26a5b0d8 100644 --- a/packages/addon-info/example/story.js +++ b/packages/addon-info/example/story.js @@ -16,7 +16,7 @@ storiesOf('Button').addWithInfo( Click the "?" mark at top-right to view the info.

- ) + ), ); storiesOf('Button').addWithInfo( @@ -25,7 +25,7 @@ storiesOf('Button').addWithInfo( This is the basic usage with the button with providing a label to show the text. `, () =>