Skip to content

Commit

Permalink
Fix formatting/linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
talldan committed Jan 7, 2021
1 parent 140a863 commit cfc7d2a
Show file tree
Hide file tree
Showing 20 changed files with 305 additions and 367 deletions.
17 changes: 6 additions & 11 deletions packages/e2e-tests/plugins/align-hook/index.js
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
( function() {
var registerBlockType = wp.blocks.registerBlockType;
var el = wp.element.createElement;
var InnerBlocks = wp.blockEditor.InnerBlocks;
var __ = wp.i18n.__;
var TEMPLATE = [
[ 'core/paragraph', { fontSize: 'large', content: __( 'Content…' ) } ],
];
( function () {
const registerBlockType = wp.blocks.registerBlockType;
const el = wp.element.createElement;

var baseBlock = {
const baseBlock = {
icon: 'cart',
category: 'text',
edit: function( props ) {
edit() {
return el(
'div',
{ style: { outline: '1px solid gray', padding: 5 } },
'Test Align Hook'
);
},
save: function() {
save() {
return el(
'div',
{ style: { outline: '1px solid gray', padding: 5 } },
Expand Down
34 changes: 17 additions & 17 deletions packages/e2e-tests/plugins/block-icons/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
( function() {
var registerBlockType = wp.blocks.registerBlockType;
var el = wp.element.createElement;
var InnerBlocks = wp.blockEditor.InnerBlocks;
var circle = el( 'circle', {
( function () {
const registerBlockType = wp.blocks.registerBlockType;
const el = wp.element.createElement;
const InnerBlocks = wp.blockEditor.InnerBlocks;
const circle = el( 'circle', {
cx: 10,
cy: 10,
r: 10,
fill: 'red',
stroke: 'blue',
strokeWidth: '10',
} );
var svg = el(
const svg = el(
'svg',
{ width: 20, height: 20, viewBox: '0 0 20 20' },
circle
Expand All @@ -21,7 +21,7 @@
icon: svg,
category: 'text',

edit: function() {
edit() {
return el(
'div',
{
Expand All @@ -42,7 +42,7 @@
);
},

save: function() {
save() {
return el(
'div',
{
Expand All @@ -59,7 +59,7 @@
icon: 'cart',
category: 'text',

edit: function() {
edit() {
return el(
'div',
{
Expand All @@ -80,7 +80,7 @@
);
},

save: function() {
save() {
return el(
'div',
{
Expand All @@ -94,12 +94,12 @@

registerBlockType( 'test/test-function-icon', {
title: 'TestFunctionIcon',
icon: function() {
icon() {
return svg;
},
category: 'text',

edit: function() {
edit() {
return el(
'div',
{
Expand All @@ -120,7 +120,7 @@
);
},

save: function() {
save() {
return el(
'div',
{
Expand All @@ -141,7 +141,7 @@
},
category: 'text',

edit: function() {
edit() {
return el(
'div',
{
Expand All @@ -162,7 +162,7 @@
);
},

save: function() {
save() {
return el(
'div',
{
Expand All @@ -182,7 +182,7 @@
},
category: 'text',

edit: function() {
edit() {
return el(
'div',
{
Expand All @@ -203,7 +203,7 @@
);
},

save: function() {
save() {
return el(
'div',
{
Expand Down
17 changes: 9 additions & 8 deletions packages/e2e-tests/plugins/block-variations/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
( function() {
var el = wp.element.createElement;
var registerBlockVariation = wp.blocks.registerBlockVariation;
var __ = wp.i18n.__;
var Circle = wp.primitives.Circle;
var SVG = wp.primitives.SVG;
( function () {
const el = wp.element.createElement;
const registerBlockVariation = wp.blocks.registerBlockVariation;
const __ = wp.i18n.__;
const Circle = wp.primitives.Circle;
const SVG = wp.primitives.SVG;

var redCircle = el( Circle, {
const redCircle = el( Circle, {
cx: 24,
cy: 24,
r: 15,
fill: 'red',
stroke: 'blue',
strokeWidth: '10',
} );
var redCircleIcon = el(

const redCircleIcon = el(
SVG,
{ width: 48, height: 48, viewBox: '0 0 48 48' },
redCircle
Expand Down
39 changes: 9 additions & 30 deletions packages/e2e-tests/plugins/child-blocks/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
( function() {
( function () {
const { InnerBlocks } = wp.blockEditor;
const { createElement: el } = wp.element;
const { registerBlockType } = wp.blocks;
Expand All @@ -9,19 +9,11 @@
category: 'text',

edit() {
return el(
'div',
{},
el( InnerBlocks )
);
return el( 'div', {}, el( InnerBlocks ) );
},

save() {
return el(
'div',
{},
el( InnerBlocks.Content )
);
return el( 'div', {}, el( InnerBlocks.Content ) );
},
} );

Expand All @@ -34,19 +26,14 @@
return el(
'div',
{},
el(
InnerBlocks,
{ allowedBlocks: [ 'core/paragraph', 'core/image' ] }
)
el( InnerBlocks, {
allowedBlocks: [ 'core/paragraph', 'core/image' ],
} )
);
},

save() {
return el(
'div',
{},
el( InnerBlocks.Content )
);
return el( 'div', {}, el( InnerBlocks.Content ) );
},
} );

Expand All @@ -61,19 +48,11 @@
],

edit() {
return el(
'div',
{},
'Child'
);
return el( 'div', {}, 'Child' );
},

save() {
return el(
'div',
{},
'Child'
);
return el( 'div', {}, 'Child' );
},
} );
} )();
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
( function() {
( function () {
wp.blocks.registerBlockType( 'test/container-without-paragraph', {
title: 'Container without paragraph',
category: 'text',
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/plugins/custom-grouping-block/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
( function() {
( function () {
wp.blocks.registerBlockType( 'test/alternative-group-block', {
title: 'Alternative Group Block',
category: 'design',
Expand Down
26 changes: 14 additions & 12 deletions packages/e2e-tests/plugins/deprecated-node-matcher/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
( function() {
var registerBlockType = wp.blocks.registerBlockType;
var RichText = wp.blockEditor.RichText;
var el = wp.element.createElement;
( function () {
const registerBlockType = wp.blocks.registerBlockType;
const RichText = wp.blockEditor.RichText;
const el = wp.element.createElement;

registerBlockType( 'core/deprecated-children-matcher', {
title: 'Deprecated Children Matcher',
Expand All @@ -13,16 +13,16 @@
},
},
category: 'text',
edit: function( { attributes, setAttributes } ) {
edit( { attributes, setAttributes } ) {
return el( RichText, {
tagName: 'p',
value: attributes.value,
onChange: function( nextValue ) {
onChange( nextValue ) {
setAttributes( { value: nextValue } );
},
} );
},
save: function( { attributes } ) {
save( { attributes } ) {
return el( RichText.Content, {
tagName: 'p',
value: attributes.value,
Expand All @@ -31,13 +31,15 @@
} );

function toRichTextValue( value ) {
return _.map( value, function( subValue ) {
// eslint-disable-next-line no-undef
return _.map( value, function ( subValue ) {
return subValue.children;
} );
}

function fromRichTextValue( value ) {
return _.map( value, function( subValue ) {
// eslint-disable-next-line no-undef
return _.map( value, function ( subValue ) {
return {
children: subValue,
};
Expand All @@ -59,22 +61,22 @@
},
},
category: 'text',
edit: function( { attributes, setAttributes } ) {
edit( { attributes, setAttributes } ) {
return el(
'blockquote',
{},
el( RichText, {
multiline: 'p',
value: toRichTextValue( attributes.value ),
onChange: function( nextValue ) {
onChange( nextValue ) {
setAttributes( {
value: fromRichTextValue( nextValue ),
} );
},
} )
);
},
save: function( { attributes } ) {
save( { attributes } ) {
return el(
'blockquote',
{},
Expand Down
Loading

0 comments on commit cfc7d2a

Please sign in to comment.