diff --git a/.eslintrc b/.eslintrc index 49166483..2f3cc99a 100644 --- a/.eslintrc +++ b/.eslintrc @@ -1,23 +1,16 @@ { - "extends": [ - "airbnb", - "prettier", - "prettier/react" - ], "parser": "babel-eslint", + "extends": ["react-app", "plugin:import/errors", "plugin:import/warnings"], + "plugins": [ + "prettier" + ], "rules": { - "arrow-body-style":[0, "as-needed"], // fix `this` shortcut on ES6 classes - "react/jsx-no-bind": 0, // Makes difficult to pass args to prop functions - "react/jsx-curly-spacing": [2, "always", {"spacing": { - "objectLiterals": "never" - }}], // Spaces inside curlies, except prop={{}} - "react/prefer-stateless-function": 0, // Don't prefer stateless components - "no-else-return": 0, - "new-cap": 0, - "no-param-reassign": 0, - no-unused-vars: ["error", { - "argsIgnorePattern": "^_", - }], + "import/order": "warn", + // Prettier automatically uses the least amount of parens possible, so this + // does more harm than good. + "no-mixed-operators": "off", + // Enforce that code is formatted with prettier. + "prettier/prettier": ["error", {"trailingComma": "es5", "singleQuote": true}] }, "settings" : { "import/resolver": { @@ -34,7 +27,6 @@ SLACK_KEY: true, SLACK_REDIRECT_URI: true, DEPLOYMENT: true, - afterAll: true }, } diff --git a/frontend/components/Alert/Alert.js b/frontend/components/Alert/Alert.js index 69e0863c..07280484 100644 --- a/frontend/components/Alert/Alert.js +++ b/frontend/components/Alert/Alert.js @@ -1,9 +1,8 @@ import React, { PropTypes } from 'react'; - import { Flex } from 'reflexbox'; - -import styles from './Alert.scss'; import classNames from 'classnames/bind'; +import styles from './Alert.scss'; + const cx = classNames.bind(styles); class Alert extends React.Component { @@ -12,9 +11,8 @@ class Alert extends React.Component { danger: PropTypes.bool, warning: PropTypes.bool, success: PropTypes.bool, - info: PropTypes.bool, offline: PropTypes.bool, - } + }; render() { let alertType; @@ -25,8 +23,12 @@ class Alert extends React.Component { if (!alertType) alertType = 'info'; // default return ( - - { this.props.children } + + {this.props.children} ); } diff --git a/frontend/components/AtlasPreview/AtlasPreview.js b/frontend/components/AtlasPreview/AtlasPreview.js index 6eca19c3..a6d70922 100644 --- a/frontend/components/AtlasPreview/AtlasPreview.js +++ b/frontend/components/AtlasPreview/AtlasPreview.js @@ -8,29 +8,29 @@ import styles from './AtlasPreview.scss'; // import classNames from 'classnames/bind'; // const cx = classNames.bind(styles); -@observer -class AtlasPreview extends React.Component { +@observer class AtlasPreview extends React.Component { static propTypes = { data: React.PropTypes.object.isRequired, - } + }; render() { const data = this.props.data; return ( -
-

{ data.name }

- { data.recentDocuments.length > 0 ? - data.recentDocuments.map(document => { - return ( - - ); - }) - : ( -
- No documents. Why not create one? -
- ) } +
+

+ {data.name} +

+ {data.recentDocuments.length > 0 + ? data.recentDocuments.map(document => { + return ; + }) + :
+ No documents. Why not + {' '} + create one + ? +
}
); } diff --git a/frontend/components/AtlasPreview/components/DocumentLink/DocumentLink.js b/frontend/components/AtlasPreview/components/DocumentLink/DocumentLink.js index b413a23b..59a849ac 100644 --- a/frontend/components/AtlasPreview/components/DocumentLink/DocumentLink.js +++ b/frontend/components/AtlasPreview/components/DocumentLink/DocumentLink.js @@ -1,16 +1,18 @@ import React from 'react'; -import { observer } from "mobx-react" +import { observer } from 'mobx-react'; import moment from 'moment'; import Link from 'react-router/lib/Link'; import styles from './DocumentLink.scss'; -const DocumentLink = observer((props) => { +const DocumentLink = observer(props => { return ( - -

{ props.document.title }

- { moment(props.document.updatedAt).fromNow() } + +

{props.document.title}

+ + {moment(props.document.updatedAt).fromNow()} + ); }); diff --git a/frontend/components/AtlasPreview/components/DocumentLink/index.js b/frontend/components/AtlasPreview/components/DocumentLink/index.js index 013b3098..bc6695bf 100644 --- a/frontend/components/AtlasPreview/components/DocumentLink/index.js +++ b/frontend/components/AtlasPreview/components/DocumentLink/index.js @@ -1,2 +1,2 @@ import DocumentLink from './DocumentLink'; -export default DocumentLink; \ No newline at end of file +export default DocumentLink; diff --git a/frontend/components/AtlasPreview/index.js b/frontend/components/AtlasPreview/index.js index 6b1ecbf5..f68aa0ae 100644 --- a/frontend/components/AtlasPreview/index.js +++ b/frontend/components/AtlasPreview/index.js @@ -1,2 +1,2 @@ import AtlasPreview from './AtlasPreview'; -export default AtlasPreview; \ No newline at end of file +export default AtlasPreview; diff --git a/frontend/components/AtlasPreviewLoading/AtlasPreviewLoading.js b/frontend/components/AtlasPreviewLoading/AtlasPreviewLoading.js index f77984e3..bf6fbcbb 100644 --- a/frontend/components/AtlasPreviewLoading/AtlasPreviewLoading.js +++ b/frontend/components/AtlasPreviewLoading/AtlasPreviewLoading.js @@ -7,37 +7,40 @@ const cx = classNames.bind(styles); import { randomInteger } from 'utils/random'; -const randomValues = Array.from(new Array(5), () => `${randomInteger(85, 100)}%`); +const randomValues = Array.from( + new Array(5), + () => `${randomInteger(85, 100)}%` +); -export default (_props) => { +export default _props => { return (
-
+
 
+ />
 
+ />
 
+ />
 
+ />
diff --git a/frontend/components/AtlasPreviewLoading/index.js b/frontend/components/AtlasPreviewLoading/index.js index ecf2a204..f9d8e078 100644 --- a/frontend/components/AtlasPreviewLoading/index.js +++ b/frontend/components/AtlasPreviewLoading/index.js @@ -1,2 +1,2 @@ import AtlasPreviewLoading from './AtlasPreviewLoading'; -export default AtlasPreviewLoading; \ No newline at end of file +export default AtlasPreviewLoading; diff --git a/frontend/components/Button/index.js b/frontend/components/Button/index.js index fbb219ae..4ae846f7 100644 --- a/frontend/components/Button/index.js +++ b/frontend/components/Button/index.js @@ -1,2 +1,2 @@ import Button from './Button'; -export default Button; \ No newline at end of file +export default Button; diff --git a/frontend/components/CenteredContent/CenteredContent.js b/frontend/components/CenteredContent/CenteredContent.js index b81e4def..aacf7626 100644 --- a/frontend/components/CenteredContent/CenteredContent.js +++ b/frontend/components/CenteredContent/CenteredContent.js @@ -2,15 +2,15 @@ import React from 'react'; import styles from './CenteredContent.scss'; -const CenteredContent = (props) => { +const CenteredContent = props => { const style = { maxWidth: props.maxWidth, ...props.style, }; return ( -
- { props.children } +
+ {props.children}
); }; @@ -24,4 +24,4 @@ CenteredContent.propTypes = { style: React.PropTypes.object, }; -export default CenteredContent; \ No newline at end of file +export default CenteredContent; diff --git a/frontend/components/CenteredContent/index.js b/frontend/components/CenteredContent/index.js index 1e05cad5..9524b627 100644 --- a/frontend/components/CenteredContent/index.js +++ b/frontend/components/CenteredContent/index.js @@ -1,2 +1,2 @@ import CenteredContent from './CenteredContent'; -export default CenteredContent; \ No newline at end of file +export default CenteredContent; diff --git a/frontend/components/Divider/Divider.js b/frontend/components/Divider/Divider.js index 1df40dc9..95a56206 100644 --- a/frontend/components/Divider/Divider.js +++ b/frontend/components/Divider/Divider.js @@ -2,10 +2,8 @@ import React from 'react'; import styles from './Divider.scss'; -const Divider = (props) => { - return( -
- ); +const Divider = props => { + return
; }; -export default Divider; \ No newline at end of file +export default Divider; diff --git a/frontend/components/Divider/index.js b/frontend/components/Divider/index.js index a4bf4cad..26c6df9e 100644 --- a/frontend/components/Divider/index.js +++ b/frontend/components/Divider/index.js @@ -1,2 +1,2 @@ import Divider from './Divider'; -export default Divider; \ No newline at end of file +export default Divider; diff --git a/frontend/components/Document/Document.js b/frontend/components/Document/Document.js index 1bfd9e7c..af53363d 100644 --- a/frontend/components/Document/Document.js +++ b/frontend/components/Document/Document.js @@ -7,23 +7,22 @@ import DocumentHtml from './components/DocumentHtml'; import styles from './Document.scss'; -@observer -class Document extends React.Component { +@observer class Document extends React.Component { static propTypes = { document: PropTypes.object.isRequired, - } + }; render() { return ( -
+
- +
); } diff --git a/frontend/components/Document/components/DocumentHtml/DocumentHtml.js b/frontend/components/Document/components/DocumentHtml/DocumentHtml.js index 7f0a0a1f..4b872f8e 100644 --- a/frontend/components/Document/components/DocumentHtml/DocumentHtml.js +++ b/frontend/components/Document/components/DocumentHtml/DocumentHtml.js @@ -4,19 +4,18 @@ import { observer } from 'mobx-react'; import styles from './DocumentHtml.scss'; -@observer -class DocumentHtml extends React.Component { +@observer class DocumentHtml extends React.Component { static propTypes = { html: PropTypes.string.isRequired, - } + }; componentDidMount = () => { this.setExternalLinks(); - } + }; componentDidUpdate = () => { this.setExternalLinks(); - } + }; setExternalLinks = () => { const links = ReactDOM.findDOMNode(this).querySelectorAll('a'); @@ -25,12 +24,12 @@ class DocumentHtml extends React.Component { link.target = '_blank'; // eslint-disable-line no-param-reassign } }); - } + }; render() { return (
); diff --git a/frontend/components/Document/index.js b/frontend/components/Document/index.js index a31bbbc2..29ee3ad7 100644 --- a/frontend/components/Document/index.js +++ b/frontend/components/Document/index.js @@ -2,6 +2,4 @@ import Document from './Document'; import DocumentHtml from './components/DocumentHtml'; export default Document; -export { - DocumentHtml, -}; +export { DocumentHtml }; diff --git a/frontend/components/DocumentList/DocumentList.js b/frontend/components/DocumentList/DocumentList.js index 2c9e83fe..34a83e03 100644 --- a/frontend/components/DocumentList/DocumentList.js +++ b/frontend/components/DocumentList/DocumentList.js @@ -8,22 +8,23 @@ import styles from './DocumentList.scss'; class DocumentList extends React.Component { static propTypes = { documents: React.PropTypes.arrayOf(React.PropTypes.object), - } + }; render() { return (
- { this.props.documents && this.props.documents.map((document) => { - return ( -
- - -
- ); - }) } + {this.props.documents && + this.props.documents.map(document => { + return ( +
+ + +
+ ); + })}
); } -}; +} -export default DocumentList; \ No newline at end of file +export default DocumentList; diff --git a/frontend/components/DocumentList/index.js b/frontend/components/DocumentList/index.js index 61f77a02..afe66f55 100644 --- a/frontend/components/DocumentList/index.js +++ b/frontend/components/DocumentList/index.js @@ -1,2 +1,2 @@ import DocumentList from './DocumentList'; -export default DocumentList; \ No newline at end of file +export default DocumentList; diff --git a/frontend/components/DocumentPreview/DocumentPreview.js b/frontend/components/DocumentPreview/DocumentPreview.js index 3c9c6fce..a609800d 100644 --- a/frontend/components/DocumentPreview/DocumentPreview.js +++ b/frontend/components/DocumentPreview/DocumentPreview.js @@ -10,33 +10,29 @@ import styles from './DocumentPreview.scss'; class Document extends React.Component { static propTypes = { document: React.PropTypes.object.isRequired, - } + }; render() { return ( -
+
- -

{ this.props.document.title }

+ +

{this.props.document.title}

-
+
- + Continue reading...
diff --git a/frontend/components/DocumentPreview/index.js b/frontend/components/DocumentPreview/index.js index 5f1c0852..c5569f97 100644 --- a/frontend/components/DocumentPreview/index.js +++ b/frontend/components/DocumentPreview/index.js @@ -1,2 +1,2 @@ import DocumentPreview from './DocumentPreview'; -export default DocumentPreview; \ No newline at end of file +export default DocumentPreview; diff --git a/frontend/components/DropdownMenu/DropdownMenu.js b/frontend/components/DropdownMenu/DropdownMenu.js index 8590d3bf..0726e468 100644 --- a/frontend/components/DropdownMenu/DropdownMenu.js +++ b/frontend/components/DropdownMenu/DropdownMenu.js @@ -10,14 +10,13 @@ class MenuItem extends React.Component { } else { this.props.onClick(); } - } + }; render() { return ( -
{ this.props.children }
+
+ {this.props.children} +
); } } @@ -34,46 +33,44 @@ class DropdownMenu extends React.Component { static propTypes = { label: React.PropTypes.node.isRequired, children: React.PropTypes.node.isRequired, - } + }; state = { menuVisible: false, - } + }; onMouseEnter = () => { this.setState({ menuVisible: true }); - } + }; onMouseLeave = () => { this.setState({ menuVisible: false }); - } + }; onClick = () => { this.setState({ menuVisible: !this.state.menuVisible }); - } + }; render() { return (
-
- { this.props.label } +
+ {this.props.label}
- { this.state.menuVisible ? ( -
- { this.props.children } -
- ) : null } + {this.state.menuVisible + ?
+ {this.props.children} +
+ : null}
); } -}; +} export default DropdownMenu; -export { - MenuItem, -} +export { MenuItem }; diff --git a/frontend/components/DropdownMenu/components/MoreIcon/MoreIcon.js b/frontend/components/DropdownMenu/components/MoreIcon/MoreIcon.js index 657dcbb5..ab1a2ed3 100644 --- a/frontend/components/DropdownMenu/components/MoreIcon/MoreIcon.js +++ b/frontend/components/DropdownMenu/components/MoreIcon/MoreIcon.js @@ -2,13 +2,8 @@ import React from 'react'; import styles from './MoreIcon.scss'; -const MoreIcon = (props) => { - return ( - - ); +const MoreIcon = props => { + return ; }; export default MoreIcon; diff --git a/frontend/components/DropdownMenu/index.js b/frontend/components/DropdownMenu/index.js index d33c25bc..ff7e3b3c 100644 --- a/frontend/components/DropdownMenu/index.js +++ b/frontend/components/DropdownMenu/index.js @@ -1,7 +1,4 @@ import DropdownMenu, { MenuItem } from './DropdownMenu'; import MoreIcon from './components/MoreIcon'; export default DropdownMenu; -export { - MenuItem, - MoreIcon, -}; +export { MenuItem, MoreIcon }; diff --git a/frontend/components/Icons/Markdown.js b/frontend/components/Icons/Markdown.js index 2d3caabb..239b0e4b 100644 --- a/frontend/components/Icons/Markdown.js +++ b/frontend/components/Icons/Markdown.js @@ -5,10 +5,10 @@ export default ({ style = {}, className }) => { { +const HeaderAction = props => { return ( -
{ props.children }
+
+ {props.children} +
); }; @@ -15,4 +14,4 @@ HeaderAction.propTypes = { onClick: React.PropTypes.func, }; -export default HeaderAction; \ No newline at end of file +export default HeaderAction; diff --git a/frontend/components/Layout/components/HeaderAction/index.js b/frontend/components/Layout/components/HeaderAction/index.js index bbaae86f..c25a3530 100644 --- a/frontend/components/Layout/components/HeaderAction/index.js +++ b/frontend/components/Layout/components/HeaderAction/index.js @@ -1,2 +1,2 @@ import HeaderAction from './HeaderAction'; -export default HeaderAction; \ No newline at end of file +export default HeaderAction; diff --git a/frontend/components/Layout/components/SaveAction/SaveAction.js b/frontend/components/Layout/components/SaveAction/SaveAction.js index a29f02ac..306ed37b 100644 --- a/frontend/components/Layout/components/SaveAction/SaveAction.js +++ b/frontend/components/Layout/components/SaveAction/SaveAction.js @@ -1,20 +1,19 @@ import React from 'react'; import { observer } from 'mobx-react'; -@observer -class SaveAction extends React.Component { +@observer class SaveAction extends React.Component { static propTypes = { onClick: React.PropTypes.func.isRequired, disabled: React.PropTypes.bool, isNew: React.PropTypes.bool, - } + }; - onClick = (event) => { + onClick = event => { if (this.props.disabled) return; event.preventDefault(); this.props.onClick(); - } + }; render() { const { disabled, isNew } = this.props; @@ -23,11 +22,11 @@ class SaveAction extends React.Component { ); diff --git a/frontend/components/Layout/components/Title/Title.js b/frontend/components/Layout/components/Title/Title.js index 9b8e4158..7dea7d38 100644 --- a/frontend/components/Layout/components/Title/Title.js +++ b/frontend/components/Layout/components/Title/Title.js @@ -10,7 +10,7 @@ class Title extends React.Component { children: React.PropTypes.string, truncate: React.PropTypes.number, placeholder: React.PropTypes.string, - } + }; render() { let title; @@ -28,12 +28,12 @@ class Title extends React.Component { return ( - { title && ( / ) } + {title &&  / } - { title } + {title} ); diff --git a/frontend/components/Layout/index.js b/frontend/components/Layout/index.js index a50754ae..8abf597f 100644 --- a/frontend/components/Layout/index.js +++ b/frontend/components/Layout/index.js @@ -5,8 +5,4 @@ import SaveAction from './components/SaveAction'; export default Layout; -export { - Title, - HeaderAction, - SaveAction, -}; +export { Title, HeaderAction, SaveAction }; diff --git a/frontend/components/LoadingIndicator/LoadingIndicator.js b/frontend/components/LoadingIndicator/LoadingIndicator.js index 75f346d4..5413887c 100644 --- a/frontend/components/LoadingIndicator/LoadingIndicator.js +++ b/frontend/components/LoadingIndicator/LoadingIndicator.js @@ -2,12 +2,12 @@ import React from 'react'; import styles from './LoadingIndicator.scss'; -const LoadingIndicator = (props) => { +const LoadingIndicator = props => { return ( -
-
+
+
); }; -export default LoadingIndicator; \ No newline at end of file +export default LoadingIndicator; diff --git a/frontend/components/MarkdownEditor/MarkdownEditor.js b/frontend/components/MarkdownEditor/MarkdownEditor.js index 143e7fbd..2927377a 100644 --- a/frontend/components/MarkdownEditor/MarkdownEditor.js +++ b/frontend/components/MarkdownEditor/MarkdownEditor.js @@ -14,8 +14,7 @@ import './codemirror.scss'; import { client } from 'utils/ApiClient'; -@observer -class MarkdownEditor extends React.Component { +@observer class MarkdownEditor extends React.Component { static propTypes = { text: React.PropTypes.string, onChange: React.PropTypes.func.isRequired, @@ -27,15 +26,15 @@ class MarkdownEditor extends React.Component { // re-render to help with CodeMirror focus issues preview: React.PropTypes.bool, toggleUploadingIndicator: React.PropTypes.func, - } + }; - onChange = (newText) => { + onChange = newText => { if (newText !== this.props.text) { this.props.onChange(newText); } - } + }; - onDropAccepted = (files) => { + onDropAccepted = files => { const file = files[0]; const editor = this.getEditorInstance(); @@ -56,67 +55,68 @@ class MarkdownEditor extends React.Component { } editor.setCursor(newCursorPositionLine, 0); - client.post('/user.s3Upload', { - kind: file.type, - size: file.size, - filename: file.name, - }) - .then(response => { - const data = response.data; - // Upload using FormData API - const formData = new FormData(); - - for (const key in data.form) { - formData.append(key, data.form[key]); - } - - if (file.blob) { - formData.append('file', file.file); - } else { - formData.append('file', file); - } - - fetch(data.uploadUrl, { - method: 'post', - body: formData, + client + .post('/user.s3Upload', { + kind: file.type, + size: file.size, + filename: file.name, }) - .then(_s3Response => { - this.props.toggleUploadingIndicator(); - this.props.replaceText({ - original: pendingUploadTag, - new: `![${file.name}](${data.asset.url})`, - }); - editor.setCursor(newCursorPositionLine, 0); + .then(response => { + const data = response.data; + // Upload using FormData API + const formData = new FormData(); + + for (const key in data.form) { + formData.append(key, data.form[key]); + } + + if (file.blob) { + formData.append('file', file.file); + } else { + formData.append('file', file); + } + + fetch(data.uploadUrl, { + method: 'post', + body: formData, + }) + .then(_s3Response => { + this.props.toggleUploadingIndicator(); + this.props.replaceText({ + original: pendingUploadTag, + new: `![${file.name}](${data.asset.url})`, + }); + editor.setCursor(newCursorPositionLine, 0); + }) + .catch(_err => { + this.props.toggleUploadingIndicator(); + this.props.replaceText({ + original: pendingUploadTag, + new: '', + }); + editor.setCursor(newCursorPositionLine, 0); + }); }) .catch(_err => { this.props.toggleUploadingIndicator(); - this.props.replaceText({ - original: pendingUploadTag, - new: '', - }); - editor.setCursor(newCursorPositionLine, 0); }); - }) - .catch(_err => { - this.props.toggleUploadingIndicator(); - }); - } + }; onPaddingTopClick = () => { const cm = this.getEditorInstance(); cm.setCursor(0, 0); cm.focus(); - } + }; onPaddingBottomClick = () => { const cm = this.getEditorInstance(); cm.setCursor(cm.lineCount(), 0); cm.focus(); - } + }; getEditorInstance = () => { return this.refs.editor.getCodeMirror(); - } + }; render = () => { const options = { @@ -146,24 +146,24 @@ class MarkdownEditor extends React.Component { return ( - + - + ); - } + }; } export default MarkdownEditor; diff --git a/frontend/components/MarkdownEditor/components/ClickablePadding/ClickablePadding.js b/frontend/components/MarkdownEditor/components/ClickablePadding/ClickablePadding.js index def63526..4c95410e 100644 --- a/frontend/components/MarkdownEditor/components/ClickablePadding/ClickablePadding.js +++ b/frontend/components/MarkdownEditor/components/ClickablePadding/ClickablePadding.js @@ -2,17 +2,12 @@ import React from 'react'; import styles from './ClickablePadding.scss'; -const ClickablePadding = (props) => { - return ( -
 
- ) +const ClickablePadding = props => { + return
 
; }; ClickablePadding.propTypes = { onClick: React.PropTypes.func, }; -export default ClickablePadding; \ No newline at end of file +export default ClickablePadding; diff --git a/frontend/components/MarkdownEditor/components/ClickablePadding/index.js b/frontend/components/MarkdownEditor/components/ClickablePadding/index.js index 537c28bd..28973be3 100644 --- a/frontend/components/MarkdownEditor/components/ClickablePadding/index.js +++ b/frontend/components/MarkdownEditor/components/ClickablePadding/index.js @@ -1,2 +1,2 @@ import ClickablePadding from './ClickablePadding'; -export default ClickablePadding; \ No newline at end of file +export default ClickablePadding; diff --git a/frontend/components/Offline/Offline.js b/frontend/components/Offline/Offline.js index 1acafcb2..57464957 100644 --- a/frontend/components/Offline/Offline.js +++ b/frontend/components/Offline/Offline.js @@ -11,7 +11,7 @@ class Offline extends React.Component { state = { offline: !navigator.onLine, - } + }; getChildContext() { return { @@ -22,7 +22,7 @@ class Offline extends React.Component { componentDidMount = () => { window.addEventListener('offline', this.handleConnectionState); window.addEventListener('online', this.handleConnectionState); - } + }; componentWillUnmount = () => { window.removeEventListener('offline', this.handleConnectionState); @@ -33,7 +33,7 @@ class Offline extends React.Component { this.setState({ offline: !navigator.onLine, }); - } + }; render() { return React.Children.only(this.props.children); diff --git a/frontend/components/Offline/index.js b/frontend/components/Offline/index.js index 5bc9f908..d7fa3527 100644 --- a/frontend/components/Offline/index.js +++ b/frontend/components/Offline/index.js @@ -1,7 +1,4 @@ import Offline from './Offline'; import injectOffline from './injectOffline'; -export { - Offline, - injectOffline, -} +export { Offline, injectOffline }; diff --git a/frontend/components/Offline/injectOffline.js b/frontend/components/Offline/injectOffline.js index 5bb66509..f5d519d2 100644 --- a/frontend/components/Offline/injectOffline.js +++ b/frontend/components/Offline/injectOffline.js @@ -1,6 +1,6 @@ import React from 'react'; -const injectOffline = (WrappedComponent) => { +const injectOffline = WrappedComponent => { return class OfflineWrapper extends React.Component { static contextTypes = { offline: React.PropTypes.bool, @@ -11,7 +11,7 @@ const injectOffline = (WrappedComponent) => { offline: this.context.offline, }; - return (); + return ; } }; }; diff --git a/frontend/components/PublishingInfo/PublishingInfo.js b/frontend/components/PublishingInfo/PublishingInfo.js index 87c1097e..e79ff8ac 100644 --- a/frontend/components/PublishingInfo/PublishingInfo.js +++ b/frontend/components/PublishingInfo/PublishingInfo.js @@ -17,31 +17,35 @@ class PublishingInfo extends React.Component { render() { return ( - - - { this.props.collaborators.reverse().map(user => ( + + + {this.props.collaborators.reverse().map(user => ( - )) } + ))} - - { this.props.createdBy.name } published { moment(this.props.createdAt).fromNow() } - { this.props.createdAt !== this.props.updatedAt ? ( - -  and  - { this.props.createdBy.id !== this.props.updatedBy.id && - ` ${this.props.updatedBy.name} ` } - modified { moment(this.props.updatedAt).fromNow() } - - ) : null } + + {this.props.createdBy.name} + {' '} + published + {' '} + {moment(this.props.createdAt).fromNow()} + {this.props.createdAt !== this.props.updatedAt + ? +  and  + {this.props.createdBy.id !== this.props.updatedBy.id && + ` ${this.props.updatedBy.name} `} + modified {moment(this.props.updatedAt).fromNow()} + + : null} ); diff --git a/frontend/components/PublishingInfo/index.js b/frontend/components/PublishingInfo/index.js index e52f636a..bf607ecb 100644 --- a/frontend/components/PublishingInfo/index.js +++ b/frontend/components/PublishingInfo/index.js @@ -1,2 +1,2 @@ import PublishingInfo from './PublishingInfo'; -export default PublishingInfo; \ No newline at end of file +export default PublishingInfo; diff --git a/frontend/components/Tree/Node.js b/frontend/components/Tree/Node.js index e4472b9b..92c91a77 100644 --- a/frontend/components/Tree/Node.js +++ b/frontend/components/Tree/Node.js @@ -6,52 +6,57 @@ import classNames from 'classnames/bind'; const cx = classNames.bind(styles); class Node extends React.Component { - displayName: 'UITreeNode' + displayName: 'UITreeNode'; renderCollapse = () => { - var index = this.props.index; + const index = this.props.index; - if(index.children && index.children.length) { - var collapsed = index.node.collapsed; + if (index.children && index.children.length) { + const collapsed = index.node.collapsed; return ( - + ); } return null; - } + }; renderChildren = () => { - var index = this.props.index; - var tree = this.props.tree; - var dragging = this.props.dragging; + const index = this.props.index; + const tree = this.props.tree; + const dragging = this.props.dragging; - if(index.children && index.children.length) { - var childrenStyles = {}; + if (index.children && index.children.length) { + const childrenStyles = {}; if (!this.props.rootNode) { - if(index.node.collapsed) childrenStyles.display = 'none'; - childrenStyles['paddingLeft'] = this.props.paddingLeft + 'px'; + if (index.node.collapsed) childrenStyles.display = 'none'; + childrenStyles.paddingLeft = `${this.props.paddingLeft}px`; } return ( -
- {index.children.map((child) => { - var childIndex = tree.getIndex(child); +
+ {index.children.map(child => { + const childIndex = tree.getIndex(child); return ( { return this.props.allowUpdates && !this.props.rootNode; - } + }; onClick = () => { const index = this.props.index; const node = index.node; if (!this.isModifying()) history.push(node.url); - } + }; render() { const tree = this.props.tree; @@ -84,24 +89,31 @@ class Node extends React.Component { const style = {}; return ( -
+
e.stopPropagation() : this.handleMouseDown} + onMouseDown={ + this.props.rootNode || !this.props.allowUpdates + ? e => e.stopPropagation() + : this.handleMouseDown + } > - { !this.props.rootNode && this.renderCollapse() } + {!this.props.rootNode && this.renderCollapse()} - { node.title } + {node.title}
{this.renderChildren()} @@ -109,20 +121,20 @@ class Node extends React.Component { ); } - handleCollapse = (e) => { + handleCollapse = e => { e.stopPropagation(); - var nodeId = this.props.index.id; - if(this.props.onCollapse) this.props.onCollapse(nodeId); - } + const nodeId = this.props.index.id; + if (this.props.onCollapse) this.props.onCollapse(nodeId); + }; - handleMouseDown = (e) => { - var nodeId = this.props.index.id; - var dom = this.refs.inner; + handleMouseDown = e => { + const nodeId = this.props.index.id; + const dom = this.refs.inner; - if(this.props.onDragStart) { + if (this.props.onDragStart) { this.props.onDragStart(nodeId, dom, e); } - } -}; + }; +} module.exports = Node; diff --git a/frontend/components/Tree/Tree.js b/frontend/components/Tree/Tree.js index f5d4b8e3..c0cd0be2 100644 --- a/frontend/components/Tree/Tree.js +++ b/frontend/components/Tree/Tree.js @@ -1,24 +1,24 @@ -var Tree = require('js-tree'); -var proto = Tree.prototype; +const Tree = require('js-tree'); +const proto = Tree.prototype; proto.updateNodesPosition = function() { - var top = 1; - var left = 1; - var root = this.getIndex(1); - var self = this; + let top = 1; + let left = 1; + const root = this.getIndex(1); + const self = this; root.top = top++; root.left = left++; - if(root.children && root.children.length) { + if (root.children && root.children.length) { walk(root.children, root, left, root.node.collapsed); } function walk(children, parent, left, collapsed) { - var height = 1; - children.forEach(function(id) { - var node = self.getIndex(id); - if(collapsed) { + let height = 1; + children.forEach(id => { + const node = self.getIndex(id); + if (collapsed) { node.top = null; node.left = null; } else { @@ -26,30 +26,35 @@ proto.updateNodesPosition = function() { node.left = left; } - if(node.children && node.children.length) { - height += walk(node.children, node, left+1, collapsed || node.node.collapsed); + if (node.children && node.children.length) { + height += walk( + node.children, + node, + left + 1, + collapsed || node.node.collapsed + ); } else { node.height = 1; height += 1; } }); - if(parent.node.collapsed) parent.height = 1; + if (parent.node.collapsed) parent.height = 1; else parent.height = height; return parent.height; } }; proto.move = function(fromId, toId, placement) { - if(fromId === toId || toId === 1) return; + if (fromId === toId || toId === 1) return; - var obj = this.remove(fromId); - var index = null; + const obj = this.remove(fromId); + let index = null; - if(placement === 'before') index = this.insertBefore(obj, toId); - else if(placement === 'after') index = this.insertAfter(obj, toId); - else if(placement === 'prepend') index = this.prepend(obj, toId); - else if(placement === 'append') index = this.append(obj, toId); + if (placement === 'before') index = this.insertBefore(obj, toId); + else if (placement === 'after') index = this.insertAfter(obj, toId); + else if (placement === 'prepend') index = this.prepend(obj, toId); + else if (placement === 'append') index = this.append(obj, toId); // todo: perf this.updateNodesPosition(); @@ -57,12 +62,12 @@ proto.move = function(fromId, toId, placement) { }; proto.getNodeByTop = function(top) { - var indexes = this.indexes; - for(var id in indexes) { - if(indexes.hasOwnProperty(id)) { - if(indexes[id].top === top) return indexes[id]; + const indexes = this.indexes; + for (const id in indexes) { + if (indexes.hasOwnProperty(id)) { + if (indexes[id].top === top) return indexes[id]; } } }; -module.exports = Tree; \ No newline at end of file +module.exports = Tree; diff --git a/frontend/components/Tree/UiTree.js b/frontend/components/Tree/UiTree.js index d7d52115..4b9a9dc5 100644 --- a/frontend/components/Tree/UiTree.js +++ b/frontend/components/Tree/UiTree.js @@ -1,6 +1,6 @@ -var React = require('react'); -var Tree = require('./Tree'); -var Node = require('./Node'); +const React = require('react'); +const Tree = require('./Tree'); +const Node = require('./Node'); import styles from './Tree.scss'; @@ -16,7 +16,7 @@ module.exports = React.createClass({ getDefaultProps() { return { - paddingLeft: 20 + paddingLeft: 20, }; }, @@ -25,47 +25,47 @@ module.exports = React.createClass({ }, componentWillReceiveProps(nextProps) { - if(!this._updated) this.setState(this.init(nextProps)); + if (!this._updated) this.setState(this.init(nextProps)); else this._updated = false; }, init(props) { - var tree = new Tree(props.tree); + const tree = new Tree(props.tree); tree.isNodeCollapsed = props.isNodeCollapsed; tree.changeNodeCollapsed = props.changeNodeCollapsed; tree.updateNodesPosition(); return { - tree: tree, + tree, dragging: { id: null, x: null, y: null, w: null, - h: null - } + h: null, + }, }; }, getDraggingDom() { - var tree = this.state.tree; - var dragging = this.state.dragging; + const tree = this.state.tree; + const dragging = this.state.dragging; - if(dragging && dragging.id) { - var draggingIndex = tree.getIndex(dragging.id); - var draggingStyles = { + if (dragging && dragging.id) { + const draggingIndex = tree.getIndex(dragging.id); + const draggingStyles = { top: dragging.y, left: dragging.x, - width: dragging.w + width: dragging.w, }; return ( -
+
); @@ -75,23 +75,23 @@ module.exports = React.createClass({ }, render() { - var tree = this.state.tree; - var dragging = this.state.dragging; - var draggingDom = this.getDraggingDom(); + const tree = this.state.tree; + const dragging = this.state.dragging; + const draggingDom = this.getDraggingDom(); return ( -
- { draggingDom } +
+ {draggingDom}
); @@ -99,11 +99,11 @@ module.exports = React.createClass({ dragStart(id, dom, e) { this.dragging = { - id: id, + id, w: dom.offsetWidth, h: dom.offsetHeight, x: dom.offsetLeft, - y: dom.offsetTop + y: dom.offsetTop, }; this._startX = dom.offsetLeft; @@ -118,69 +118,73 @@ module.exports = React.createClass({ // oh drag(e) { - if(this._start) { + if (this._start) { this.setState({ - dragging: this.dragging + dragging: this.dragging, }); this._start = false; } - var tree = this.state.tree; - var dragging = this.state.dragging; - var paddingLeft = this.props.paddingLeft; - var newIndex = null; - var index = tree.getIndex(dragging.id); - var collapsed = index.node.collapsed; + const tree = this.state.tree; + const dragging = this.state.dragging; + const paddingLeft = this.props.paddingLeft; + let newIndex = null; + let index = tree.getIndex(dragging.id); + const collapsed = index.node.collapsed; - var _startX = this._startX; - var _startY = this._startY; - var _offsetX = this._offsetX; - var _offsetY = this._offsetY; + const _startX = this._startX; + const _startY = this._startY; + const _offsetX = this._offsetX; + const _offsetY = this._offsetY; - var pos = { + const pos = { x: _startX + e.clientX - _offsetX, - y: _startY + e.clientY - _offsetY + y: _startY + e.clientY - _offsetY, }; dragging.x = pos.x; dragging.y = pos.y; - var diffX = dragging.x - paddingLeft/2 - (index.left-2) * paddingLeft; - var diffY = dragging.y - dragging.h/2 - (index.top-2) * dragging.h; + const diffX = dragging.x - paddingLeft / 2 - (index.left - 2) * paddingLeft; + const diffY = dragging.y - dragging.h / 2 - (index.top - 2) * dragging.h; - if(diffX < 0) { // left - if(index.parent && !index.next) { + if (diffX < 0) { + // left + if (index.parent && !index.next) { newIndex = tree.move(index.id, index.parent, 'after'); } - } else if(diffX > paddingLeft) { // right - if(index.prev) { - var prevNode = tree.getIndex(index.prev).node; - if(!prevNode.collapsed && !prevNode.leaf) { + } else if (diffX > paddingLeft) { + // right + if (index.prev) { + const prevNode = tree.getIndex(index.prev).node; + if (!prevNode.collapsed && !prevNode.leaf) { newIndex = tree.move(index.id, index.prev, 'append'); } } } - if(newIndex) { + if (newIndex) { index = newIndex; newIndex.node.collapsed = collapsed; dragging.id = newIndex.id; } - if(diffY < 0) { // up - var above = tree.getNodeByTop(index.top-1); + if (diffY < 0) { + // up + const above = tree.getNodeByTop(index.top - 1); newIndex = tree.move(index.id, above.id, 'before'); - } else if(diffY > dragging.h) { // down - if(index.next) { + } else if (diffY > dragging.h) { + // down + if (index.next) { var below = tree.getIndex(index.next); - if(below.children && below.children.length && !below.node.collapsed) { + if (below.children && below.children.length && !below.node.collapsed) { newIndex = tree.move(index.id, index.next, 'prepend'); } else { newIndex = tree.move(index.id, index.next, 'after'); } } else { - var below = tree.getNodeByTop(index.top+index.height); - if(below && below.parent !== index.id) { - if(below.children && below.children.length) { + var below = tree.getNodeByTop(index.top + index.height); + if (below && below.parent !== index.id) { + if (below.children && below.children.length) { newIndex = tree.move(index.id, below.id, 'prepend'); } else { newIndex = tree.move(index.id, below.id, 'after'); @@ -189,14 +193,14 @@ module.exports = React.createClass({ } } - if(newIndex) { + if (newIndex) { newIndex.node.collapsed = collapsed; dragging.id = newIndex.id; } this.setState({ - tree: tree, - dragging: dragging + tree, + dragging, }); }, @@ -207,8 +211,8 @@ module.exports = React.createClass({ x: null, y: null, w: null, - h: null - } + h: null, + }, }); this.change(this.state.tree); @@ -218,21 +222,21 @@ module.exports = React.createClass({ change(tree) { this._updated = true; - if(this.props.onChange) this.props.onChange(tree.obj); + if (this.props.onChange) this.props.onChange(tree.obj); }, toggleCollapse(nodeId) { - var tree = this.state.tree; - var index = tree.getIndex(nodeId); - var node = index.node; + const tree = this.state.tree; + const index = tree.getIndex(nodeId); + const node = index.node; node.collapsed = !node.collapsed; tree.updateNodesPosition(); this.setState({ - tree: tree + tree, }); - if(this.props.onCollapse) this.props.onCollapse(node.id, node.collapsed); + if (this.props.onCollapse) this.props.onCollapse(node.id, node.collapsed); }, // buildTreeNumbering(tree) { diff --git a/frontend/components/Tree/index.js b/frontend/components/Tree/index.js index 282ed6e1..2a932bd6 100644 --- a/frontend/components/Tree/index.js +++ b/frontend/components/Tree/index.js @@ -1,2 +1,2 @@ import UiTree from './UiTree'; -export default UiTree; \ No newline at end of file +export default UiTree; diff --git a/frontend/constants.js b/frontend/constants.js index 85593dd6..edd8d11b 100644 --- a/frontend/constants.js +++ b/frontend/constants.js @@ -1,7 +1,7 @@ let constants; constants = { - API_USER_AGENT: `Atlas`, + API_USER_AGENT: 'Atlas', API_BASE_URL: '/api', }; diff --git a/frontend/index.js b/frontend/index.js index a811af1b..8ffef449 100644 --- a/frontend/index.js +++ b/frontend/index.js @@ -46,63 +46,83 @@ function requireAuth(nextState, replace) { } } -render(( +render(
- + - - - + + + - - + + - - + + - - + + - + - + - - - + + - { __DEV__ && } -
-), document.getElementById('root')); + {__DEV__ && } +
, + document.getElementById('root') +); diff --git a/frontend/scenes/Atlas/Atlas.js b/frontend/scenes/Atlas/Atlas.js index aff4ec0f..8c8579a3 100644 --- a/frontend/scenes/Atlas/Atlas.js +++ b/frontend/scenes/Atlas/Atlas.js @@ -22,7 +22,7 @@ import styles from './Atlas.scss'; class Atlas extends React.Component { static propTypes = { params: PropTypes.object.isRequired, - } + }; componentDidMount = () => { const { id } = this.props.params; @@ -32,21 +32,21 @@ class Atlas extends React.Component { browserHistory.replace(data.navigationTree.url); } }); - } + }; - componentWillReceiveProps = (nextProps) => { + componentWillReceiveProps = nextProps => { const key = nextProps.keydown.event; if (key) { if (key.key === 'c') { _.defer(this.onCreate); } } - } + }; - onCreate = (event) => { + onCreate = event => { if (event) event.preventDefault(); browserHistory.push(`${store.collection.url}/new`); - } + }; render() { const collection = store.collection; @@ -58,47 +58,44 @@ class Atlas extends React.Component { if (collection) { actions = ( - } > - + }> + New document ); - title = { collection.name }; + title = {collection.name}; titleText = collection.name; } return ( - + - { store.isFetching ? ( - - ) : ( -
-
-

{ collection.name }

-
- { collection.description } -
-
+ {store.isFetching + ? + :
+
+

{collection.name}

+
+ {collection.description} +
+
- + - -
- ) } + +
}
diff --git a/frontend/scenes/Atlas/AtlasStore.js b/frontend/scenes/Atlas/AtlasStore.js index d00e621f..8f7d1e49 100644 --- a/frontend/scenes/Atlas/AtlasStore.js +++ b/frontend/scenes/Atlas/AtlasStore.js @@ -18,10 +18,10 @@ const store = new class AtlasStore { this.collection = data; successCallback(data); } catch (e) { - console.error("Something went wrong"); + console.error('Something went wrong'); } this.isFetching = false; - } + }; }(); export default store; diff --git a/frontend/scenes/Atlas/index.js b/frontend/scenes/Atlas/index.js index aa7713c8..dd00ddcc 100644 --- a/frontend/scenes/Atlas/index.js +++ b/frontend/scenes/Atlas/index.js @@ -1,2 +1,2 @@ import Atlas from './Atlas'; -export default Atlas; \ No newline at end of file +export default Atlas; diff --git a/frontend/scenes/Dashboard/DashboardStore.js b/frontend/scenes/Dashboard/DashboardStore.js index ff2da5cf..67c04c7d 100644 --- a/frontend/scenes/Dashboard/DashboardStore.js +++ b/frontend/scenes/Dashboard/DashboardStore.js @@ -18,7 +18,7 @@ class DashboardStore { runInAction('fetchCollections', () => { this.collections = data; this.pagination = pagination; - data.forEach((collection) => cacheResponse(collection.recentDocuments)); + data.forEach(collection => cacheResponse(collection.recentDocuments)); }); // If only one collection, visit it automatically @@ -29,7 +29,7 @@ class DashboardStore { console.error('Something went wrong'); } this.isFetching = false; - } + }; constructor(options) { this.team = options.team; diff --git a/frontend/scenes/Dashboard/index.js b/frontend/scenes/Dashboard/index.js index fcf5a0c0..e5cb98c3 100644 --- a/frontend/scenes/Dashboard/index.js +++ b/frontend/scenes/Dashboard/index.js @@ -1,2 +1,2 @@ import Dashboard from './Dashboard'; -export default Dashboard; \ No newline at end of file +export default Dashboard; diff --git a/frontend/scenes/DocumentEdit/DocumentEdit.js b/frontend/scenes/DocumentEdit/DocumentEdit.js index e32f1ae1..d7b4bfaf 100644 --- a/frontend/scenes/DocumentEdit/DocumentEdit.js +++ b/frontend/scenes/DocumentEdit/DocumentEdit.js @@ -3,9 +3,7 @@ import { observer } from 'mobx-react'; import { browserHistory, withRouter } from 'react-router'; import keydown from 'react-keydown'; -import DocumentEditStore, { - DOCUMENT_EDIT_SETTINGS, -} from './DocumentEditStore'; +import DocumentEditStore, { DOCUMENT_EDIT_SETTINGS } from './DocumentEditStore'; import Switch from 'components/Switch'; import Layout, { Title, HeaderAction, SaveAction } from 'components/Layout'; @@ -20,9 +18,13 @@ const DISREGARD_CHANGES = `You have unsaved changes. Are you sure you want to disgard them?`; @keydown([ - 'cmd+enter', 'ctrl+enter', - 'cmd+esc', 'ctrl+esc', - 'cmd+shift+p', 'ctrl+shift+p']) + 'cmd+enter', + 'ctrl+enter', + 'cmd+esc', + 'ctrl+esc', + 'cmd+shift+p', + 'ctrl+shift+p', +]) @withRouter @observer class DocumentEdit extends Component { @@ -30,7 +32,7 @@ class DocumentEdit extends Component { route: React.PropTypes.object.isRequired, router: React.PropTypes.object.isRequired, params: React.PropTypes.object, - } + }; constructor(props) { super(props); @@ -41,7 +43,7 @@ class DocumentEdit extends Component { state = { scrollTop: 0, - } + }; componentDidMount = () => { if (this.props.route.newDocument) { @@ -58,8 +60,7 @@ class DocumentEdit extends Component { } // Load editor async - EditorLoader() - .then(({ Editor }) => { + EditorLoader().then(({ Editor }) => { this.setState({ Editor }); }); @@ -70,9 +71,9 @@ class DocumentEdit extends Component { } return null; }); - } + }; - componentWillReceiveProps = (nextProps) => { + componentWillReceiveProps = nextProps => { const key = nextProps.keydown.event; if (key) { @@ -91,7 +92,7 @@ class DocumentEdit extends Component { this.store.togglePreview(); } } - } + }; onSave = () => { // if (this.props.title.length === 0) { @@ -103,45 +104,46 @@ class DocumentEdit extends Component { } else { this.store.updateDocument(); } - } + }; onCancel = () => { browserHistory.goBack(); - } + }; - onScroll = (scrollTop) => { + onScroll = scrollTop => { this.setState({ scrollTop, }); - } + }; render() { - let title = ( + const title = ( - { this.store.title } + {this.store.title} ); - let titleText = this.store.title; - let isNew = this.props.route.newDocument || this.props.route.newChildDocument; + const titleText = this.store.title; + const isNew = + this.props.route.newDocument || this.props.route.newChildDocument; const actions = ( - }> - - Preview + }> + + Preview - + Cancel @@ -150,27 +152,25 @@ class DocumentEdit extends Component { return ( - { (this.store.isFetching || !('Editor' in this.state)) ? ( - - - - ) : ( - - ) } + {this.store.isFetching || !('Editor' in this.state) + ? + + + : } ); } diff --git a/frontend/scenes/DocumentEdit/DocumentEditStore.js b/frontend/scenes/DocumentEdit/DocumentEditStore.js index a8e14a39..fe0109df 100644 --- a/frontend/scenes/DocumentEdit/DocumentEditStore.js +++ b/frontend/scenes/DocumentEdit/DocumentEditStore.js @@ -5,7 +5,7 @@ import emojify from 'utils/emojify'; const DOCUMENT_EDIT_SETTINGS = 'DOCUMENT_EDIT_SETTINGS'; -const parseHeader = (text) => { +const parseHeader = text => { const firstLine = text.split(/\r?\n/)[0]; if (firstLine) { const match = firstLine.match(/^#+ +(.*)$/); @@ -40,9 +40,13 @@ class DocumentEditStore { this.isFetching = true; try { - const data = await client.get('/documents.info', { - id: this.documentId, - }, { cache: true }); + const data = await client.get( + '/documents.info', + { + id: this.documentId, + }, + { cache: true } + ); if (this.newChildDocument) { this.parentDocument = data.data; } else { @@ -54,7 +58,7 @@ class DocumentEditStore { console.error('Something went wrong'); } this.isFetching = false; - } + }; @action saveDocument = async () => { if (this.isSaving) return; @@ -62,12 +66,16 @@ class DocumentEditStore { this.isSaving = true; try { - const data = await client.post('/documents.create', { - parentDocument: this.parentDocument && this.parentDocument.id, - collection: this.collectionId || this.parentDocument.collection.id, - title: this.title || 'Untitled document', - text: this.text, - }, { cache: true }); + const data = await client.post( + '/documents.create', + { + parentDocument: this.parentDocument && this.parentDocument.id, + collection: this.collectionId || this.parentDocument.collection.id, + title: this.title || 'Untitled document', + text: this.text, + }, + { cache: true } + ); const { url } = data.data; this.hasPendingChanges = false; @@ -76,7 +84,7 @@ class DocumentEditStore { console.error('Something went wrong'); } this.isSaving = false; - } + }; @action updateDocument = async () => { if (this.isSaving) return; @@ -84,11 +92,15 @@ class DocumentEditStore { this.isSaving = true; try { - const data = await client.post('/documents.update', { - id: this.documentId, - title: this.title || 'Untitled document', - text: this.text, - }, { cache: true }); + const data = await client.post( + '/documents.update', + { + id: this.documentId, + title: this.title || 'Untitled document', + text: this.text, + }, + { cache: true } + ); const { url } = data.data; this.hasPendingChanges = false; @@ -97,35 +109,35 @@ class DocumentEditStore { console.error('Something went wrong'); } this.isSaving = false; - } + }; - @action updateText = (text) => { + @action updateText = text => { this.text = text; this.title = parseHeader(text); this.hasPendingChanges = true; - } + }; - @action updateTitle = (title) => { + @action updateTitle = title => { this.title = title; - } + }; - @action replaceText = (args) => { + @action replaceText = args => { this.text = this.text.replace(args.original, args.new); this.hasPendingChanges = true; - } + }; @action togglePreview = () => { this.preview = !this.preview; - } + }; @action reset = () => { this.title = 'Lets start with a title'; this.text = '# Lets start with a title\n\nAnd continue from there...'; - } + }; @action toggleUploadingIndicator = () => { this.isUploading = !this.isUploading; - } + }; // Generic @@ -133,7 +145,7 @@ class DocumentEditStore { localStorage[DOCUMENT_EDIT_SETTINGS] = JSON.stringify({ preview: toJS(this.preview), }); - } + }; constructor(settings) { // Rehydrate settings @@ -148,6 +160,4 @@ class DocumentEditStore { } export default DocumentEditStore; -export { - DOCUMENT_EDIT_SETTINGS, -}; +export { DOCUMENT_EDIT_SETTINGS }; diff --git a/frontend/scenes/DocumentEdit/components/Editor.js b/frontend/scenes/DocumentEdit/components/Editor.js index 0a600d3b..34d93d9a 100644 --- a/frontend/scenes/DocumentEdit/components/Editor.js +++ b/frontend/scenes/DocumentEdit/components/Editor.js @@ -8,33 +8,28 @@ import EditorPane from './EditorPane'; import styles from '../DocumentEdit.scss'; -const Editor = observer((props) => { +const Editor = observer(props => { const store = props.store; return ( -
- +
+ - { store.preview ? ( - - - - ) : null } + {store.preview + ? + + + : null}
); }); diff --git a/frontend/scenes/DocumentEdit/components/EditorPane.js b/frontend/scenes/DocumentEdit/components/EditorPane.js index fcbb0fc3..16ade5c0 100644 --- a/frontend/scenes/DocumentEdit/components/EditorPane.js +++ b/frontend/scenes/DocumentEdit/components/EditorPane.js @@ -10,32 +10,31 @@ class EditorPane extends React.Component { onScroll: React.PropTypes.func.isRequired, scrollTop: React.PropTypes.number, fullWidth: React.PropTypes.bool, - } - - componentWillReceiveProps = (nextProps) => { + }; + componentWillReceiveProps = nextProps => { if (nextProps.scrollTop) { - this.scrollToPosition(nextProps.scrollTop) + this.scrollToPosition(nextProps.scrollTop); } - } + }; componentDidMount = () => { this.refs.pane.addEventListener('scroll', this.handleScroll); - } + }; componentWillUnmount = () => { this.refs.pane.removeEventListener('scroll', this.handleScroll); - } + }; - handleScroll = (e) => { + handleScroll = e => { setTimeout(() => { const element = this.refs.pane; const contentEl = this.refs.content; this.props.onScroll(element.scrollTop / contentEl.offsetHeight); }, 50); - } + }; - scrollToPosition = (percentage) => { + scrollToPosition = percentage => { const contentEl = this.refs.content; // Push to edges @@ -43,20 +42,20 @@ class EditorPane extends React.Component { if (percentage > 0.99) percentage = 100; this.refs.pane.scrollTop = percentage * contentEl.offsetHeight; - } + }; render() { return (
-
- { this.props.children } +
+ {this.props.children}
); } -}; +} export default EditorPane; diff --git a/frontend/scenes/DocumentEdit/components/Preview/Preview.js b/frontend/scenes/DocumentEdit/components/Preview/Preview.js index e1c99921..ceb80dd3 100644 --- a/frontend/scenes/DocumentEdit/components/Preview/Preview.js +++ b/frontend/scenes/DocumentEdit/components/Preview/Preview.js @@ -6,10 +6,10 @@ import styles from './Preview.scss'; import classNames from 'classnames/bind'; const cx = classNames.bind(styles); -const Preview = (props) => { +const Preview = props => { return ( -
- +
+
); }; diff --git a/frontend/scenes/DocumentScene/DocumentSceneStore.js b/frontend/scenes/DocumentScene/DocumentSceneStore.js index 2b3c2789..60667b24 100644 --- a/frontend/scenes/DocumentScene/DocumentSceneStore.js +++ b/frontend/scenes/DocumentScene/DocumentSceneStore.js @@ -1,5 +1,12 @@ import _ from 'lodash'; -import { observable, action, computed, runInAction, toJS, autorunAsync } from 'mobx'; +import { + observable, + action, + computed, + runInAction, + toJS, + autorunAsync, +} from 'mobx'; import { client } from 'utils/ApiClient'; import { browserHistory } from 'react-router'; @@ -19,15 +26,14 @@ class DocumentSceneStore { /* Computed */ @computed get isCollection() { - return this.document && - this.document.collection.type === 'atlas'; + return this.document && this.document.collection.type === 'atlas'; } @computed get collectionTree() { if (!this.document || this.document.collection.type !== 'atlas') return; const tree = this.document.collection.navigationTree; - const collapseNodes = (node) => { + const collapseNodes = node => { node.collapsed = this.collapsedNodes.includes(node.id); node.children = node.children.map(childNode => { return collapseNodes(childNode); @@ -69,7 +75,7 @@ class DocumentSceneStore { } this.isFetching = false; this.updatingContent = false; - } + }; @action deleteDocument = async () => { this.isFetching = true; @@ -81,9 +87,9 @@ class DocumentSceneStore { console.error('Something went wrong'); } this.isFetching = false; - } + }; - @action updateNavigationTree = async (tree) => { + @action updateNavigationTree = async tree => { // Only update when tree changes if (_.isEqual(toJS(tree), toJS(this.document.collection.navigationTree))) { return true; @@ -104,15 +110,15 @@ class DocumentSceneStore { console.error('Something went wrong'); } this.updatingStructure = false; - } + }; - @action onNodeCollapse = (nodeId) => { + @action onNodeCollapse = nodeId => { if (_.indexOf(this.collapsedNodes, nodeId) >= 0) { this.collapsedNodes = _.without(this.collapsedNodes, nodeId); } else { this.collapsedNodes.push(nodeId); } - } + }; // General @@ -120,7 +126,7 @@ class DocumentSceneStore { localStorage[DOCUMENT_PREFERENCES] = JSON.stringify({ collapsedNodes: toJS(this.collapsedNodes), }); - } + }; constructor(settings, options) { // Rehydrate settings @@ -136,6 +142,4 @@ class DocumentSceneStore { } export default DocumentSceneStore; -export { - DOCUMENT_PREFERENCES, -}; +export { DOCUMENT_PREFERENCES }; diff --git a/frontend/scenes/DocumentScene/components/Sidebar/Sidebar.js b/frontend/scenes/DocumentScene/components/Sidebar/Sidebar.js index 9c5c093d..611cfe31 100644 --- a/frontend/scenes/DocumentScene/components/Sidebar/Sidebar.js +++ b/frontend/scenes/DocumentScene/components/Sidebar/Sidebar.js @@ -12,8 +12,7 @@ const cx = classNames.bind(styles); import SidebarStore from './SidebarStore'; -@observer -class Sidebar extends React.Component { +@observer class Sidebar extends React.Component { static store; static propTypes = { @@ -22,7 +21,7 @@ class Sidebar extends React.Component { navigationTree: PropTypes.object.isRequired, onNavigationUpdate: PropTypes.func.isRequired, onNodeCollapse: PropTypes.func.isRequired, - } + }; constructor(props) { super(props); @@ -30,49 +29,47 @@ class Sidebar extends React.Component { this.store = new SidebarStore(); } - toggleEdit = (e) => { + toggleEdit = e => { e.preventDefault(); this.store.toggleEdit(); - } + }; render() { return ( - { this.props.open && ( - - + {this.props.open && + + - - { this.store.isEditing && ( - + + {this.store.isEditing && + Drag & drop to organize   - - ) } + } - { !this.store.isEditing ? 'Organize documents' : 'Done' } + {!this.store.isEditing ? 'Organize documents' : 'Done'} - - ) } + }
Menu
diff --git a/frontend/scenes/DocumentScene/components/Sidebar/SidebarStore.js b/frontend/scenes/DocumentScene/components/Sidebar/SidebarStore.js index b85e9023..c41ec965 100644 --- a/frontend/scenes/DocumentScene/components/Sidebar/SidebarStore.js +++ b/frontend/scenes/DocumentScene/components/Sidebar/SidebarStore.js @@ -7,7 +7,7 @@ class SidebarStore { @action toggleEdit = () => { this.isEditing = !this.isEditing; - } + }; } export default SidebarStore; diff --git a/frontend/scenes/DocumentScene/components/Sidebar/components/Separator/Separator.js b/frontend/scenes/DocumentScene/components/Sidebar/components/Separator/Separator.js index 0f35dd49..21e17676 100644 --- a/frontend/scenes/DocumentScene/components/Sidebar/components/Separator/Separator.js +++ b/frontend/scenes/DocumentScene/components/Sidebar/components/Separator/Separator.js @@ -5,8 +5,8 @@ import styles from './Separator.scss'; class Separator extends React.Component { render() { return ( - - · + + · ); } diff --git a/frontend/scenes/DocumentScene/index.js b/frontend/scenes/DocumentScene/index.js index 42f5befa..acbce0f5 100644 --- a/frontend/scenes/DocumentScene/index.js +++ b/frontend/scenes/DocumentScene/index.js @@ -1,2 +1,2 @@ import DocumentScene from './DocumentScene'; -export default DocumentScene; \ No newline at end of file +export default DocumentScene; diff --git a/frontend/scenes/Error404/Error404.js b/frontend/scenes/Error404/Error404.js index 462a066b..607793af 100644 --- a/frontend/scenes/Error404/Error404.js +++ b/frontend/scenes/Error404/Error404.js @@ -7,9 +7,7 @@ import CenteredContent from 'components/CenteredContent'; class Error404 extends React.Component { render() { return ( - +

Not Found

diff --git a/frontend/scenes/ErrorAuth/ErrorAuth.js b/frontend/scenes/ErrorAuth/ErrorAuth.js index d0c25aef..7398d8ec 100644 --- a/frontend/scenes/ErrorAuth/ErrorAuth.js +++ b/frontend/scenes/ErrorAuth/ErrorAuth.js @@ -7,13 +7,13 @@ import CenteredContent from 'components/CenteredContent'; class ErrorAuth extends React.Component { render() { return ( - +

Authentication failed

-

We were unable to log you in. Please try again.

+

+ We were unable to log you in. Please try again. +

); diff --git a/frontend/scenes/Flatpage/Flatpage.js b/frontend/scenes/Flatpage/Flatpage.js index 6d0afbec..403941e0 100644 --- a/frontend/scenes/Flatpage/Flatpage.js +++ b/frontend/scenes/Flatpage/Flatpage.js @@ -7,23 +7,18 @@ import { DocumentHtml } from 'components/Document'; import { convertToMarkdown } from 'utils/markdown'; -@observer -class Flatpage extends React.Component { +@observer class Flatpage extends React.Component { static propTypes = { route: PropTypes.object, - } + }; render() { const { title, content } = this.props.route; return ( - { title } } - titleText={ title } - search={ false } - > + {title}} titleText={title} search={false}> - + ); diff --git a/frontend/scenes/Home/animation.js b/frontend/scenes/Home/animation.js index cb0bdba4..1223bc5f 100644 --- a/frontend/scenes/Home/animation.js +++ b/frontend/scenes/Home/animation.js @@ -1,26 +1,44 @@ import React from 'react'; import { Frame } from 'react-keyframes'; -let frames = []; -const p = (node) => frames.push(node); -const E = (props) => { - return ({ props.children }); +const frames = []; +const p = node => frames.push(node); +const E = props => { + return ( + + {props.children} + + ); }; -const line1 = (

Hi there,

); -const line2 = (

We're excited to share what we’re building.

); -const line3 = (

We **love** Markdown,

); -const line4 = (

but we also get that it's not for everyone.

); -const line5 = (

Together with you,

); -const line6 = (

we want to build the best place to

); -const line7 = (

share ideas,

); -const line8 = (

tell stories,

); -const line9 = (

and build knowledge.

); -const line10 = (

We're just getting started.

); -const line11 = (

Welcome to Atlas.

); +const line1 =

Hi there,

; +const line2 =

We're excited to share what we’re building.

; +const line3 =

We **love** Markdown,

; +const line4 =

but we also get that it's not for everyone.

; +const line5 =

Together with you,

; +const line6 =

we want to build the best place to

; +const line7 =

share ideas,

; +const line8 =

tell stories,

; +const line9 =

and build knowledge.

; +const line10 =

We're just getting started.

; +const line11 =

Welcome to Atlas.

; -p({line1}{line2}{line3}{line4}{line5}{line6}{line7}{line8}{line9}{line10}{line11}); +p( + + {line1} + {line2} + {line3} + {line4} + {line5} + {line6} + {line7} + {line8} + {line9} + {line10} + {line11} + +); // Hmms leaving this here for now, would be nice to something -export default frames; \ No newline at end of file +export default frames; diff --git a/frontend/scenes/Home/index.js b/frontend/scenes/Home/index.js index 50b4d64a..e8f97a0c 100644 --- a/frontend/scenes/Home/index.js +++ b/frontend/scenes/Home/index.js @@ -1,2 +1,2 @@ import Home from './Home'; -export default Home; \ No newline at end of file +export default Home; diff --git a/frontend/scenes/Search/Search.js b/frontend/scenes/Search/Search.js index e2c65382..e5ed8afd 100644 --- a/frontend/scenes/Search/Search.js +++ b/frontend/scenes/Search/Search.js @@ -12,12 +12,11 @@ import styles from './Search.scss'; import SearchStore from './SearchStore'; -@observer -class Search extends React.Component { +@observer class Search extends React.Component { static propTypes = { route: PropTypes.object.isRequired, routeParams: PropTypes.object.isRequired, - } + }; constructor(props) { super(props); @@ -31,7 +30,7 @@ class Search extends React.Component { searchTerm = searchTerm.split(/[\s-]+/gi).join(' '); this.store.search(searchTerm); } - } + }; get viewNotFound() { const { sceneType } = this.props.route; @@ -39,7 +38,7 @@ class Search extends React.Component { } render() { - const search = _.debounce((searchTerm) => { + const search = _.debounce(searchTerm => { this.store.search(searchTerm); }, 250); const title = ( @@ -50,35 +49,37 @@ class Search extends React.Component { return ( - { this.viewNotFound && ( + {this.viewNotFound &&

Not Found

We're unable to find the page you're accessing.


-
- ) } +
} Search - { this.store.documents && this.store.documents.map((document) => { - return (); - }) } + {this.store.documents && + this.store.documents.map(document => { + return ( + + ); + })} diff --git a/frontend/scenes/Search/SearchStore.js b/frontend/scenes/Search/SearchStore.js index 7f3aa250..e2de4faa 100644 --- a/frontend/scenes/Search/SearchStore.js +++ b/frontend/scenes/Search/SearchStore.js @@ -11,7 +11,7 @@ class SearchStore { /* Actions */ - @action search = async (query) => { + @action search = async query => { this.searchTerm = query; this.isFetching = true; @@ -24,14 +24,14 @@ class SearchStore { this.pagination = pagination; }); } catch (e) { - console.error("Something went wrong"); + console.error('Something went wrong'); } } else { this.documents = null; } this.isFetching = false; - } + }; } export default SearchStore; diff --git a/frontend/scenes/Search/components/SearchField/SearchField.js b/frontend/scenes/Search/components/SearchField/SearchField.js index b5472f53..b3f04c6f 100644 --- a/frontend/scenes/Search/components/SearchField/SearchField.js +++ b/frontend/scenes/Search/components/SearchField/SearchField.js @@ -3,22 +3,21 @@ import { observer } from 'mobx-react'; import styles from './SearchField.scss'; -@observer -class SearchField extends React.Component { +@observer class SearchField extends React.Component { static propTypes = { onChange: PropTypes.func, - } + }; - onChange = (event) => { + onChange = event => { this.props.onChange(event.currentTarget.value); - } + }; render() { return ( -
+
diff --git a/frontend/scenes/Settings/Settings.js b/frontend/scenes/Settings/Settings.js index f889ebe3..b2dbd0e0 100644 --- a/frontend/scenes/Settings/Settings.js +++ b/frontend/scenes/Settings/Settings.js @@ -12,8 +12,7 @@ import styles from './Settings.scss'; import SettingsStore from './SettingsStore'; -@observer -class Settings extends React.Component { +@observer class Settings extends React.Component { static store; constructor(props) { @@ -21,10 +20,10 @@ class Settings extends React.Component { this.store = new SettingsStore(); } - onKeyCreate = (e) => { + onKeyCreate = e => { e.preventDefault(); this.store.createApiKey(); - } + }; render() { const title = ( @@ -37,48 +36,52 @@ class Settings extends React.Component { return ( - { showSlackSettings && ( -
-

Slack

+ {showSlackSettings && +
+

Slack

Connect Atlas to your Slack to instantly search for your documents using /atlas command.

- Add to Slack + Add to Slack -
- ) } +
} -
-

API access

+
+

API access

Create API tokens to hack on your Atlas. Learn more in API documentation.

- { this.store.apiKeys && ( - - { this.store.apiKeys.map(key => ( + {this.store.apiKeys && +
+ {this.store.apiKeys.map(key => ( - )) } -
- ) } + ))} + }
diff --git a/frontend/scenes/Settings/SettingsStore.js b/frontend/scenes/Settings/SettingsStore.js index 4f96050b..abb94184 100644 --- a/frontend/scenes/Settings/SettingsStore.js +++ b/frontend/scenes/Settings/SettingsStore.js @@ -17,10 +17,10 @@ class SearchStore { this.apiKeys = data; }); } catch (e) { - console.error("Something went wrong"); + console.error('Something went wrong'); } this.isFetching = false; - } + }; @action createApiKey = async () => { this.isFetching = true; @@ -35,12 +35,12 @@ class SearchStore { this.keyName = ''; }); } catch (e) { - console.error("Something went wrong"); + console.error('Something went wrong'); } this.isFetching = false; - } + }; - @action deleteApiKey = async (id) => { + @action deleteApiKey = async id => { this.isFetching = true; try { @@ -51,14 +51,14 @@ class SearchStore { this.fetchApiKeys(); }); } catch (e) { - console.error("Something went wrong"); + console.error('Something went wrong'); } this.isFetching = false; - } + }; - @action setKeyName = (value) => { + @action setKeyName = value => { this.keyName = value.target.value; - } + }; constructor() { this.fetchApiKeys(); diff --git a/frontend/scenes/Settings/components/ApiKeyRow/ApiKeyRow.js b/frontend/scenes/Settings/components/ApiKeyRow/ApiKeyRow.js index 7d21ab8d..5a49bcd1 100644 --- a/frontend/scenes/Settings/components/ApiKeyRow/ApiKeyRow.js +++ b/frontend/scenes/Settings/components/ApiKeyRow/ApiKeyRow.js @@ -10,37 +10,34 @@ class ApiKeyRow extends React.Component { name: PropTypes.string.isRequired, secret: PropTypes.string.isRequired, onDelete: PropTypes.func.isRequired, - } + }; state = { disabled: false, - } + }; onClick = () => { this.props.onDelete(this.props.id); this.setState({ disabled: true }); - } + }; render() { - const { - name, - secret, - } = this.props; + const { name, secret } = this.props; - const { - disabled, - } = this.state; + const { disabled } = this.state; return ( - { name } - { secret } + {name} + {secret} Delete + onClick={this.onClick} + className={cx(styles.deleteAction, { disabled })} + > + Delete + ); diff --git a/frontend/scenes/SlackAuth/SlackAuth.js b/frontend/scenes/SlackAuth/SlackAuth.js index 77727626..d5243a85 100644 --- a/frontend/scenes/SlackAuth/SlackAuth.js +++ b/frontend/scenes/SlackAuth/SlackAuth.js @@ -31,7 +31,6 @@ class SlackAuth extends React.Component { browserHistory.replace('/dashboard'); } catch (e) { browserHistory.push('/auth-error'); - return; } } else { // Regular Slack authentication diff --git a/frontend/utils/actions.js b/frontend/utils/actions.js index 17bd12ea..42d96b88 100644 --- a/frontend/utils/actions.js +++ b/frontend/utils/actions.js @@ -1,6 +1,6 @@ export default (type, ...argNames) => { return function(...args) { - let action = { type }; + const action = { type }; argNames.forEach((arg, index) => { action[argNames[index]] = args[index]; }); diff --git a/package.json b/package.json index 6727132b..57150020 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "BeautifulAtlas", + "name": "Atlas", "private": true, "main": "index.js", "scripts": { @@ -10,7 +10,6 @@ "start": "node index.js", "dev": "cross-env NODE_ENV=development DEBUG=sql,cache,presenters ./node_modules/.bin/nodemon --watch server index.js", "lint": "eslint frontend", - "prettier": "prettier --single-quote --trailing-comma es5 --write frontend/**/*.js server/**/*.js", "deploy": "git push heroku master", "heroku-postbuild": "npm run build && npm run sequelize db:migrate", "sequelize": "./node_modules/.bin/sequelize", @@ -21,7 +20,7 @@ }, "lint-staged": { "*.js": [ - "yarn prettier", + "eslint --fix", "git add" ] }, @@ -51,7 +50,7 @@ ] }, "engines": { - "node": "6.x" + "node": ">= 7.6" }, "repository": { "type": "git", @@ -79,10 +78,12 @@ "dotenv": "^4.0.0", "emoji-name-map": "1.1.2", "eslint": "^3.19.0", - "eslint-config-airbnb": "^14.1.0", + "eslint-config-react-app": "^0.6.2", "eslint-import-resolver-webpack": "^0.3.1", + "eslint-plugin-flowtype": "^2.32.1", "eslint-plugin-import": "^2.2.0", "eslint-plugin-jsx-a11y": "^4.0.0", + "eslint-plugin-prettier": "^2.0.1", "eslint-plugin-react": "^6.10.3", "exports-loader": "0.6.3", "extract-text-webpack-plugin": "1.0.1", @@ -155,8 +156,6 @@ "devDependencies": { "babel-jest": "^15.0.0", "enzyme": "^2.4.1", - "eslint-config-prettier": "^1.7.0", - "eslint-plugin-prettier": "^2.0.1", "fetch-test-server": "^1.1.0", "identity-obj-proxy": "^3.0.0", "ignore-loader": "0.1.1", diff --git a/yarn.lock b/yarn.lock index 9dab6916..d93cace7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2640,21 +2640,9 @@ escope@^3.6.0: esrecurse "^4.1.0" estraverse "^4.1.1" -eslint-config-airbnb-base@^11.1.0: - version "11.1.3" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb-base/-/eslint-config-airbnb-base-11.1.3.tgz#0e8db71514fa36b977fbcf977c01edcf863e0cf0" - -eslint-config-airbnb@^14.1.0: - version "14.1.0" - resolved "https://registry.yarnpkg.com/eslint-config-airbnb/-/eslint-config-airbnb-14.1.0.tgz#355d290040bbf8e00bf8b4b19f4b70cbe7c2317f" - dependencies: - eslint-config-airbnb-base "^11.1.0" - -eslint-config-prettier@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-1.7.0.tgz#cda3ce22df1e852daa9370f1f3446e8b8a02ce44" - dependencies: - get-stdin "^5.0.1" +eslint-config-react-app@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/eslint-config-react-app/-/eslint-config-react-app-0.6.2.tgz#ee535cbaaf9e3576ea16b99afe720353d8730ec0" eslint-import-resolver-node@^0.2.0: version "0.2.3" @@ -2684,6 +2672,12 @@ eslint-module-utils@^2.0.0: debug "2.2.0" pkg-dir "^1.0.0" +eslint-plugin-flowtype@^2.32.1: + version "2.32.1" + resolved "https://registry.yarnpkg.com/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.32.1.tgz#bbee185dedf97e5f63ec975cdcddd199bd2a2501" + dependencies: + lodash "^4.15.0" + eslint-plugin-import@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/eslint-plugin-import/-/eslint-plugin-import-2.2.0.tgz#72ba306fad305d67c4816348a4699a4229ac8b4e" @@ -3230,7 +3224,7 @@ get-caller-file@^1.0.1: version "1.0.2" resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" -get-stdin@5.0.1, get-stdin@^5.0.1: +get-stdin@5.0.1: version "5.0.1" resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-5.0.1.tgz#122e161591e21ff4c52530305693f20e6393a398" @@ -5259,7 +5253,7 @@ lodash@4.12.0: version "4.12.0" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.12.0.tgz#2bd6dc46a040f59e686c972ed21d93dc59053258" -lodash@^4.0.0, lodash@^4.1.0, lodash@^4.10.0, lodash@^4.11.1, lodash@^4.13.1, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.6.1: +lodash@^4.0.0, lodash@^4.1.0, lodash@^4.10.0, lodash@^4.11.1, lodash@^4.13.1, lodash@^4.15.0, lodash@^4.17.2, lodash@^4.17.4, lodash@^4.2.0, lodash@^4.3.0, lodash@^4.6.1: version "4.17.4" resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"