Skip to content

Commit

Permalink
CHANGE listing so trailing commas are always present && FIX linting
Browse files Browse the repository at this point in the history
  • Loading branch information
ndelangen committed Apr 14, 2017
1 parent 14837bc commit acc053d
Show file tree
Hide file tree
Showing 220 changed files with 866 additions and 857 deletions.
19 changes: 9 additions & 10 deletions .eslintrc → .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
{
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,
"prettier/prettier": ["warn", {
"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"],
},
}
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/addon-actions/src/components/ActionLogger/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ActionLogger extends Component {
() => {
latest.style.borderLeft = borderLeft;
},
300
300,
);
}
}
Expand Down Expand Up @@ -53,7 +53,7 @@ class ActionLogger extends Component {

ActionLogger.propTypes = {
onClear: PropTypes.func,
actions: PropTypes.array
actions: PropTypes.array,
};

export default ActionLogger;
16 changes: 8 additions & 8 deletions packages/addon-actions/src/components/ActionLogger/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,36 @@ 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',
padding: '3px 3px 3px 0',
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',
Expand All @@ -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',
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -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 <ActionLoggerComponent {...props} />;
}
Expand Down
2 changes: 1 addition & 1 deletion packages/addon-actions/src/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export function register() {
const channel = addons.getChannel();
addons.addPanel(PANEL_ID, {
title: 'Action Logger',
render: () => <ActionLogger channel={channel} />
render: () => <ActionLogger channel={channel} />,
});
});
}
2 changes: 1 addition & 1 deletion packages/addon-actions/src/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
});
};

Expand Down
4 changes: 2 additions & 2 deletions packages/addon-comments/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const buttonStyles = {
backgroundColor: '#FFFFFF',
cursor: 'pointer',
fontSize: 15,
padding: '3px 10px'
padding: '3px 10px',
};

const Button = ({ children, onClick, style = {} }) => (
Expand All @@ -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;
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ marked.setOptions({
pedantic: false,
sanitize: true,
smartLists: true,
smartypants: false
smartypants: false,
});

export default class CommentForm extends Component {
Expand Down Expand Up @@ -85,5 +85,5 @@ export default class CommentForm extends Component {
}

CommentForm.propTypes = {
addComment: PropTypes.func
addComment: PropTypes.func,
};
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -34,6 +34,6 @@ export default {
lineHeight: 1.6,
color: 'rgba(0, 0, 0, 0.8)',
fontFamily: 'sans-serif',
resize: 'none'
}
resize: 'none',
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ export default class CommentItem extends Component {
CommentItem.propTypes = {
deleteComment: PropTypes.func,
comment: PropTypes.object,
ownComment: PropTypes.bool
ownComment: PropTypes.bool,
};
22 changes: 11 additions & 11 deletions packages/addon-comments/src/manager/components/CommentItem/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
//
Expand All @@ -33,26 +33,26 @@ 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',
position: 'absolute',
top: 2,
right: 0,
fontSize: 11,
color: 'rgb(200, 200, 200)'
}
color: 'rgb(200, 200, 200)',
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ export default class CommentList extends Component {
CommentList.propTypes = {
comments: PropTypes.array,
user: PropTypes.object,
deleteComment: PropTypes.func
deleteComment: PropTypes.func,
};
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,5 @@ export default class CommentsPanel extends Component {
CommentsPanel.propTypes = {
loading: PropTypes.bool,
user: PropTypes.object,
appNotAvailable: PropTypes.bool
appNotAvailable: PropTypes.bool,
};
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export default {
flex: 1,
display: 'flex',
flexDirection: 'column',
position: 'relative'
position: 'relative',
},
message: {
flex: 1,
Expand All @@ -15,7 +15,7 @@ export default {
fontSize: 11,
letterSpacing: 1,
textDecoration: 'none',
textTransform: 'uppercase'
textTransform: 'uppercase',
},
button: {
textDecoration: 'none',
Expand All @@ -24,6 +24,6 @@ export default {
background: 'rgb(240, 240, 240)',
borderRadius: 5,
textTransform: 'none',
fontSize: 12
}
fontSize: 12,
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class DataStore {
const key = this._getStoryKey(currentStory);
this.cache[key] = {
comments,
addedAt: Date.now()
addedAt: Date.now(),
};
}

Expand Down Expand Up @@ -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
);
}

Expand Down Expand Up @@ -97,12 +97,12 @@ export default class DataStore {
this.users = users.reduce(
(newUsers, user) => {
const usersObj = {
...newUsers
...newUsers,
};
usersObj[user.id] = user;
return usersObj;
},
{}
{},
);
});
});
Expand Down Expand Up @@ -193,7 +193,7 @@ export default class DataStore {
const doc = {
...comment,
...this.currentStory,
sbProtected: true
sbProtected: true,
};

return this.db.getCollection('comments').set(doc);
Expand Down
Loading

0 comments on commit acc053d

Please sign in to comment.