Skip to content

Commit

Permalink
Lint fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
phpbits committed Aug 6, 2019
1 parent cb59a8e commit 4c11317
Show file tree
Hide file tree
Showing 3 changed files with 130 additions and 130 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"build": "wp-scripts build",
"check-engines": "wp-scripts check-engines",
"check-licenses": "wp-scripts check-licenses",
"lint:css": "wp-scripts lint-style **/*/*.scss",
"lint:css": "wp-scripts lint-style",
"lint:js": "wp-scripts lint-js",
"lint:pkg-json": "wp-scripts lint-pkg-json",
"start": "wp-scripts start",
Expand Down
94 changes: 47 additions & 47 deletions src/blocks/container/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,50 +5,50 @@ const { __ } = wp.i18n;
const { registerBlockType } = wp.blocks;
const { InnerBlocks } = wp.blockEditor;

registerBlockType( 'custom-block/container' , {
title: __( 'Custom Container' ),

description: __( 'Provide custom container.' ),

keywords: [
__( 'container' ),
__( 'wrapper' ),
__( 'section' ),
],

supports: {
align: [ 'wide', 'full' ],
anchor: true,
html: false,
},

category: 'common',

icon: 'editor-kitchensink',

attributes: {
content: {
type: 'string'
},
},

edit: ( props ) => {
const { className } = props;

return (
<div className={ className }>
<InnerBlocks renderAppender = { InnerBlocks.ButtonBlockAppender } />
</div>
);
},

save: ( props ) => {
const { className } = props;

return (
<div className={ className }>
<InnerBlocks.Content />
</div>
);
},
});
registerBlockType( 'custom-block/container', {
title: __( 'Custom Container' ),

description: __( 'Provide custom container.' ),

keywords: [
__( 'container' ),
__( 'wrapper' ),
__( 'section' ),
],

supports: {
align: [ 'wide', 'full' ],
anchor: true,
html: false,
},

category: 'common',

icon: 'editor-kitchensink',

attributes: {
content: {
type: 'string',
},
},

edit: ( props ) => {
const { className } = props;

return (
<div className={ className }>
<InnerBlocks renderAppender={ InnerBlocks.ButtonBlockAppender } />
</div>
);
},

save: ( props ) => {
const { className } = props;

return (
<div className={ className }>
<InnerBlocks.Content />
</div>
);
},
} );
164 changes: 82 additions & 82 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,87 +4,87 @@ const postcssPresetEnv = require( 'postcss-preset-env' );
const MiniCssExtractPlugin = require( 'mini-css-extract-plugin' );
const IgnoreEmitPlugin = require( 'ignore-emit-webpack-plugin' );

const production = process.env.NODE_ENV === 'production';
const production = process.env.NODE_ENV === '';

module.exports = {
...defaultConfig,
entry: {
index: path.resolve( process.cwd(), 'src', 'index.js' ),
style: path.resolve( process.cwd(), 'src', 'style.scss' ),
editor: path.resolve( process.cwd(), 'src', 'editor.scss' ),
},
optimization: {
...defaultConfig.optimization,
splitChunks: {
cacheGroups: {
editor: {
name: 'editor',
test: /editor\.(sc|sa|c)ss$/,
chunks: 'all',
enforce: true,
},
style: {
name: 'style',
test: /style\.(sc|sa|c)ss$/,
chunks: 'all',
enforce: true,
},
default: false,
},
},
},
module: {
...defaultConfig.module,
rules: [
...defaultConfig.module.rules,
{
test: /\.(sc|sa|c)ss$/,
exclude: /node_modules/,
use: [
{
loader: MiniCssExtractPlugin.loader,
},
{
loader: 'css-loader',
options: {
sourceMap: !production
}
},
{
loader: 'sass-loader',
options: {
sourceMap: !production
}
},
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: () => [
postcssPresetEnv( {
stage: 3,
features: {
'custom-media-queries': {
preserve: false,
},
'custom-properties': {
preserve: true,
},
'nesting-rules': true,
},
} ),
],
},
},
],
},
],
},
plugins: [
...defaultConfig.plugins,
new MiniCssExtractPlugin({
filename: '[name].css'
}),
new IgnoreEmitPlugin( [ 'editor.js', 'style.js' ] ),
],
};
...defaultConfig,
entry: {
index: path.resolve( process.cwd(), 'src', 'index.js' ),
style: path.resolve( process.cwd(), 'src', 'style.scss' ),
editor: path.resolve( process.cwd(), 'src', 'editor.scss' ),
},
optimization: {
...defaultConfig.optimization,
splitChunks: {
cacheGroups: {
editor: {
name: 'editor',
test: /editor\.(sc|sa|c)ss$/,
chunks: 'all',
enforce: true,
},
style: {
name: 'style',
test: /style\.(sc|sa|c)ss$/,
chunks: 'all',
enforce: true,
},
default: false,
},
},
},
module: {
...defaultConfig.module,
rules: [
...defaultConfig.module.rules,
{
test: /\.(sc|sa|c)ss$/,
exclude: /node_modules/,
use: [
{
loader: MiniCssExtractPlugin.loader,
},
{
loader: 'css-loader',
options: {
sourceMap: ! production,
},
},
{
loader: 'sass-loader',
options: {
sourceMap: ! production,
},
},
{
loader: 'postcss-loader',
options: {
ident: 'postcss',
plugins: () => [
postcssPresetEnv( {
stage: 3,
features: {
'custom-media-queries': {
preserve: false,
},
'custom-properties': {
preserve: true,
},
'nesting-rules': true,
},
} ),
],
},
},
],
},
],
},
plugins: [
...defaultConfig.plugins,
new MiniCssExtractPlugin( {
filename: '[name].css',
} ),
new IgnoreEmitPlugin( [ 'editor.js', 'style.js' ] ),
],
};

0 comments on commit 4c11317

Please sign in to comment.