chore: add code formatting and linting (#952)

This commit is contained in:
Caleb
2018-08-07 14:46:54 -06:00
committed by Shawn Erquhart
parent 32e0a9b2b5
commit f801b19221
265 changed files with 5988 additions and 4481 deletions

View File

@ -3,21 +3,26 @@ import React from 'react';
const image = {
label: 'Image',
id: 'image',
fromBlock: match => match && {
image: match[2],
alt: match[1],
},
toBlock: data => `![${ data.alt || '' }](${ data.image || '' })`,
toPreview: (data, getAsset) => <img src={getAsset(data.image) || ''} alt={data.alt || ''} />, // eslint-disable-line react/display-name
fromBlock: match =>
match && {
image: match[2],
alt: match[1],
},
toBlock: data => `![${data.alt || ''}](${data.image || ''})`,
// eslint-disable-next-line react/display-name
toPreview: (data, getAsset) => <img src={getAsset(data.image) || ''} alt={data.alt || ''} />,
pattern: /^!\[(.*)\]\((.*)\)$/,
fields: [{
label: 'Image',
name: 'image',
widget: 'image',
}, {
label: 'Alt Text',
name: 'alt',
}],
fields: [
{
label: 'Image',
name: 'image',
widget: 'image',
},
{
label: 'Alt Text',
name: 'alt',
},
],
};
export default image;