Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:Espressive/cascara into feature/…
Browse files Browse the repository at this point in the history
…FDS-151-eslint-some-react

# Conflicts:
#	.eslintrc.js
  • Loading branch information
brianespinosa committed Mar 3, 2021
2 parents bbe31e7 + e60fdc1 commit f7a62a1
Show file tree
Hide file tree
Showing 13 changed files with 16 additions and 25 deletions.
3 changes: 0 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ module.exports = {
'no-extra-boolean-cast': 0,
'no-prototype-builtins': 0,
'no-useless-return': 0,
'prefer-destructuring': 0,
'prefer-spread': 0,
'prefer-template': 0,
'react/forbid-prop-types': 0,
'react/jsx-key': 0,
'react/jsx-no-bind': 0,
Expand Down
2 changes: 1 addition & 1 deletion docs/src/components/Asciagram/Asciagram.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const Asciagram = ({
<details
{...rest}
className={
rest?.className ? styles.Details + ' ' + rest.className : styles.Details
rest?.className ? `${styles.Details} ${rest.className}` : styles.Details
}
open={isInitialOpen}
>
Expand Down
2 changes: 1 addition & 1 deletion packages/cascara/src/animations/utils/getKeyframesMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const getKeyframesMap = (frames) =>
Object.assign(
{},
...frames.map((frame, i) => {
const keyframePercent = Math.floor((i / (frames.length - 1)) * 100) + '%';
const keyframePercent = `${Math.floor((i / (frames.length - 1)) * 100)}%`;

return { [keyframePercent]: frame };
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ const getTransformKeyframesMap = (transforms) =>
Object.assign(
{},
...transforms.map((movement, i) => {
const keyframePercent =
Math.floor((i / (transforms.length - 1)) * 100) + '%';
const keyframePercent = `${Math.floor(
(i / (transforms.length - 1)) * 100
)}%`;

return { [keyframePercent]: { transform: movement } };
})
Expand Down
6 changes: 1 addition & 5 deletions packages/cascara/src/lib/customPropTypes/json.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,7 @@ const json = (props, propName, componentName) => {
JSON.parse(props[propName]);
} catch (e) {
return new Error(
'Invalid prop `' +
propName +
'` supplied to `' +
componentName +
'`. Validation failed.'
`Invalid prop \`${propName}\` supplied to \`${componentName}\`. Validation failed.`
);
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const JsonPlaceholder = ({
<details
{...rest}
className={
rest?.className ? styles.Details + ' ' + rest.className : styles.Details
rest?.className ? `${styles.Details} ${rest.className}` : styles.Details
}
open={isInitialOpen}
>
Expand Down
4 changes: 2 additions & 2 deletions packages/cascara/src/ui/ActionsMenu/ActionsMenu.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ const ActionsMenu = ({ trigger = DEFAULT_TRIGGER, actions }) => {
<Menu
{...menu}
aria-label='Actions Menu'
className={'ui dropdown active visible ' + styles.ActionsMenu}
className={`ui dropdown active visible ${styles.ActionsMenu}`}
tabIndex={0}
>
<div
Expand All @@ -67,7 +67,7 @@ const ActionsMenu = ({ trigger = DEFAULT_TRIGGER, actions }) => {
{...menu}
{...rest}
as='div'
className={'item ' + styles.ActionsMenuItem}
className={`item ${styles.ActionsMenuItem}`}
key={key}
onClick={() => handleMenuItemClick(rest)}
>
Expand Down
2 changes: 1 addition & 1 deletion packages/cascara/src/ui/Chat/ChatOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const getChatOptionsObj = (obj) => {
getChatMessageObj(obj),
{
...getSharedMessageKeys(obj),
key: message.id + '_buttons',
key: `${message.id}_buttons`,
message: (
<Ref id={message.id} innerRef={ref}>
<ChatOptions
Expand Down
2 changes: 1 addition & 1 deletion packages/cascara/src/ui/Chat/utils/bytesToSize.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const bytesToSize = (bytes) => {
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB'];
const int = parseInt(Math.floor(Math.log(bytes) / Math.log(1024)));
return bytes
? Math.round(bytes / Math.pow(1024, int), 2) + ' ' + sizes[int]
? `${Math.round(bytes / Math.pow(1024, int), 2)} ${sizes[int]}`
: null;
};

Expand Down
5 changes: 1 addition & 4 deletions packages/cascara/src/ui/Dashboard/widgets/WidgetGeoMap.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ const propTypes = {
* Widget for @nivo/geo (Chloropleth).
*/
const WidgetGeoMap = ({ data, ...rest }) => {
const largestValue = Math.max.apply(
Math,
data.map((object) => object.value)
);
const largestValue = Math.max(...data.map((object) => object.value));

const CHART_CONFIG = {
...CHART_DEFAULTS,
Expand Down
2 changes: 1 addition & 1 deletion packages/cascara/src/ui/Form/poc/FormPublicAPI.fixture.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ const prepareFormData = (data, config) => {
}
});

const actions = dataConfig.actions;
const { actions } = dataConfig;

return {
actions,
Expand Down
2 changes: 1 addition & 1 deletion packages/cascara/src/ui/InfoPopover/InfoPopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const InfoPopover = ({ message, style }) => {
<>
<PopoverDisclosure
{...popover}
className={styles.Disclosure + ' ui small basic circular icon button'}
className={`${styles.Disclosure} ui small basic circular icon button`}
style={style}
>
<i aria-hidden='true' className='info icon' />
Expand Down
4 changes: 2 additions & 2 deletions rollup.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ const getPostCSSOptions = () => ({
modules: {
generateScopedName: function (name, filename, css) {
const path = require('path');
const file = path.basename(filename).split('.')[0];
const [file] = path.basename(filename).split('.');
const hash = isDevelopment(process)
? 'DEV_MODE'
: stringHash(css).toString(36).substr(0, 5);

return '☕️_' + file + '_' + name + '__' + hash;
return `☕️_${file}_${name}__${hash}`;
},
},
use: ['sass'],
Expand Down

0 comments on commit f7a62a1

Please sign in to comment.